The `vscode-languageserver-types` package provides the core TypeScript type definitions for the Language Server Protocol (LSP). It defines the fundamental data structures, interfaces, and enums used to communicate between language clients (like VS Code) and language servers, enabling advanced features such as autocompletion, diagnostics, go-to-definition, and refactoring. This package is a foundational component of the larger `vscode-languageserver-node` ecosystem, offering a stable and well-defined contract for language server implementers. The current stable version is 3.17.5, which aligns with version 3.17 of the Language Server Protocol specification. Releases generally follow the evolution of the LSP and the VS Code language server client/server packages, often with pre-releases indicating upcoming changes. Its key differentiator is being the canonical TypeScript representation of the LSP specification, directly maintained by the VS Code team, ensuring high fidelity and compatibility across the ecosystem.
npm install vscode-languageserver-typesVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing core LSP types like `TextDocumentIdentifier`, `Position`, `Range`, `Hover`, and `MarkupKind` to define a document location and construct a basic hover response, illustrating how these types are used in language server communication.
Ensure your `vscode-languageserver-types` package version strictly aligns with the LSP specification version your client and server expect. When upgrading LSP versions, simultaneously upgrade `vscode-languageserver-types` and other related `vscode-languageserver-node` packages (client, server, protocol) to compatible versions.
Always install all `vscode-languageserver-node` ecosystem packages with compatible versions, ideally the same major.minor version, or as indicated by the monorepo's release notes. Use a tool like `npm-check-updates` or refer to the official repository for recommended version pairings.
Configure your project for ESM (e.g., add `"type": "module"` to `package.json` for Node.js projects) and always use `import ... from '...'` syntax. If using older environments, ensure your bundler (Webpack, Rollup) is configured to handle ESM imports correctly.
Run `npm install vscode-languageserver-types` or `yarn add vscode-languageserver-types`. Ensure your `tsconfig.json` includes `node_modules/@types` in its `typeRoots` (though usually default) and that the module resolution is correctly configured (e.g., `"moduleResolution": "Node10"` or `"bundler"`).
Update your code to use `MarkupContent` (preferred for new implementations) or an array of `MarkedString` for the `contents` property of `Hover`. For `MarkupContent`, specify `kind` (e.g., `MarkupKind.Markdown`) and `value`. Verify your `vscode-languageserver-types` version against the LSP specification to ensure correct type usage.
No dependency data recorded yet.