description: "The LSP capability seam (ctx.lsp): provider selection by file extension, four normalized code-navigation operations, and structured errors, for users and maintainers composing or extending code navigation."
English | 中文
Use dsh-lsp to give agents language-server navigation for definitions, references, implementations, and hover documentation. Queries select the configured provider by file extension and return normalized results with structured failures, so backend changes do not alter the navigation request or model-visible response. Navigation is read-only and deliberately excludes generic JSON-RPC access, rename, formatting, diagnostics, and symbol lists. This package must be combined with a provider such as dsh-lsp-stdio and the model-facing dsh-tool-lsp; alone it provides no navigation.
Mount a language-server provider and the lsp tool to give agents semantics-based code navigation that text search cannot reliably provide — distinguishing same-named functions, following import aliases, connecting an interface to its implementations, or reading inferred types. This package is the service those packages register against; it defines no UI, tool, or provider of its own.
Choose this service when a deployment wants model-visible code navigation backed by language servers. It covers read-only navigation — definitions, references, implementations, and hover — and deliberately omits mutations (rename, code actions, formatting), symbol lists, and diagnostics. The service is provider-neutral: local stdio servers, remote servers, and sandbox-native providers register the same way, so replacing the backend does not change what the model sees or how it asks.
The seam needs a provider and a consumer to do anything. A minimal composition mounts the service, a stdio provider, and the tool:
- name: '@deepseek-ai/dsh-fs-local'
- name: '@deepseek-ai/dsh-subprocess-local'
- name: '@deepseek-ai/dsh-lsp'
- name: '@deepseek-ai/dsh-lsp-stdio'
- name: '@deepseek-ai/dsh-tool-lsp'
Server commands, extension mappings, and the filesystem/subprocess pairing are configured in the provider and tool packages; see dsh-lsp-stdio and dsh-tool-lsp.
Each query asks one of four semantic questions at a cursor position in a source file; results are normalized locations or hover content, never raw protocol payloads.
| Operation | What the agent gets |
|---|---|
goToDefinition |
The declaration site(s) of the symbol at the cursor |
findReferences |
Every reference, always including the declaration |
goToImplementation |
The concrete implementation site(s) |
hover |
Normalized documentation for the symbol, or none |
findReferences always includes declarations, so impact analysis never misses the defining site. Positions are zero-based UTF-16 on the wire; the model-facing tool accepts one-based cursor coordinates and converts them.
A query fails with the structured error LSP_UNAVAILABLE when no registered provider handles the file's extension — add a provider for that extension or query a supported file. Invalid or conflicting provider registrations fail with LSP_INVALID_PROVIDER or LSP_CONFLICT before any route is published, and a query against a disposed provider fails with LSP_DISPOSED. Consumers catch LspError and route on its stable code; through the tool, these surface as error results the model can read.
Read these pages when the package-level contract is not enough. They move from the shared navigation model to the provider and the tool.
LspError codes.Indirectly, through dsh-tool-lsp, which owns the model-facing lsp schema, prompt guidance, and rendered results while this registry contributes no prompt or schema itself.
No direct invalidation; dsh-tool-lsp owns request-prefix changes.
These limits define the seam's current scope. They are package constraints, not a task backlog.
.ts, even with different language ids; overlaps fail registration. A deployment-configured selector above registrations is the intended extension, which can relax exclusive reservation without adding provider choice to model input.query() and routing the thrown LspError codes; there is no provider-change event or capability-status query.