feat(lsp): add references, rename, formatting, and inlay hints

Assisted-by: MiMo V2.5 Pro
This commit is contained in:
2026-08-21 00:35:21 +02:00
parent f1960febdc
commit 874e054ecb
3 changed files with 312 additions and 10 deletions
+29 -4
View File
@@ -116,10 +116,14 @@ func (s *Server) dispatch(msg *rpcMessage) (exit bool) {
case "initialize":
s.respond(msg.ID, initializeResult{
Capabilities: ServerCapabilities{
TextDocumentSync: 1, // full sync
CompletionProvider: map[string]any{},
HoverProvider: true,
DocumentSymbolProvider: true,
TextDocumentSync: 1, // full sync
CompletionProvider: map[string]any{},
HoverProvider: true,
DefinitionProvider: true,
ReferencesProvider: true,
RenameProvider: true,
DocumentSymbolProvider: true,
DocumentFormattingProvider: true,
SemanticTokensProvider: map[string]any{
"legend": SemanticTokensLegend{
TokenTypes: semanticTokenTypes,
@@ -127,6 +131,7 @@ func (s *Server) dispatch(msg *rpcMessage) (exit bool) {
},
"full": true,
},
InlayHintProvider: true,
},
ServerInfo: map[string]string{"name": "gasm", "version": "0.1.0"},
})
@@ -180,6 +185,26 @@ func (s *Server) dispatch(msg *rpcMessage) (exit bool) {
json.Unmarshal(msg.Params, &p)
s.respond(msg.ID, s.documentSymbols(p))
case "textDocument/references":
var p referenceParams
json.Unmarshal(msg.Params, &p)
s.respond(msg.ID, s.references(p))
case "textDocument/rename":
var p renameParams
json.Unmarshal(msg.Params, &p)
s.respond(msg.ID, s.rename(p))
case "textDocument/formatting":
var p documentFormattingParams
json.Unmarshal(msg.Params, &p)
s.respond(msg.ID, s.documentFormatting(p))
case "textDocument/inlayHint":
var p inlayHintParams
json.Unmarshal(msg.Params, &p)
s.respond(msg.ID, s.inlayHints(p))
case "textDocument/semanticTokens/full":
var p semanticTokensParams
json.Unmarshal(msg.Params, &p)