Differences from Taplo

Taplo is already famous as a TOML Language Server. However, I rewrote a new Language Server for the following purposes.

Auto Sorting

Compared to Taplo, Tombi offers more granular sorting configuration by utilizing JSON Schema metadata. These configuration options can also be distributed and shared via a JSON Schema Store.

Cargo/uv Workspace Support

Tombi supports Cargo/uv workspaces. When editing a Cargo.toml / pyproject.toml file, Tombi can navigate to the workspace definition or to the crate/package definition managed by the workspace. Also, some Code Actions are available for workspace management.

See more details: tombi-extension-cargo / tombi-extension-uv

Go to JSON Schema Definition

Tombi supports "Go to Type Definition" feature. When editing a TOML file with an applied JSON Schema, Tombi can navigate to the type definition of the JSON Schema.

See more details: Go to Type Definition

Magic Trailing Comma

Formatter inspired by Python's Black (Support for magic trailing comma)

This idea is great, it allows the user's code formatting intent to be expressed in code, not in a configuration.

I wanted to bring this idea to TOML.

Support Comment Directive

Tombi supports more comment directives than Taplo. You can control TOML version, JSON Schema, lint rules, and other options flexibly with comments.

See more details: Comment Directive

Support sub-schema

Tombi can apply JSON Schema to specific keys such as tools.* in pyproject.toml from its configuration file. This is useful when utilizing extensions that are not registered in JSON Schema.

See more details: Sub Schema

Support for TOML v1.1.0 (preview)

TOML will allow multi-line inline tables and trailing commas in the future v1.1.0. This feature makes the magic trailing comma feature more valuable. To provide that experience, Tombi will support TOML v1.1.0 features ahead of time.

See more details: TOML Versions

Stable Behavior Formatting

Taplo has a fundamental problem with the lexer. When formatting an incomplete TOML file, the AST deletes elements.

Tombi does not format invalid syntax.

Migration from Taplo

Formatting Options

Tombi provides several formatting options to make it easy for Taplo users to migrate.
The following table shows the correspondence between Taplo's options and Tombi's options:

Taplo OptionTombi OptionReason
align_entrieskey-value-equals-sign-alignment
align_commentstrailing-comment-alignment
array_trailing_commaNot supportedPlease use Magic Trailing Comma.
array_auto_expandNot supportedFixed true value.
array_auto_collapseNot supportedPlease use Magic Trailing Comma.
compact_arrays

array-comma-space-width,
array-bracket-space-width

compact_inline_tables

inline-table-comma-space-width,
inline-table-brace-space-width

inline_table_expandNot supportedFixed true value.
compact_entrieskey-value-equals-sign-space-width
column_widthline-width
indent_tablesindent-sub-tables
indent_entriesindent-table-key-value-pairs
indent_string

indent-width,
indent-style

trailing_newlineNot supportedFixed true value.
reorder_keysNot supportedSee Auto Sorting.
reorder_arraysNot supportedSee Auto Sorting.
reorder_inline_tablesNot supportedSee Auto Sorting.
allowed_blank_linesNot supportedFor Auto Sorting.
crlfline-ending

Override Config

Taplo's [[rule]] corresponds to Tombi's [[overrides]]. Both allow overriding settings for specific files using include/exclude patterns.

Tombi does not support Taplo's keys feature (per-key-path overrides). The keys feature was primarily used for selective reordering, but Tombi uses schema-based auto sorting instead. For applying schemas to specific key paths, use schemas[*].root.