Documentation
¶
Overview ¶
Decorator-arg/name LSP completions: dispatcher, context detection, error categories.
Import path + package-decl LSP completions.
Token-level helpers: duration/size unit completions + keyword list + extend-service context.
Type/decl LSP completions: project-wide decls + service/middleware/security/enum-value lookups.
Package lsp implements the CraftGo Language Server Protocol surface.
The server speaks LSP over stdio (a jsonrpc2.Stream wrapped around the caller's io.Reader / io.Writer) and forwards each open document through the existing parser + semantic analyser. Diagnostics published by the server are exactly the diagnostics the CLI would emit for the same source, so editor and CLI behaviour stay aligned by construction.
Currently supported:
- initialize / initialized / shutdown / exit lifecycle
- textDocument/didOpen / didChange / didSave / didClose
- textDocument/publishDiagnostics on every successful parse pass
- textDocument/hover (decorator, type ref, builtin docs)
- textDocument/completion (decorators, types, fields)
- textDocument/definition (cross-file decl resolution)
- textDocument/references (find all uses)
- textDocument/documentSymbol (outline)
- textDocument/formatting (canonical re-print via internal/format)
- textDocument/rename (declarations + every reference)
Any other request returns jsonrpc2.ErrMethodNotFound, which clients treat as "feature unsupported".
Index ¶
Constants ¶
const Version = "0.1.0"
Version is the server's reported version, surfaced via Initialize so clients can include it in trace logs.
Variables ¶
This section is empty.