{"id":8719,"library":"tombi","title":"Tombi: TOML Language Server & Toolkit","description":"tombi (version 0.9.18) is a comprehensive TOML Language Server and toolkit designed to provide rich editor features like auto-completion, validation, and navigation for TOML files. It focuses particularly on project configuration files such as `pyproject.toml` and `Cargo.toml`. The project is actively maintained with frequent minor releases addressing features, fixes, and dependency updates.","status":"active","version":"0.9.18","language":"en","source_language":"en","source_url":"https://github.com/tombi-toml/tombi","tags":["toml","lsp","language-server","tool","editor-integration"],"install":[{"cmd":"pip install tombi","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[],"quickstart":{"code":"import subprocess\nimport time\nimport os\n\n# This demonstrates how to start tombi as a language server process.\n# In a real editor setup, your IDE would automatically handle this\n# and communicate via the Language Server Protocol (LSP).\n\n# Note: tombi is primarily an LSP server/CLI tool, not a library for\n# direct programmatic TOML parsing in Python applications.\n# For programmatic TOML parsing, use `tomllib` (Python 3.11+) or `toml`/`tomli`.\n\n# Example: Start the tombi LSP server for standard I/O communication\nprint(\"Starting tombi LSP server using --stdio...\")\ntry:\n    process = subprocess.Popen(\n        ['python', '-m', 'tombi', '--stdio'],\n        stdin=subprocess.PIPE,\n        stdout=subprocess.PIPE,\n        stderr=subprocess.PIPE,\n        text=True, # For text-mode communication (JSON-RPC over stdio)\n        bufsize=1  # Line-buffered output for real-time communication\n    )\n\n    print(\"tombi LSP server started. In a real scenario, an LSP client (editor)\")\n    print(\"would now send JSON-RPC messages to stdin and read responses from stdout.\")\n    \n    # Simulate some operational time\n    time.sleep(2)\n    \n    print(\"Simulating a short run, now terminating the LSP server process.\")\n    process.terminate() # Attempt graceful termination\n    process.wait(timeout=5) # Wait for the process to exit\n\n    print(f\"LSP server exited with return code: {process.returncode}\")\n    \n    # Check for any error output from the server\n    stderr_output = process.stderr.read()\n    if stderr_output:\n        print(\"\\n--- stderr output from tombi LSP during startup/shutdown ---\")\n        print(stderr_output)\n        print(\"-----------------------------------------------------------\\n\")\n\nexcept FileNotFoundError:\n    print(\"Error: 'tombi' command not found. Ensure tombi is installed and in PATH.\")\n    print(\"Try: pip install tombi\")\nexcept Exception as e:\n    print(f\"An error occurred while trying to run tombi: {e}\")\n\n","lang":"python","description":"This quickstart demonstrates how to programmatically start `tombi` as an LSP server. Most users will integrate `tombi` directly with their editor's LSP client (e.g., VS Code, NeoVim, Helix), which handles the server startup and communication automatically. Direct programmatic use for TOML *data manipulation* is not `tombi`'s primary function; for that, use dedicated TOML parsing libraries."},"warnings":[{"fix":"If you rely on document links for git, path, or workspace dependencies, you must explicitly enable them in your `tombi` configuration (e.g., within your editor's LSP client settings or `tombi.toml`).","message":"As of v0.9.18, the default settings for DocumentLink have changed. Only `crates.io` and `pypi.org` links are enabled by default for cargo.toml and pyproject.toml files.","severity":"breaking","affected_versions":">=0.9.18"},{"fix":"For parsing and manipulating TOML files in your Python code, use standard libraries like `tomllib` (built-in from Python 3.11) or third-party libraries like `toml` or `tomli`.","message":"`tombi` is primarily a Language Server Protocol (LSP) server and a command-line toolkit. It is *not* intended to be imported as a Python library for programmatic parsing or manipulation of TOML data within your applications.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consult your editor's documentation for integrating LSP servers (e.g., `vscode-toml`, `nvim-lspconfig`, `helix` `languages.toml` settings) and ensure `tombi` is specified as the TOML language server. This typically involves setting the correct command path for `tombi`.","message":"Simply installing `tombi` with pip will not activate its features in your editor. `tombi` requires configuration within your editor's Language Server Protocol (LSP) client to provide rich editing capabilities.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Use a dedicated Python TOML parsing library instead. For Python 3.11+, use `import tomllib`. For older Python versions, install `tomli` or `toml` (`pip install tomli`) and use `import tomli`.","cause":"Attempting to use `tombi` for direct programmatic TOML parsing via an assumed `parse` function, which does not exist in its public API.","error":"ModuleNotFoundError: No module named 'tombi.parse'"},{"fix":"Ensure `tombi` is installed in an environment accessible by your editor's LSP client (e.g., `pip install tombi` in the activated virtual environment or globally). Verify your editor's LSP client configuration points to the correct `python -m tombi` command or the `tombi` executable.","cause":"The `tombi` executable is not found in the system's PATH, or the editor's LSP client is misconfigured regarding the `tombi` server path.","error":"LSP client failed to connect to 'tombi' server. (or similar editor-specific LSP connection error)"}]}