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 Option | Tombi Option | Reason |
|---|---|---|
align_entries | key-value-equals-sign-alignment | |
align_comments | trailing-comment-alignment | |
array_trailing_comma | Not supported | Please use Magic Trailing Comma. |
array_auto_expand | Not supported | Fixed true value. |
array_auto_collapse | Not supported | Please use Magic Trailing Comma. |
compact_arrays | ||
compact_inline_tables |
| |
inline_table_expand | Not supported | Fixed true value. |
compact_entries | key-value-equals-sign-space-width | |
column_width | line-width | |
indent_tables | indent-sub-tables | |
indent_entries | indent-table-key-value-pairs | |
indent_string | ||
trailing_newline | Not supported | Fixed true value. |
reorder_keys | Not supported | See Auto Sorting. |
reorder_arrays | Not supported | See Auto Sorting. |
reorder_inline_tables | Not supported | See Auto Sorting. |
allowed_blank_lines | Not supported | For Auto Sorting. |
crlf | line-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.