coc-toml

May 13, 2026 · View on GitHub

npm version

TOML language server extension for coc.nvim.

Powered by Tombi.

Breaking Changes in v2.0

v2.0 is a complete rewrite with the following breaking changes:

Language Server: Taplo → Tombi

The underlying language server has been replaced from Taplo to Tombi. Tombi runs as a native binary (tombi lsp) — WASM is no longer used.

The tombi binary is automatically downloaded when the extension activates. You can also specify a custom path via tombi.path setting.

Configuration namespace: toml.*tombi.*

All settings have been renamed:

v1.x (toml.*)v2.0 (tombi.*)
toml.enabledtombi.enabled
toml.activationStatus(removed)
toml.taploConfig(project-level tombi.toml instead now. global config will be implemented later)
toml.taploConfigEnabled(removed)
toml.semanticTokens(removed — handled by Tombi)
toml.formatter.*(project-level tombi.toml instead. global config will be implemented later)
toml.schema.*(project-level tombi.toml instead. global config will be implemented later)
(new)tombi.path
(new)tombi.args
(new)tombi.env

Commands renamed

v1.xv2.0
toml.syntaxTree(removed)
toml.downloadSchemastombi.refreshCache
toml.tomlToJson(removed)
toml.jsonToToml(removed)
(new)tombi.selectSchema
(new)tombi.showLanguageServerVersion
(new)tombi.restartLanguageServer

Schema configuration

Schemas are now configured in project-level tombi.toml or .tombi.toml files, not in coc-settings.json. See Tombi documentation for details. Global config by coc-settings.json will be implemented later.

Install

Prerequisites

:CocInstall coc-toml

Or via plugin manager (e.g., dein.vim):

[[plugins]]
repo    = 'kkiyama117/coc-toml'
depends = 'coc.nvim'

Configuration

Add to your coc-settings.json (:CocConfig):

{
  "tombi.enabled": true,
  "tombi.path": null,
  "tombi.args": [],
  "tombi.env": {},
  "tombi.tomlVersion": "v1.1.0",
  "tombi.schemas": []
}
SettingDescriptionDefault
tombi.enabledEnable the extensiontrue
tombi.pathAbsolute path to the tombi executable. If not set, searches PATH.null
tombi.argsAdditional arguments passed to tombi lsp[]
tombi.envEnvironment variables passed to the tombi process{}
tombi.tomlVersionDefault TOML version ("v1.0.0" or "v1.1.0"). Sent to Tombi via workspace/didChangeConfiguration and used as fallback for tombi.schemas entries that omit tomlVersion. Schema/comment directives still take precedence."v1.1.0"
tombi.schemasEditor-level JSON schema associations registered on startup. Each entry calls tombi/associateSchema.[]

Formatter, linter, and project-wide schema settings are configured in project-level tombi.toml files. For editor-level schema overrides (similar to yaml.schemas in coc-yaml), use tombi.schemas:

{
  "tombi.schemas": [
    {
      "uri": "https://json.schemastore.org/cargo.json",
      "fileMatch": ["Cargo.toml"],
      "tomlVersion": "v1.1.0"
    },
    {
      "uri": "https://json.schemastore.org/pyproject.json",
      "fileMatch": ["pyproject.toml"]
    }
  ]
}

Commands

CommandDescription
tombi.refreshCacheRefresh schema cache
tombi.selectSchemaSelect schema for current file
tombi.showLanguageServerVersionShow Tombi version
tombi.restartLanguageServerRestart the language server

Features

  • Formatting and linting for TOML files
  • Completion with schema validation
  • Go-to-definition and hover
  • Diagnostics
  • Schema association

Develop

pnpm install --frozen-lockfile
pnpm build

Testing

Smoke tests run inside a container so they are reproducible across hosts. Both Docker and Podman work — the pnpm docker:* scripts use the docker CLI name, and Podman ships a docker alias by default.

# Build the image and run every scenario (build check + all fixtures).
pnpm test

# Or step through pieces:
pnpm docker:build                # build the test image
pnpm docker:test                 # build artifact + tombi binary check
pnpm docker:test:all             # all scenarios

# Interactive shell / nvim inside the image:
pnpm docker:shell
pnpm docker:nvim

A docker/compose.yaml is also provided for docker compose / podman compose users — see pnpm compose:test, compose:test:all, compose:shell, and compose:nvim.

License

MIT.

Dependencies