{"id":14538,"library":"dot-language-server","title":"DOT Language Server","description":"The `dot-language-server` package provides a robust Language Server Protocol (LSP) implementation specifically tailored for the DOT language, which is commonly used with Graphviz. Currently at version 3.1.0, the project follows an active release cadence, with major versions introducing significant shifts like the recent transition to ECMAScript Modules (ESM) and a strict Node.js v22+ requirement in version 3.x. Its primary differentiator is its dedicated support for DOT syntax, offering features such as refactorings, diagnostics, and code completion to various LSP-compatible editors like Vim, Neovim, Visual Studio Code, Sublime Text, and Emacs. Unlike general-purpose language tools, `dot-language-server` focuses exclusively on providing a rich development experience for Graphviz users, integrating directly into editor workflows rather than requiring external compilation or visualization steps. It functions as a standalone executable.","status":"active","version":"3.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/nikeee/dot-language-server","tags":["javascript","dot","graphviz","gv","language","lsp","protocol","server"],"install":[{"cmd":"npm install dot-language-server","lang":"bash","label":"npm"},{"cmd":"yarn add dot-language-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add dot-language-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The `dot-language-server` package is primarily an executable intended to be run as a language server, not a library for direct programmatic import of functions or classes into typical JavaScript/TypeScript applications. Its interface is the Language Server Protocol via stdio or sockets. If embedding, you would typically spawn the process.","symbol":"dot-language-server","correct":"N/A - primary usage is via CLI executable `dot-language-server`"},{"note":"While a Node.js-based language server might internally expose a 'start' or 'run' function, `dot-language-server` is not designed for direct programmatic import and invocation of such methods by end-user applications. It's an application itself.","symbol":"start","correct":"N/A - see above note"},{"note":"Any internal types or interfaces like `ServerOptions` would be part of the server's internal implementation and are not exposed as part of a public API for programmatic consumption by other applications.","symbol":"ServerOptions","correct":"N/A - see above note"}],"quickstart":{"code":"{\n\t\"clients\": {\n\t\t\"dot-language-server\": {\n\t\t\t\"command\": [\"dot-language-server\", \"--stdio\"],\n\t\t\t\"enabled\": true,\n\t\t\t\"languageId\": \"dot\",\n\t\t\t\"scopes\": [\"source.dot\"],\n\t\t\t\"syntaxes\": [\"Packages/Graphviz/DOT.sublime-syntax\"]\n\t\t}\n\t}\n}\n// Note for Windows Users: You have to append `.cmd` to the first entry in the `command` array\n// (e.g., [\"dot-language-server.cmd\", \"--stdio\"]), or ensure shell execution is enabled,\n// for the server executable to be correctly located and run.","lang":"json","description":"This configuration snippet demonstrates how to integrate the `dot-language-server` into Sublime Text using the LSP package, enabling rich language features for DOT files. It includes a specific note for Windows users regarding the executable path."},"warnings":[{"fix":"Ensure your Node.js environment is updated to version 22 or later. Use `nvm` or `volta` to manage Node.js versions if necessary.","message":"Version 2.0.0 introduced a significant breaking change by requiring Node.js version 22 or higher. Earlier Node.js versions are no longer supported.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"The package is primarily an executable, not a library for programmatic import. If you are attempting to run it in a Node.js context, ensure your project is configured for ESM, or use it via its CLI command as intended.","message":"Version 3.0.0 transitioned the package to be ESM-only (ECMAScript Modules). This means any attempts to `require()` the package programmatically will likely result in errors.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Modify your LSP client configuration on Windows to specify `\"command\": [\"dot-language-server.cmd\", \"--stdio\"]` or similar, to ensure the shell can correctly locate and execute the server.","message":"On Windows, when configuring LSP clients, the `dot-language-server` executable often needs the `.cmd` extension explicitly added to its command path.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Upgrade your Node.js installation to version 22 or newer. Use `nvm install 22` and `nvm use 22` or similar version manager commands.","cause":"Attempting to run the language server with an unsupported Node.js version.","error":"Error: The 'dot-language-server' requires Node.js version 22 or higher."},{"fix":"Avoid programmatic `require()` of this package. `dot-language-server` is an executable tool. Use it by spawning its command-line interface, typically configured through your LSP client, rather than importing it as a library.","cause":"Attempting to `require()` the `dot-language-server` package programmatically in a CommonJS context, which is not supported since v3.0.0 (ESM-only).","error":"ERR_REQUIRE_ESM: require() of ES Module .../node_modules/dot-language-server/dist/server.js from ... not supported."},{"fix":"In your LSP client configuration, explicitly add `.cmd` to the executable name, e.g., change `\"command\": [\"dot-language-server\", \"--stdio\"]` to `\"command\": [\"dot-language-server.cmd\", \"--stdio\"]`.","cause":"The LSP client failed to locate the `dot-language-server` executable on Windows due to missing `.cmd` extension or shell execution issues.","error":"LSP client reports 'command not found' or server failed to start on Windows."}],"ecosystem":"npm"}