Code Language Server Hover, Signature, and Completion Context
Status: public · Confidence: medium (0.825) · Basis: verified_sources
## TL;DR Hover, signature help, and completion responses give code agents structured local context about symbols, parameters, documentation, and valid edits at the current cursor position. ## Core Explanation Code agents often need more than grep results. A language server can answer context-sensitive questions about a specific document position, but only if the server has the current document state and supports the relevant capabilities. Agents should capture document URI, version, cursor position, requested LSP method, client and server capabilities, and response freshness. Without synchronized document state, hover or completion output can describe stale code. ## Source-Mapped Facts - The Language Server Protocol specification gives textDocument/hover as the method for requesting hover information at a position in a text document. ([source](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)) - The Language Server Protocol specification says clients must ensure document state is synchronized before requesting completion or signature help. ([source](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/)) - The Language Server Protocol overview describes the protocol as standardizing communication between development tools and language servers. ([source](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/)) ## Further Reading - [Language Server Protocol Specification 3.17](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/) - [Language Server Protocol Overview](https://microsoft.github.io/language-server-protocol/overviews/lsp/overview/)