feat(lsp): add references, rename, formatting, and inlay hints
Assisted-by: MiMo V2.5 Pro
This commit is contained in:
+66
-6
@@ -157,6 +157,61 @@ type definitionParams struct {
|
||||
Position Position `json:"position"`
|
||||
}
|
||||
|
||||
type referenceParams struct {
|
||||
TextDocument textDocumentIdentifier `json:"textDocument"`
|
||||
Position Position `json:"position"`
|
||||
Context referenceContext `json:"context"`
|
||||
}
|
||||
|
||||
type referenceContext struct {
|
||||
IncludeDeclaration bool `json:"includeDeclaration"`
|
||||
}
|
||||
|
||||
type renameParams struct {
|
||||
TextDocument textDocumentIdentifier `json:"textDocument"`
|
||||
Position Position `json:"position"`
|
||||
NewName string `json:"newName"`
|
||||
}
|
||||
|
||||
// WorkspaceEdit holds changes across multiple documents.
|
||||
type WorkspaceEdit struct {
|
||||
Changes map[string][]TextEdit `json:"changes"`
|
||||
}
|
||||
|
||||
// TextEdit replaces a range with new text.
|
||||
type TextEdit struct {
|
||||
Range Range `json:"range"`
|
||||
NewText string `json:"newText"`
|
||||
}
|
||||
|
||||
type documentFormattingParams struct {
|
||||
TextDocument textDocumentIdentifier `json:"textDocument"`
|
||||
Options formattingOptions `json:"options"`
|
||||
}
|
||||
|
||||
type formattingOptions struct {
|
||||
TabSize int `json:"tabSize"`
|
||||
InsertSpaces bool `json:"insertSpaces"`
|
||||
}
|
||||
|
||||
type inlayHintParams struct {
|
||||
TextDocument textDocumentIdentifier `json:"textDocument"`
|
||||
Range Range `json:"range"`
|
||||
}
|
||||
|
||||
// InlayHint is a hint displayed inline in the editor.
|
||||
type InlayHint struct {
|
||||
Position Position `json:"position"`
|
||||
Label string `json:"label"`
|
||||
Kind int `json:"kind,omitempty"`
|
||||
Padding bool `json:"paddingLeft,omitempty"`
|
||||
Tooltip string `json:"tooltip,omitempty"`
|
||||
}
|
||||
|
||||
const (
|
||||
inlayHintTypeParameter = 2
|
||||
)
|
||||
|
||||
// Hover is the hover response.
|
||||
type Hover struct {
|
||||
Contents markupContent `json:"contents"`
|
||||
@@ -246,12 +301,17 @@ type initializeParams struct {
|
||||
|
||||
// ServerCapabilities advertises what this server provides.
|
||||
type ServerCapabilities struct {
|
||||
TextDocumentSync int `json:"textDocumentSync"`
|
||||
CompletionProvider map[string]any `json:"completionProvider,omitempty"`
|
||||
HoverProvider bool `json:"hoverProvider,omitempty"`
|
||||
DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`
|
||||
SemanticTokensProvider map[string]any `json:"semanticTokensProvider,omitempty"`
|
||||
DiagnosticProvider map[string]any `json:"diagnosticProvider,omitempty"`
|
||||
TextDocumentSync int `json:"textDocumentSync"`
|
||||
CompletionProvider map[string]any `json:"completionProvider,omitempty"`
|
||||
HoverProvider bool `json:"hoverProvider,omitempty"`
|
||||
DefinitionProvider bool `json:"definitionProvider,omitempty"`
|
||||
ReferencesProvider bool `json:"referencesProvider,omitempty"`
|
||||
RenameProvider bool `json:"renameProvider,omitempty"`
|
||||
DocumentSymbolProvider bool `json:"documentSymbolProvider,omitempty"`
|
||||
DocumentFormattingProvider bool `json:"documentFormattingProvider,omitempty"`
|
||||
SemanticTokensProvider map[string]any `json:"semanticTokensProvider,omitempty"`
|
||||
InlayHintProvider bool `json:"inlayHintProvider,omitempty"`
|
||||
DiagnosticProvider map[string]any `json:"diagnosticProvider,omitempty"`
|
||||
}
|
||||
|
||||
type initializeResult struct {
|
||||
|
||||
Reference in New Issue
Block a user