Documentation
¶
Index ¶
- Constants
- type ClientInfo
- type Command
- type CompletionItem
- type CompletionItemKind
- type CompletionItemTag
- type CompletionList
- type CompletionOptions
- type CompletionParams
- type DefinitionParams
- type Diagnostic
- type DiagnosticRelatedInformation
- type DidChangeTextDocumentParams
- type DidOpenTextDocumentParams
- type DocumentSymbol
- type DocumentSymbolParams
- type HoverParams
- type HoverResult
- type InitializeParams
- type InitializeResult
- type InsertTextFormat
- type InsertTextMode
- type Location
- type MarkupContent
- type MarkupKind
- type Position
- type PublishDiagnosticsParams
- type Range
- type ReferenceContext
- type ReferenceParams
- type ServerCapabilities
- type ServerInfo
- type TextDocumentContentChangeEvent
- type TextDocumentIdentifier
- type TextDocumentItem
- type TextDocumentPositionParams
- type TextEdit
- type VersionedTextDocumentIdentifier
Constants ¶
const ( CompletionItemKindText = CompletionItemKind(1) CompletionItemKindMethod = CompletionItemKind(2) CompletionItemKindFunction = CompletionItemKind(3) CompletionItemKindConstructor = CompletionItemKind(4) CompletionItemKindField = CompletionItemKind(5) CompletionItemKindVariable = CompletionItemKind(6) CompletionItemKindClass = CompletionItemKind(7) CompletionItemKindInterface = CompletionItemKind(8) CompletionItemKindModule = CompletionItemKind(9) CompletionItemKindProperty = CompletionItemKind(10) CompletionItemKindUnit = CompletionItemKind(11) CompletionItemKindValue = CompletionItemKind(12) CompletionItemKindEnum = CompletionItemKind(13) CompletionItemKindKeyword = CompletionItemKind(14) CompletionItemKindSnippet = CompletionItemKind(15) CompletionItemKindColor = CompletionItemKind(16) CompletionItemKindFile = CompletionItemKind(17) CompletionItemKindReference = CompletionItemKind(18) CompletionItemKindFolder = CompletionItemKind(19) CompletionItemKindEnumMember = CompletionItemKind(20) CompletionItemKindConstant = CompletionItemKind(21) CompletionItemKindStruct = CompletionItemKind(22) CompletionItemKindEvent = CompletionItemKind(23) CompletionItemKindOperator = CompletionItemKind(24) CompletionItemKindTypeParameter = CompletionItemKind(25) InsertTextFormatPlainText = InsertTextFormat(1) InsertTextFormatSnippet = InsertTextFormat(2) InsertTextModePlainText = InsertTextMode(1) InsertTextModeSnippet = InsertTextMode(2) )
const ( SymbolKindNamespace = 3 SymbolKindClass = 5 SymbolKindMethod = 6 SymbolKindField = 8 SymbolKindInterface = 11 SymbolKindFunction = 12 SymbolKindVariable = 13 SymbolKindConstant = 14 SymbolKindNumber = 16 )
LSP SymbolKind enum values. Only the kinds chunter uses are listed; the full enum is at https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#symbolKind
const ( SeverityError = 1 SeverityWarning = 2 SeverityInformation = 3 SeverityHint = 4 )
LSP DiagnosticSeverity values.
const ( DiagnosticTagUnnecessary = 1 DiagnosticTagDeprecated = 2 )
LSP DiagnosticTag values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientInfo ¶
type CompletionItem ¶
type CompletionItem struct {
Label string `json:"label"`
Kind *CompletionItemKind `json:"kind,omitempty"`
Tags []CompletionItemTag `json:"tags,omitempty"`
Detail string `json:"detail,omitempty"`
Documentation string `json:"documentation,omitempty"`
Deprecated *bool `json:"deprecated,omitempty"`
Preselect *bool `json:"preselect,omitempty"`
SortText *string `json:"sortText,omitempty"`
FilterText *string `json:"filterText,omitempty"`
InsertText *string `json:"insertText,omitempty"`
InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitempty"`
InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
TextEdit any `json:"textEdit,omitempty"` // nil | TextEdit | InsertReplaceEdit
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
CommitCharacters []string `json:"commitCharacters,omitempty"`
Command *Command `json:"command,omitempty"`
Data any `json:"data,omitempty"`
}
type CompletionItemKind ¶ added in v0.6.0
type CompletionItemKind int
type CompletionItemTag ¶ added in v0.6.0
type CompletionItemTag int
type CompletionList ¶
type CompletionList struct {
IsIncomplete bool `json:"isIncomplete"`
Items []CompletionItem `json:"items"`
}
type CompletionOptions ¶
type CompletionOptions struct {
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
}
type CompletionParams ¶
type CompletionParams struct {
TextDocumentPositionParams
}
type DefinitionParams ¶
type DefinitionParams struct {
TextDocumentPositionParams
}
type Diagnostic ¶
type Diagnostic struct {
Range Range `json:"range"`
Severity int `json:"severity"`
Source string `json:"source"`
Message string `json:"message"`
Code string `json:"code,omitempty"`
Tags []int `json:"tags,omitempty"`
RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"`
}
type DiagnosticRelatedInformation ¶ added in v0.8.0
type DiagnosticRelatedInformation struct {
Location Location `json:"location"`
Message string `json:"message"`
}
DiagnosticRelatedInformation points from a diagnostic to another location that is relevant to it (e.g. the duplicate definition site, or the place a symbol is also referenced). LSP spec: DiagnosticRelatedInformation.
type DidChangeTextDocumentParams ¶
type DidChangeTextDocumentParams struct {
TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
ContentChanges []TextDocumentContentChangeEvent `json:"contentChanges"`
}
type DidOpenTextDocumentParams ¶
type DidOpenTextDocumentParams struct {
TextDocument TextDocumentItem `json:"textDocument"`
}
type DocumentSymbol ¶ added in v0.8.0
type DocumentSymbol struct {
Name string `json:"name"`
Detail string `json:"detail,omitempty"`
Kind int `json:"kind"`
Tags []int `json:"tags,omitempty"`
Range Range `json:"range"`
SelectionRange Range `json:"selectionRange"`
Children []DocumentSymbol `json:"children,omitempty"`
}
DocumentSymbol represents one entry in the document outline. Range is the full extent of the symbol (e.g. an entire section header + body); SelectionRange is the subrange the editor should highlight / scroll to when the user picks this entry (typically just the name token).
The Children field supports nesting (e.g. a policy-map with one child per `class` block); for v1 chunter returns a flat list and leaves Children empty.
type DocumentSymbolParams ¶ added in v0.8.0
type DocumentSymbolParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DocumentSymbolParams is the parameter object for textDocument/documentSymbol. Editors call this once per document to build the breadcrumb/outline view; the server returns a flat list of top-level symbols (with optional nested children).
type HoverParams ¶
type HoverParams struct {
TextDocumentPositionParams
}
type HoverResult ¶
type HoverResult struct {
Contents MarkupContent `json:"contents"`
Range *Range `json:"range,omitempty"`
}
type InitializeParams ¶
type InitializeParams struct {
ClientInfo *ClientInfo `json:"clientInfo"`
}
type InitializeResult ¶
type InitializeResult struct {
Capabilities ServerCapabilities `json:"capabilities"`
ServerInfo ServerInfo `json:"serverInfo"`
}
type InsertTextFormat ¶ added in v0.6.0
type InsertTextFormat int
type InsertTextMode ¶ added in v0.6.0
type InsertTextMode int
type MarkupContent ¶
type MarkupContent struct {
Kind MarkupKind `json:"kind"`
Value string `json:"value"`
}
type MarkupKind ¶ added in v0.4.0
type MarkupKind string
const ( PlainText MarkupKind = "plaintext" Markdown MarkupKind = "markdown" )
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
URI string `json:"uri"`
Diagnostics []Diagnostic `json:"diagnostics"`
}
type ReferenceContext ¶ added in v0.8.0
type ReferenceContext struct {
IncludeDeclaration bool `json:"includeDeclaration"`
}
ReferenceContext carries the includeDeclaration flag for a references request.
type ReferenceParams ¶ added in v0.8.0
type ReferenceParams struct {
TextDocumentPositionParams
Context ReferenceContext `json:"context"`
}
ReferenceParams is the parameter object for textDocument/references. Embeds TextDocumentPositionParams (textDocument + position) and adds the ReferenceContext flag controlling whether the declaration site is also returned.
type ServerCapabilities ¶
type ServerCapabilities struct {
TextDocumentSync int `json:"textDocumentSync"`
HoverProvider bool `json:"hoverProvider"`
DefinitionProvider bool `json:"definitionProvider"`
ReferencesProvider bool `json:"referencesProvider"`
DocumentSymbolProvider bool `json:"documentSymbolProvider"`
CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
}
type ServerInfo ¶
type TextDocumentContentChangeEvent ¶
type TextDocumentContentChangeEvent struct {
Text string `json:"text"`
}
type TextDocumentIdentifier ¶
type TextDocumentIdentifier struct {
URI string `json:"uri"`
}
type TextDocumentItem ¶
type TextDocumentPositionParams ¶
type TextDocumentPositionParams struct {
TextDocument TextDocumentIdentifier `json:"textDocument"`
Position Position `json:"position"`
}