feat(lsp): pull diagnostics, include links and folding ranges

Assisted-by: GLM 5.3 Flash
This commit is contained in:
2026-08-30 21:42:12 +02:00
parent 41b387e54d
commit b4da13d0f6
6 changed files with 239 additions and 22 deletions
+40
View File
@@ -305,6 +305,46 @@ type ServerCapabilities struct {
SemanticTokensProvider map[string]any `json:"semanticTokensProvider,omitempty"`
InlayHintProvider bool `json:"inlayHintProvider,omitempty"`
DiagnosticProvider map[string]any `json:"diagnosticProvider,omitempty"`
DocumentLinkProvider map[string]any `json:"documentLinkProvider,omitempty"`
FoldingRangeProvider bool `json:"foldingRangeProvider,omitempty"`
}
// --- pull diagnostics ---------------------------------------------------------
type diagnosticParams struct {
TextDocument textDocumentIdentifier `json:"textDocument"`
}
// documentDiagnosticReport is the pull-diagnostics result: a full report for
// one document.
type documentDiagnosticReport struct {
Kind string `json:"kind"` // always "full"
Items []Diagnostic `json:"items"`
}
// --- document links -----------------------------------------------------------
type documentLinkParams struct {
TextDocument textDocumentIdentifier `json:"textDocument"`
}
// DocumentLink links a #include path to the header file it resolves to.
type DocumentLink struct {
Range Range `json:"range"`
Target string `json:"target"`
}
// --- folding ranges -----------------------------------------------------------
type foldingRangeParams struct {
TextDocument textDocumentIdentifier `json:"textDocument"`
}
// FoldingRange marks a collapsible region: a TEXT function's body.
type FoldingRange struct {
StartLine int `json:"startLine"`
EndLine int `json:"endLine"`
Kind string `json:"kind,omitempty"`
}
// --- code actions -------------------------------------------------------------