Documentation
¶
Overview ¶
Example ¶
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"os"
"sync"
"github.com/newstack-cloud/ls-builder/common"
"github.com/newstack-cloud/ls-builder/server"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
func main() {
// This example demonstrates how to create an LSP server
// using the ls-builder LSP 3.17 package.
// This only initialises a connection as a part of the actual example test,
// but when wired up to a real client, such as visual studio code,
// the rest of the handlers will be called as expected.
logger, err := setupLogger()
if err != nil {
log.Fatal(err)
}
state := NewState()
traceService := NewTraceService(logger)
app := NewApplication(state, traceService, logger)
app.Setup()
srv := server.NewServer(app.Handler(), true, logger, nil)
// A testable example can not use transports over the network,
// so we use an emulation of a stdio connection to test communication
// between the client and server instead.
// In a real-world scenario, you would use a transport like stdio, TCP
// or WebSockets.
//
// It's also worth noting that the Language Server Protocol also expects the
// server to provide command line arguments to allow the
// client to select the transport to be used.
// See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#implementationConsiderations
connContainer := createTestConnectionsContainer(srv.NewHandler())
go srv.Serve(connContainer.serverConn, logger)
ctx, cancel := context.WithTimeout(context.Background(), server.DefaultTimeout)
defer cancel()
clientLSPContext := server.NewLSPContext(ctx, connContainer.clientConn, nil)
initialiseParams := InitializeParams{}
err = json.Unmarshal([]byte(initialiseParamsStr), &initialiseParams)
if err != nil {
log.Fatal(err)
}
initialiseResult := InitializeResult{}
err = clientLSPContext.Call(MethodInitialize, initialiseParams, &initialiseResult)
if err != nil {
log.Fatal(err)
}
err = clientLSPContext.Notify(MethodInitialized, InitializedParams{})
if err != nil {
log.Fatal(err)
}
}
const Name string = "Test Language Server"
var Version string = "0.1.0"
var ConfigSection string = "test-language-server"
type State struct {
hasWorkspaceFolderCapability bool
hasConfigurationCapability bool
documentSettings map[string]*DocSettings
lock sync.Mutex
}
func NewState() *State {
return &State{
documentSettings: make(map[string]*DocSettings),
}
}
type DocSettings struct {
Trace DocTraceSettings `json:"trace"`
MaxNumberOfProblems int `json:"maxNumberOfProblems"`
}
type DocTraceSettings struct {
Server string `json:"server"`
}
func (s *State) HasWorkspaceFolderCapability() bool {
s.lock.Lock()
defer s.lock.Unlock()
return s.hasWorkspaceFolderCapability
}
func (s *State) SetWorkspaceFolderCapability(value bool) {
s.lock.Lock()
defer s.lock.Unlock()
s.hasWorkspaceFolderCapability = value
}
func (s *State) HasConfigurationCapability() bool {
s.lock.Lock()
defer s.lock.Unlock()
return s.hasConfigurationCapability
}
func (s *State) SetConfigurationCapability(value bool) {
s.lock.Lock()
defer s.lock.Unlock()
s.hasConfigurationCapability = value
}
func (s *State) ClearDocSettings() {
s.lock.Lock()
defer s.lock.Unlock()
s.documentSettings = make(map[string]*DocSettings)
}
type Application struct {
handler *Handler
state *State
logger *zap.Logger
traceService *TraceService
}
func NewApplication(state *State, traceService *TraceService, logger *zap.Logger) *Application {
return &Application{
state: state,
logger: logger,
traceService: traceService,
}
}
func (a *Application) handleInitialise(ctx *common.LSPContext, params *InitializeParams) (any, error) {
a.logger.Debug("Initialising server...")
clientCapabilities := params.Capabilities
capabilities := a.handler.CreateServerCapabilities()
capabilities.CompletionProvider = &CompletionOptions{}
hasWorkspaceFolderCapability := clientCapabilities.Workspace != nil && clientCapabilities.Workspace.WorkspaceFolders != nil
a.state.SetWorkspaceFolderCapability(hasWorkspaceFolderCapability)
hasConfigurationCapability := clientCapabilities.Workspace != nil && clientCapabilities.Workspace.Configuration != nil
a.state.SetConfigurationCapability(hasConfigurationCapability)
result := InitializeResult{
Capabilities: capabilities,
ServerInfo: &InitializeResultServerInfo{
Name: Name,
Version: &Version,
},
}
if hasWorkspaceFolderCapability {
result.Capabilities.Workspace = &ServerWorkspaceCapabilities{
WorkspaceFolders: &WorkspaceFoldersServerCapabilities{
Supported: &hasWorkspaceFolderCapability,
},
}
}
return result, nil
}
func (a *Application) handleInitialised(ctx *common.LSPContext, params *InitializedParams) error {
if a.state.HasConfigurationCapability() {
a.handler.SetWorkspaceDidChangeConfigurationHandler(
a.handleWorkspaceDidChangeConfiguration,
)
}
return nil
}
func (a *Application) handleWorkspaceDidChangeConfiguration(ctx *common.LSPContext, params *DidChangeConfigurationParams) error {
if a.state.HasConfigurationCapability() {
// Reset all the cached document settings.
a.state.ClearDocSettings()
}
return nil
}
func (a *Application) handleTextDocumentDidChange(ctx *common.LSPContext, params *DidChangeTextDocumentParams) error {
dispatcher := NewDispatcher(ctx)
err := dispatcher.LogMessage(LogMessageParams{
Type: MessageTypeInfo,
Message: "Text document changed (server received)",
})
if err != nil {
return err
}
ValidateTextDocument(dispatcher, a.state, params, a.logger)
return nil
}
func GetDocumentSettings(dispatcher *Dispatcher, state *State, uri string) (*DocSettings, error) {
state.lock.Lock()
defer state.lock.Unlock()
if settings, ok := state.documentSettings[uri]; ok {
return settings, nil
} else {
configResponse := []DocSettings{}
err := dispatcher.WorkspaceConfiguration(ConfigurationParams{
Items: []ConfigurationItem{
{
ScopeURI: &uri,
Section: &ConfigSection,
},
},
}, &configResponse)
if err != nil {
return nil, err
}
err = dispatcher.LogMessage(LogMessageParams{
Type: MessageTypeInfo,
Message: "document workspace configuration (server received)",
})
if err != nil {
return nil, err
}
if len(configResponse) > 0 {
state.documentSettings[uri] = &configResponse[0]
return &configResponse[0], nil
}
}
return &DocSettings{
Trace: DocTraceSettings{
Server: "off",
},
MaxNumberOfProblems: 100,
}, nil
}
func ValidateTextDocument(
dispatcher *Dispatcher,
state *State,
changeParams *DidChangeTextDocumentParams,
logger *zap.Logger,
) ([]Diagnostic, error) {
var diagnostics []Diagnostic
settings, err := GetDocumentSettings(dispatcher, state, changeParams.TextDocument.URI)
if err != nil {
return diagnostics, err
}
logger.Debug(fmt.Sprintf("Settings: %v", settings))
return diagnostics, nil
}
func (a *Application) handleShutdown(ctx *common.LSPContext) error {
a.logger.Info("Shutting down server...")
return nil
}
func (a *Application) Setup() {
a.handler = NewHandler(
WithInitializeHandler(a.handleInitialise),
WithInitializedHandler(a.handleInitialised),
WithShutdownHandler(a.handleShutdown),
WithTextDocumentDidChangeHandler(a.handleTextDocumentDidChange),
WithSetTraceHandler(a.traceService.CreateSetTraceHandler()),
)
}
func setupLogger() (*zap.Logger, error) {
pe := zap.NewProductionEncoderConfig()
pe.EncodeTime = nil
core := zapcore.NewCore(
zapcore.NewConsoleEncoder(pe),
zapcore.AddSync(os.Stdout),
zap.DebugLevel,
)
logger := zap.New(core)
return logger, nil
}
func (a *Application) Handler() *Handler {
return a.handler
}
const (
initialiseParamsStr = `
{
"processId": 18301,
"clientInfo": {
"name": "Visual Studio Code",
"version": "1.90.2"
},
"locale": "en",
"rootPath": "/Users/testuser/sandbox-vscode-extension/server-example-test",
"rootUri": "file:///Users/testuser/sandbox-vscode-extension/server-example-test",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
],
"failureHandling": "textOnlyTransactional",
"normalizesLineEndings": true,
"changeAnnotationSupport": {
"groupsOnLabel": true
}
},
"configuration": true,
"didChangeWatchedFiles": {
"dynamicRegistration": true,
"relativePatternSupport": true
},
"symbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"tagSupport": {
"valueSet": [
1
]
},
"resolveSupport": {
"properties": [
"location.range"
]
}
},
"codeLens": {
"refreshSupport": true
},
"executeCommand": {
"dynamicRegistration": true
},
"didChangeConfiguration": {
"dynamicRegistration": true
},
"workspaceFolders": true,
"foldingRange": {
"refreshSupport": true
},
"semanticTokens": {
"refreshSupport": true
},
"fileOperations": {
"dynamicRegistration": true,
"didCreate": true,
"didRename": true,
"didDelete": true,
"willCreate": true,
"willRename": true,
"willDelete": true
},
"inlineValue": {
"refreshSupport": true
},
"inlayHint": {
"refreshSupport": true
},
"diagnostics": {
"refreshSupport": true
}
},
"textDocument": {
"publishDiagnostics": {
"relatedInformation": true,
"versionSupport": false,
"tagSupport": {
"valueSet": [
1,
2
]
},
"codeDescriptionSupport": true,
"dataSupport": true
},
"synchronization": {
"dynamicRegistration": true,
"willSave": true,
"willSaveWaitUntil": true,
"didSave": true
},
"completion": {
"dynamicRegistration": true,
"contextSupport": true,
"completionItem": {
"snippetSupport": true,
"commitCharactersSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"deprecatedSupport": true,
"preselectSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"insertReplaceSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"detail",
"additionalTextEdits"
]
},
"insertTextModeSupport": {
"valueSet": [
1,
2
]
},
"labelDetailsSupport": true
},
"insertTextMode": 2,
"completionItemKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25
]
},
"completionList": {
"itemDefaults": [
"commitCharacters",
"editRange",
"insertTextFormat",
"insertTextMode",
"data"
]
}
},
"hover": {
"dynamicRegistration": true,
"contentFormat": [
"markdown",
"plaintext"
]
},
"signatureHelp": {
"dynamicRegistration": true,
"signatureInformation": {
"documentationFormat": [
"markdown",
"plaintext"
],
"parameterInformation": {
"labelOffsetSupport": true
},
"activeParameterSupport": true
},
"contextSupport": true
},
"definition": {
"dynamicRegistration": true,
"linkSupport": true
},
"references": {
"dynamicRegistration": true
},
"documentHighlight": {
"dynamicRegistration": true
},
"documentSymbol": {
"dynamicRegistration": true,
"symbolKind": {
"valueSet": [
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26
]
},
"hierarchicalDocumentSymbolSupport": true,
"tagSupport": {
"valueSet": [
1
]
},
"labelSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"disabledSupport": true,
"dataSupport": true,
"resolveSupport": {
"properties": [
"edit"
]
},
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"honorsChangeAnnotations": true
},
"codeLens": {
"dynamicRegistration": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true,
"rangesSupport": true
},
"onTypeFormatting": {
"dynamicRegistration": true
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true,
"prepareSupportDefaultBehavior": 1,
"honorsChangeAnnotations": true
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"typeDefinition": {
"dynamicRegistration": true,
"linkSupport": true
},
"implementation": {
"dynamicRegistration": true,
"linkSupport": true
},
"colorProvider": {
"dynamicRegistration": true
},
"foldingRange": {
"dynamicRegistration": true,
"rangeLimit": 5000,
"lineFoldingOnly": true,
"foldingRangeKind": {
"valueSet": [
"comment",
"imports",
"region"
]
},
"foldingRange": {
"collapsedText": false
}
},
"declaration": {
"dynamicRegistration": true,
"linkSupport": true
},
"selectionRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": true
},
"semanticTokens": {
"dynamicRegistration": true,
"tokenTypes": [
"namespace",
"type",
"class",
"enum",
"interface",
"struct",
"typeParameter",
"parameter",
"variable",
"property",
"enumMember",
"event",
"function",
"method",
"macro",
"keyword",
"modifier",
"comment",
"string",
"number",
"regexp",
"operator",
"decorator"
],
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"formats": [
"relative"
],
"requests": {
"range": true,
"full": {
"delta": true
}
},
"multilineTokenSupport": false,
"overlappingTokenSupport": false,
"serverCancelSupport": true,
"augmentsSyntaxTokens": true
},
"linkedEditingRange": {
"dynamicRegistration": true
},
"typeHierarchy": {
"dynamicRegistration": true
},
"inlineValue": {
"dynamicRegistration": true
},
"inlayHint": {
"dynamicRegistration": true,
"resolveSupport": {
"properties": [
"tooltip",
"textEdits",
"label.tooltip",
"label.location",
"label.command"
]
}
},
"diagnostic": {
"dynamicRegistration": true,
"relatedDocumentSupport": false
}
},
"window": {
"showMessage": {
"messageActionItem": {
"additionalPropertiesSupport": true
}
},
"showDocument": {
"support": true
},
"workDoneProgress": true
},
"general": {
"staleRequestSupport": {
"cancel": true,
"retryOnContentModified": [
"textDocument/semanticTokens/full",
"textDocument/semanticTokens/range",
"textDocument/semanticTokens/full/delta"
]
},
"regularExpressions": {
"engine": "ECMAScript",
"version": "ES2020"
},
"markdown": {
"parser": "marked",
"version": "1.1.0"
},
"positionEncodings": [
"utf-16"
]
},
"notebookDocument": {
"synchronization": {
"dynamicRegistration": true,
"executionSummarySupport": true
}
}
},
"trace": "verbose",
"workspaceFolders": [
{
"uri": "file:///Users/testuser/sandbox-vscode-extension/server-example-test",
"name": "server-example-test"
}
]
}
`
)
Output: info new stream connection debug Initialising server...
Index ¶
- Constants
- Variables
- type AnnotatedTextEdit
- type ApplyWorkspaceEditParams
- type ApplyWorkspaceEditResult
- type BoolOrString
- type CallHierarchyClientCapabilities
- type CallHierarchyIncomingCall
- type CallHierarchyIncomingCallsHandlerFunc
- type CallHierarchyIncomingCallsParams
- type CallHierarchyItem
- type CallHierarchyOptions
- type CallHierarchyOutgoingCall
- type CallHierarchyOutgoingCallsHandlerFunc
- type CallHierarchyOutgoingCallsParams
- type CallHierarchyPrepareParams
- type CallHierarchyRegistrationOptions
- type CancelParams
- type CancelRequestHandlerFunc
- type ChangeAnnotation
- type ChangeAnnotationIdentifier
- type ChangeAnnotationSupport
- type ClientCapabilities
- type ClientWorkspaceCapabilities
- type CodeAction
- type CodeActionClientCapabilities
- type CodeActionContext
- type CodeActionDisabledReason
- type CodeActionHandlerFunc
- type CodeActionKind
- type CodeActionKindCapabilities
- type CodeActionLiteralSupport
- type CodeActionOptions
- type CodeActionOrCommand
- type CodeActionParams
- type CodeActionResolveHandlerFunc
- type CodeActionResolveSupport
- type CodeActionTriggerKind
- type CodeDescription
- type CodeLens
- type CodeLensClientCapabilities
- type CodeLensHandlerFunc
- type CodeLensOptions
- type CodeLensParams
- type CodeLensResolveHandlerFunc
- type CodeLensWorkspaceClientCapabilities
- type Color
- type ColorInformation
- type ColorPresentation
- type ColorPresentationParams
- type Command
- type CompletionClientCapabilities
- type CompletionContext
- type CompletionHandlerFunc
- type CompletionItem
- type CompletionItemCapabilities
- type CompletionItemDefaults
- type CompletionItemInsertTextMode
- type CompletionItemInsertTextModeSupport
- type CompletionItemKind
- type CompletionItemKindCapabilities
- type CompletionItemLabelDetails
- type CompletionItemResolveHandlerFunc
- type CompletionItemResolveSupport
- type CompletionItemTag
- type CompletionItemTagSupport
- type CompletionList
- type CompletionListCapabilities
- type CompletionOptions
- type CompletionOptionsItem
- type CompletionParams
- type CompletionTriggerKind
- type ConfigurationItem
- type ConfigurationParams
- type CreateFile
- type CreateFileOptions
- type CreateFilesParams
- type Decimal
- type DeclarationClientCapabilities
- type DeclarationOptions
- type DeclarationParams
- type DeclarationRegistrationOptions
- type DefinitionClientCapabilities
- type DefinitionOptions
- type DefinitionParams
- type DeleteFile
- type DeleteFileOptions
- type DeleteFilesParams
- type Diagnostic
- type DiagnosticClientCapabilities
- type DiagnosticOptions
- type DiagnosticRegistrationOptions
- type DiagnosticRelatedInformation
- type DiagnosticSeverity
- type DiagnosticTag
- type DiagnosticTagSupport
- type DiagnosticWorkspaceClientCapabilities
- type DidChangeConfigurationClientCapabilities
- type DidChangeConfigurationParams
- type DidChangeNotebookDocumentParams
- type DidChangeTextDocumentParams
- type DidChangeWatchedFilesClientCapabilities
- type DidChangeWatchedFilesParams
- type DidChangeWorkspaceFoldersParams
- type DidCloseNotebookDocumentParams
- type DidCloseTextDocumentParams
- type DidOpenNotebookDocumentParams
- type DidOpenTextDocumentParams
- type DidSaveNotebookDocumentParams
- type DidSaveTextDocumentParams
- type Dispatcher
- func (d *Dispatcher) ApplyWorkspaceEdit(params ApplyWorkspaceEditParams) (*ApplyWorkspaceEditResult, error)
- func (d *Dispatcher) CancelRequest(params CancelParams) error
- func (d *Dispatcher) CodeLensRefresh() error
- func (d *Dispatcher) Context() *common.LSPContext
- func (d *Dispatcher) CreateWorkDoneProgress(params WorkDoneProgressCreateParams) error
- func (d *Dispatcher) DiagnosticsRefresh() error
- func (d *Dispatcher) InlayHintRefresh() error
- func (d *Dispatcher) InlineValueRefresh() error
- func (d *Dispatcher) LogMessage(params LogMessageParams) error
- func (d *Dispatcher) LogTrace(params LogTraceParams) error
- func (d *Dispatcher) Progress(params ProgressParams) error
- func (d *Dispatcher) PublishDiagnostics(params PublishDiagnosticsParams) error
- func (d *Dispatcher) RegisterCapability(params RegistrationParams) error
- func (d *Dispatcher) SemanticTokensRefresh() error
- func (d *Dispatcher) ShowMessageNotification(params ShowMessageParams) error
- func (d *Dispatcher) ShowMessageRequest(params ShowMessageRequestParams) (*MessageActionItem, error)
- func (d *Dispatcher) Telemetry(params TelemetryEventParams) error
- func (d *Dispatcher) UnregisterCapability(params UnregistrationParams) error
- func (d *Dispatcher) WorkspaceConfiguration(params ConfigurationParams, target any) error
- func (d *Dispatcher) WorkspaceFolders() ([]WorkspaceFolder, error)
- type DocumentColorClientCapabilities
- type DocumentColorHandlerFunc
- type DocumentColorOptions
- type DocumentColorParams
- type DocumentColorPresentationHandlerFunc
- type DocumentColorRegistrationOptions
- type DocumentDiagnosticHandlerFunc
- type DocumentDiagnosticParams
- type DocumentDiagnosticReportKind
- type DocumentDiagnosticReportPartialResult
- type DocumentFilter
- type DocumentFormattingClientCapabilities
- type DocumentFormattingHandlerFunc
- type DocumentFormattingOptions
- type DocumentFormattingParams
- type DocumentHighlight
- type DocumentHighlightClientCapabilities
- type DocumentHighlightHandlerFunc
- type DocumentHighlightKind
- type DocumentHighlightOptions
- type DocumentHighlightParams
- type DocumentLink
- type DocumentLinkClientCapabilities
- type DocumentLinkHandlerFunc
- type DocumentLinkOptions
- type DocumentLinkParams
- type DocumentLinkResolveHandlerFunc
- type DocumentLinkedEditingRangeHandlerFunc
- type DocumentOnTypeFormattingClientCapabilities
- type DocumentOnTypeFormattingHandlerFunc
- type DocumentOnTypeFormattingOptions
- type DocumentOnTypeFormattingParams
- type DocumentPrepareRenameHandlerFunc
- type DocumentRangeFormattingClientCapabilities
- type DocumentRangeFormattingHandlerFunc
- type DocumentRangeFormattingOptions
- type DocumentRangeFormattingParams
- type DocumentRenameHandlerFunc
- type DocumentSelector
- type DocumentSymbol
- type DocumentSymbolClientCapabilities
- type DocumentSymbolHandlerFunc
- type DocumentSymbolOptions
- type DocumentSymbolParams
- type DocumentURI
- type DocumentURIObject
- type ErrorWithData
- type ExecuteCommandClientCapabilities
- type ExecuteCommandOptions
- type ExecuteCommandParams
- type ExitHandlerFunc
- type FailureHandlingKind
- type FileChangeType
- type FileCreate
- type FileDelete
- type FileEvent
- type FileOperationClientCapabilities
- type FileOperationFilter
- type FileOperationPattern
- type FileOperationPatternKind
- type FileOperationPatternOptions
- type FileOperationRegistrationOptions
- type FileRename
- type FindReferencesHandlerFunc
- type FoldingRange
- type FoldingRangeCapabilities
- type FoldingRangeClientCapabilities
- type FoldingRangeHandlerFunc
- type FoldingRangeKind
- type FoldingRangeKindCapabilities
- type FoldingRangeOptions
- type FoldingRangeParams
- type FoldingRangeRegistrationOptions
- type FormattingOptions
- type FullDocumentDiagnosticReport
- type GeneralClientCapabilities
- type GotoDeclarationHandlerFunc
- type GotoDefinitionHandlerFunc
- type GotoImplementationHandlerFunc
- type GotoTypeDefinitionHandlerFunc
- type Handler
- func (h *Handler) CreateServerCapabilities() ServerCapabilities
- func (h *Handler) Handle(ctx *common.LSPContext) (r any, validMethod bool, validParams bool, err error)
- func (h *Handler) IsInitialized() bool
- func (h *Handler) SetCallHierarchyIncomingCallsHandler(handler CallHierarchyIncomingCallsHandlerFunc)
- func (h *Handler) SetCallHierarchyOutgoingCallsHandler(handler CallHierarchyOutgoingCallsHandlerFunc)
- func (h *Handler) SetCancelRequestHandler(handler CancelRequestHandlerFunc)
- func (h *Handler) SetCodeActionHandler(handler CodeActionHandlerFunc)
- func (h *Handler) SetCodeActionResolveHandler(handler CodeActionResolveHandlerFunc)
- func (h *Handler) SetCodeLensHandler(handler CodeLensHandlerFunc)
- func (h *Handler) SetCodeLensResolveHandler(handler CodeLensResolveHandlerFunc)
- func (h *Handler) SetCompletionHandler(handler CompletionHandlerFunc)
- func (h *Handler) SetCompletionItemResolveHandler(handler CompletionItemResolveHandlerFunc)
- func (h *Handler) SetDocumentColorHandler(handler DocumentColorHandlerFunc)
- func (h *Handler) SetDocumentColorPresentationHandler(handler DocumentColorPresentationHandlerFunc)
- func (h *Handler) SetDocumentDiagnosticsHandler(handler DocumentDiagnosticHandlerFunc)
- func (h *Handler) SetDocumentFormattingHandler(handler DocumentFormattingHandlerFunc)
- func (h *Handler) SetDocumentHighlightHandler(handler DocumentHighlightHandlerFunc)
- func (h *Handler) SetDocumentLinkHandler(handler DocumentLinkHandlerFunc)
- func (h *Handler) SetDocumentLinkResolveHandler(handler DocumentLinkResolveHandlerFunc)
- func (h *Handler) SetDocumentLinkedEditingRangeHandler(handler DocumentLinkedEditingRangeHandlerFunc)
- func (h *Handler) SetDocumentOnTypeFormattingHandler(handler DocumentOnTypeFormattingHandlerFunc)
- func (h *Handler) SetDocumentPrepareRenameHandler(handler DocumentPrepareRenameHandlerFunc)
- func (h *Handler) SetDocumentRangeFormattingHandler(handler DocumentRangeFormattingHandlerFunc)
- func (h *Handler) SetDocumentRenameHandler(handler DocumentRenameHandlerFunc)
- func (h *Handler) SetDocumentSymbolHandler(handler DocumentSymbolHandlerFunc)
- func (h *Handler) SetExitHandler(handler ExitHandlerFunc)
- func (h *Handler) SetFindReferencesHandler(handler FindReferencesHandlerFunc)
- func (h *Handler) SetFoldingRangeHandler(handler FoldingRangeHandlerFunc)
- func (h *Handler) SetGotoDeclarationHandler(handler GotoDeclarationHandlerFunc)
- func (h *Handler) SetGotoDefinitionHandler(handler GotoDefinitionHandlerFunc)
- func (h *Handler) SetGotoImplementationHandler(handler GotoImplementationHandlerFunc)
- func (h *Handler) SetGotoTypeDefinitionHandler(handler GotoTypeDefinitionHandlerFunc)
- func (h *Handler) SetHoverHandler(handler HoverHandlerFunc)
- func (h *Handler) SetInitializeHandler(handler InitializeHandlerFunc)
- func (h *Handler) SetInitialized(initialized bool)
- func (h *Handler) SetInitializedHandler(handler InitializedHandlerFunc)
- func (h *Handler) SetInlayHintHandler(handler InlayHintHandlerFunc)
- func (h *Handler) SetInlayHintResolveHandler(handler InlayHintResolveHandlerFunc)
- func (h *Handler) SetInlineValueHandler(handler InlineValueHandlerFunc)
- func (h *Handler) SetMonikerHandler(handler MonikerHandlerFunc)
- func (h *Handler) SetNotebookDocumentDidChangeHandler(handler NotebookDocumentDidChangeHandlerFunc)
- func (h *Handler) SetNotebookDocumentDidCloseHandler(handler NotebookDocumentDidCloseHandlerFunc)
- func (h *Handler) SetNotebookDocumentDidOpenHandler(handler NotebookDocumentDidOpenHandlerFunc)
- func (h *Handler) SetNotebookDocumentDidSaveHandler(handler NotebookDocumentDidSaveHandlerFunc)
- func (h *Handler) SetPrepareCallHierarchyHandler(handler PrepareCallHierarchyHandlerFunc)
- func (h *Handler) SetPrepareTypeHierarchyHandler(handler PrepareTypeHierarchyHandlerFunc)
- func (h *Handler) SetProgressHandler(handler ProgressHandlerFunc)
- func (h *Handler) SetSelectionRangeHandler(handler SelectionRangeHandlerFunc)
- func (h *Handler) SetSemanticTokensFullDeltaHandler(handler SemanticTokensFullDeltaHandlerFunc)
- func (h *Handler) SetSemanticTokensFullHandler(handler SemanticTokensFullHandlerFunc)
- func (h *Handler) SetSemanticTokensRangeHandler(handler SemanticTokensRangeHandlerFunc)
- func (h *Handler) SetShutdownHandler(handler ShutdownHandlerFunc)
- func (h *Handler) SetSignatureHelpHandler(handler SignatureHelpHandlerFunc)
- func (h *Handler) SetTextDocumentDidChangeHandler(handler TextDocumentDidChangeHandlerFunc)
- func (h *Handler) SetTextDocumentDidCloseHandler(handler TextDocumentDidCloseHandlerFunc)
- func (h *Handler) SetTextDocumentDidOpenHandler(handler TextDocumentDidOpenHandlerFunc)
- func (h *Handler) SetTextDocumentDidSaveHandler(handler TextDocumentDidSaveHandlerFunc)
- func (h *Handler) SetTextDocumentWillSaveHandler(handler TextDocumentWillSaveHandlerFunc)
- func (h *Handler) SetTextDocumentWillSaveWaitUntilHandler(handler TextDocumentWillSaveWaitUntilHandlerFunc)
- func (h *Handler) SetTraceHandler(handler SetTraceHandlerFunc)
- func (h *Handler) SetTypeHierarchySubtypesHandler(handler TypeHierarchySubtypesHandlerFunc)
- func (h *Handler) SetTypeHierarchySupertypesHandler(handler TypeHierarchySupertypesHandlerFunc)
- func (h *Handler) SetWindowWorkDoneProgressCancelHandler(handler WindowWorkDoneProgressCancelHandler)
- func (h *Handler) SetWorkspaceDiagnosticHandler(handler WorkspaceDiagnosticHandlerFunc)
- func (h *Handler) SetWorkspaceDidChangeConfigurationHandler(handler WorkspaceDidChangeConfigurationHandlerFunc)
- func (h *Handler) SetWorkspaceDidChangeFoldersHandler(handler WorkspaceDidChangeFoldersHandlerFunc)
- func (h *Handler) SetWorkspaceDidChangeWatchedFilesHandler(handler WorkspaceDidChangeWatchedFilesHandlerFunc)
- func (h *Handler) SetWorkspaceDidCreateFilesHandler(handler WorkspaceDidCreateFilesHandlerFunc)
- func (h *Handler) SetWorkspaceDidDeleteFilesHandler(handler WorkspaceDidDeleteFilesHandlerFunc)
- func (h *Handler) SetWorkspaceDidRenameFilesHandler(handler WorkspaceDidRenameFilesHandlerFunc)
- func (h *Handler) SetWorkspaceExecuteCommandHandler(handler WorkspaceExecuteCommandHandlerFunc)
- func (h *Handler) SetWorkspaceSymbolHandler(handler WorkspaceSymbolHandlerFunc)
- func (h *Handler) SetWorkspaceSymbolResolveHandler(handler WorkspaceSymbolResolveHandlerFunc)
- func (h *Handler) SetWorkspaceWillCreateFilesHandler(handler WorkspaceWillCreateFilesHandlerFunc)
- func (h *Handler) SetWorkspaceWillDeleteFilesHandler(handler WorkspaceWillDeleteFilesHandlerFunc)
- func (h *Handler) SetWorkspaceWillRenameFilesHandler(handler WorkspaceWillRenameFilesHandlerFunc)
- type HandlerOption
- func WithCallHierarchyIncomingCallsHandler(handler CallHierarchyIncomingCallsHandlerFunc) HandlerOption
- func WithCallHierarchyOutgoingCallsHandler(handler CallHierarchyOutgoingCallsHandlerFunc) HandlerOption
- func WithCancelRequestHandler(handler CancelRequestHandlerFunc) HandlerOption
- func WithCodeActionHandler(handler CodeActionHandlerFunc) HandlerOption
- func WithCodeActionResolveHandler(handler CodeActionResolveHandlerFunc) HandlerOption
- func WithCodeLensHandler(handler CodeLensHandlerFunc) HandlerOption
- func WithCodeLensResolveHandler(handler CodeLensResolveHandlerFunc) HandlerOption
- func WithCompletionHandler(handler CompletionHandlerFunc) HandlerOption
- func WithCompletionItemResolveHandler(handler CompletionItemResolveHandlerFunc) HandlerOption
- func WithDocumentColorHandler(handler DocumentColorHandlerFunc) HandlerOption
- func WithDocumentColorPresentationHandler(handler DocumentColorPresentationHandlerFunc) HandlerOption
- func WithDocumentDiagnosticsHandler(handler DocumentDiagnosticHandlerFunc) HandlerOption
- func WithDocumentFormattingHandler(handler DocumentFormattingHandlerFunc) HandlerOption
- func WithDocumentHighlightHandler(handler DocumentHighlightHandlerFunc) HandlerOption
- func WithDocumentLinkHandler(handler DocumentLinkHandlerFunc) HandlerOption
- func WithDocumentLinkResolveHandler(handler DocumentLinkResolveHandlerFunc) HandlerOption
- func WithDocumentLinkedEditingRangeHandler(handler DocumentLinkedEditingRangeHandlerFunc) HandlerOption
- func WithDocumentOnTypeFormattingHandler(handler DocumentOnTypeFormattingHandlerFunc) HandlerOption
- func WithDocumentPrepareRenameHandler(handler DocumentPrepareRenameHandlerFunc) HandlerOption
- func WithDocumentRangeFormattingHandler(handler DocumentRangeFormattingHandlerFunc) HandlerOption
- func WithDocumentRenameHandler(handler DocumentRenameHandlerFunc) HandlerOption
- func WithDocumentSymbolHandler(handler DocumentSymbolHandlerFunc) HandlerOption
- func WithExitHandler(handler ExitHandlerFunc) HandlerOption
- func WithFindReferencesHandler(handler FindReferencesHandlerFunc) HandlerOption
- func WithFoldingRangeHandler(handler FoldingRangeHandlerFunc) HandlerOption
- func WithGotoDeclarationHandler(handler GotoDeclarationHandlerFunc) HandlerOption
- func WithGotoDefinitionHandler(handler GotoDefinitionHandlerFunc) HandlerOption
- func WithGotoImplementationHandler(handler GotoImplementationHandlerFunc) HandlerOption
- func WithGotoTypeDefinitionHandler(handler GotoTypeDefinitionHandlerFunc) HandlerOption
- func WithHoverHandler(handler HoverHandlerFunc) HandlerOption
- func WithInitializeHandler(handler InitializeHandlerFunc) HandlerOption
- func WithInitializedHandler(handler InitializedHandlerFunc) HandlerOption
- func WithInlayHintHandler(handler InlayHintHandlerFunc) HandlerOption
- func WithInlayHintResolveHandler(handler InlayHintResolveHandlerFunc) HandlerOption
- func WithInlineValueHandler(handler InlineValueHandlerFunc) HandlerOption
- func WithMonikerHandler(handler MonikerHandlerFunc) HandlerOption
- func WithNotebookDocumentDidChangeHandler(handler NotebookDocumentDidChangeHandlerFunc) HandlerOption
- func WithNotebookDocumentDidCloseHandler(handler NotebookDocumentDidCloseHandlerFunc) HandlerOption
- func WithNotebookDocumentDidOpenHandler(handler NotebookDocumentDidOpenHandlerFunc) HandlerOption
- func WithNotebookDocumentDidSaveHandler(handler NotebookDocumentDidSaveHandlerFunc) HandlerOption
- func WithPrepareCallHierarchyHandler(handler PrepareCallHierarchyHandlerFunc) HandlerOption
- func WithPrepareTypeHierarchyHandler(handler PrepareTypeHierarchyHandlerFunc) HandlerOption
- func WithProgressHandler(handler ProgressHandlerFunc) HandlerOption
- func WithSelectionRangeHandler(handler SelectionRangeHandlerFunc) HandlerOption
- func WithSemanticTokensFullDeltaHandler(handler SemanticTokensFullDeltaHandlerFunc) HandlerOption
- func WithSemanticTokensFullHandler(handler SemanticTokensFullHandlerFunc) HandlerOption
- func WithSemanticTokensRangeHandler(handler SemanticTokensRangeHandlerFunc) HandlerOption
- func WithSetTraceHandler(handler SetTraceHandlerFunc) HandlerOption
- func WithShutdownHandler(handler ShutdownHandlerFunc) HandlerOption
- func WithSignatureHelpHandler(handler SignatureHelpHandlerFunc) HandlerOption
- func WithTextDocumentDidChangeHandler(handler TextDocumentDidChangeHandlerFunc) HandlerOption
- func WithTextDocumentDidCloseHandler(handler TextDocumentDidCloseHandlerFunc) HandlerOption
- func WithTextDocumentDidOpenHandler(handler TextDocumentDidOpenHandlerFunc) HandlerOption
- func WithTextDocumentDidSaveHandler(handler TextDocumentDidSaveHandlerFunc) HandlerOption
- func WithTextDocumentWillSaveHandler(handler TextDocumentWillSaveHandlerFunc) HandlerOption
- func WithTextDocumentWillSaveWaitUntilHandler(handler TextDocumentWillSaveWaitUntilHandlerFunc) HandlerOption
- func WithTypeHierarchySubtypesHandler(handler TypeHierarchySubtypesHandlerFunc) HandlerOption
- func WithTypeHierarchySupertypesHandler(handler TypeHierarchySupertypesHandlerFunc) HandlerOption
- func WithWindowWorkDoneProgressCancelHandler(handler WindowWorkDoneProgressCancelHandler) HandlerOption
- func WithWorkspaceDiagnosticHandler(handler WorkspaceDiagnosticHandlerFunc) HandlerOption
- func WithWorkspaceDidChangeConfigurationHandler(handler WorkspaceDidChangeConfigurationHandlerFunc) HandlerOption
- func WithWorkspaceDidChangeFoldersHandler(handler WorkspaceDidChangeFoldersHandlerFunc) HandlerOption
- func WithWorkspaceDidChangeWatchedFilesHandler(handler WorkspaceDidChangeWatchedFilesHandlerFunc) HandlerOption
- func WithWorkspaceDidCreateFilesHandler(handler WorkspaceDidCreateFilesHandlerFunc) HandlerOption
- func WithWorkspaceDidDeleteFilesHandler(handler WorkspaceDidDeleteFilesHandlerFunc) HandlerOption
- func WithWorkspaceDidRenameFilesHandler(handler WorkspaceDidRenameFilesHandlerFunc) HandlerOption
- func WithWorkspaceExecuteCommandHandler(handler WorkspaceExecuteCommandHandlerFunc) HandlerOption
- func WithWorkspaceSymbolHandler(handler WorkspaceSymbolHandlerFunc) HandlerOption
- func WithWorkspaceSymbolResolveHandler(handler WorkspaceSymbolResolveHandlerFunc) HandlerOption
- func WithWorkspaceWillCreateFilesHandler(handler WorkspaceWillCreateFilesHandlerFunc) HandlerOption
- func WithWorkspaceWillDeleteFilesHandler(handler WorkspaceWillDeleteFilesHandlerFunc) HandlerOption
- func WithWorkspaceWillRenameFilesHandler(handler WorkspaceWillRenameFilesHandlerFunc) HandlerOption
- type Hover
- type HoverClientCapabilities
- type HoverHandlerFunc
- type HoverOptions
- type HoverParams
- type ImplementationClientCapabilities
- type ImplementationOptions
- type ImplementationParams
- type ImplementationRegistrationOptions
- type InitializeClientInfo
- type InitializeError
- type InitializeErrorCode
- type InitializeHandlerFunc
- type InitializeParams
- type InitializeResult
- type InitializeResultServerInfo
- type InitializedHandlerFunc
- type InitializedParams
- type InlayHint
- type InlayHintClientCapabilities
- type InlayHintHandlerFunc
- type InlayHintKind
- type InlayHintLabelPart
- type InlayHintOptions
- type InlayHintParams
- type InlayHintRegistrationOptions
- type InlayHintResolveHandlerFunc
- type InlayHintResolveSupport
- type InlayHintWorkspaceClientCapabilities
- type InlineValue
- type InlineValueClientCapabilities
- type InlineValueContext
- type InlineValueEvaluatableExpression
- type InlineValueHandlerFunc
- type InlineValueOptions
- type InlineValueParams
- type InlineValueRegistrationOptions
- type InlineValueText
- type InlineValueVariableLookup
- type InlineValueWorkspaceClientCapabilities
- type InsertReplaceEdit
- type InsertReplaceRange
- type InsertTextFormat
- type InsertTextMode
- type IntOrString
- type Integer
- type LSPAny
- type LSPObject
- type LinkedEditingRangeClientCapabilities
- type LinkedEditingRangeOptions
- type LinkedEditingRangeParams
- type LinkedEditingRangeRegistrationOptions
- type LinkedEditingRanges
- type Location
- type LocationLink
- type LogMessageParams
- type LogTraceParams
- type MarkdownClientCapabilities
- type MarkedString
- type MarkedStringLanguage
- type MarkupContent
- type MarkupKind
- type MessageActionItem
- type MessageActionItemClientCapabilities
- type MessageType
- type Method
- type Moniker
- type MonikerClientCapabilities
- type MonikerHandlerFunc
- type MonikerKind
- type MonikerOptions
- type MonikerParams
- type MonikerRegistrationOptions
- type NotebookCell
- type NotebookCellArrayChange
- type NotebookCellChanges
- type NotebookCellChangesStructure
- type NotebookCellChangesTextContent
- type NotebookCellExecutionSummary
- type NotebookCellKind
- type NotebookCellLanguage
- type NotebookDocument
- type NotebookDocumentChangeEvent
- type NotebookDocumentClientCapabilities
- type NotebookDocumentDidChangeHandlerFunc
- type NotebookDocumentDidCloseHandlerFunc
- type NotebookDocumentDidOpenHandlerFunc
- type NotebookDocumentDidSaveHandlerFunc
- type NotebookDocumentFilter
- type NotebookDocumentIdentifier
- type NotebookDocumentSyncClientCapabilities
- type NotebookDocumentSyncOptions
- type NotebookDocumentSyncRegistrationOptions
- type NotebookSelectorItem
- type OptionalVersionedTextDocumentIdentifier
- type ParameterInformation
- type ParameterInformationCapabilities
- type PartialResultParams
- type Position
- type PositionEncodingKind
- type PrepareCallHierarchyHandlerFunc
- type PrepareRenameDefaultBehavior
- type PrepareRenameParams
- type PrepareSupportDefaultBehavior
- type PrepareTypeHierarchyHandlerFunc
- type PreviousResultID
- type ProgressHandlerFunc
- type ProgressParams
- type ProgressToken
- type PublishDiagnosticsClientCapabilities
- type PublishDiagnosticsParams
- type Range
- type RangeWithPlaceholder
- type ReferenceClientCapabilities
- type ReferenceContext
- type ReferenceOptions
- type ReferencesParams
- type Registration
- type RegistrationParams
- type RegularExpressionsClientCapabilities
- type RelatedFullDocumentDiagnosticReport
- type RelatedUnchangedDocumentDiagnosticReport
- type RenameClientCapabilities
- type RenameFile
- type RenameFileOptions
- type RenameFilesParams
- type RenameOptions
- type RenameParams
- type ResourceOperationKind
- type SelectionRange
- type SelectionRangeClientCapabilities
- type SelectionRangeHandlerFunc
- type SelectionRangeOptions
- type SelectionRangeParams
- type SelectionRangeRegistrationOptions
- type SemanticDelta
- type SemanticTokenModifier
- type SemanticTokenType
- type SemanticTokens
- type SemanticTokensClientCapabilities
- type SemanticTokensDelta
- type SemanticTokensDeltaParams
- type SemanticTokensEdit
- type SemanticTokensFullDeltaHandlerFunc
- type SemanticTokensFullHandlerFunc
- type SemanticTokensLegend
- type SemanticTokensOptions
- type SemanticTokensParams
- type SemanticTokensRangeHandlerFunc
- type SemanticTokensRangeParams
- type SemanticTokensRegistrationOptions
- type SemanticTokensRequests
- type SemanticTokensWorkspaceClientCapabilities
- type ServerCapabilities
- type ServerWorkspaceCapabilities
- type SetTraceHandlerFunc
- type SetTraceParams
- type ShowDocumentClientCapabilities
- type ShowMessageParams
- type ShowMessageRequestClientCapabilities
- type ShowMessageRequestParams
- type ShutdownHandlerFunc
- type SignatureHelp
- type SignatureHelpClientCapabilities
- type SignatureHelpContext
- type SignatureHelpHandlerFunc
- type SignatureHelpOptions
- type SignatureHelpParams
- type SignatureHelpTriggerKind
- type SignatureInformation
- type SignatureInformationCapabilities
- type StaleRequestSupport
- type StaticRegistrationOptions
- type SymbolInformation
- type SymbolKind
- type SymbolKindCapabilities
- type SymbolTag
- type SymbolTagSupport
- type TelemetryEventParams
- type TextDocumentClientCapabilities
- type TextDocumentContentChangeEvent
- type TextDocumentContentChangeEventWhole
- type TextDocumentDidChangeHandlerFunc
- type TextDocumentDidCloseHandlerFunc
- type TextDocumentDidOpenHandlerFunc
- type TextDocumentDidSaveHandlerFunc
- type TextDocumentEdit
- type TextDocumentIdentifier
- type TextDocumentItem
- type TextDocumentPositionParams
- type TextDocumentRegistrationOptions
- type TextDocumentSaveReason
- type TextDocumentSyncClientCapabilities
- type TextDocumentSyncKind
- type TextDocumentSyncOptions
- type TextDocumentWillSaveHandlerFunc
- type TextDocumentWillSaveWaitUntilHandlerFunc
- type TextEdit
- type TokenFormat
- type TraceServerLogger
- type TraceService
- type TraceValue
- type TypeDefinitionClientCapabilities
- type TypeDefinitionOptions
- type TypeDefinitionParams
- type TypeDefinitionRegistrationOptions
- type TypeHierarchyClientCapabilities
- type TypeHierarchyItem
- type TypeHierarchyOptions
- type TypeHierarchyPrepareParams
- type TypeHierarchyRegistrationOptions
- type TypeHierarchySubtypesHandlerFunc
- type TypeHierarchySubtypesParams
- type TypeHierarchySupertypesHandlerFunc
- type TypeHierarchySupertypesParams
- type UInteger
- type URI
- type UnchangedDocumentDiagnosticReport
- type UniquenessLevel
- type Unregistration
- type UnregistrationParams
- type VersionedNotebookDocumentIdentifier
- type VersionedTextDocumentIdentifier
- type WillSaveTextDocumentParams
- type WindowClientCapabilities
- type WindowWorkDoneProgressCancelHandler
- type WorkDoneProgressBegin
- type WorkDoneProgressCancelParams
- type WorkDoneProgressCreateParams
- type WorkDoneProgressEnd
- type WorkDoneProgressOptions
- type WorkDoneProgressParams
- type WorkDoneProgressReport
- type WorkspaceDiagnosticHandlerFunc
- type WorkspaceDiagnosticParams
- type WorkspaceDiagnosticReport
- type WorkspaceDidChangeConfigurationHandlerFunc
- type WorkspaceDidChangeFoldersHandlerFunc
- type WorkspaceDidChangeWatchedFilesHandlerFunc
- type WorkspaceDidCreateFilesHandlerFunc
- type WorkspaceDidDeleteFilesHandlerFunc
- type WorkspaceDidRenameFilesHandlerFunc
- type WorkspaceEdit
- type WorkspaceEditClientCapabilities
- type WorkspaceExecuteCommandHandlerFunc
- type WorkspaceFileOperationServerCapabilities
- type WorkspaceFolder
- type WorkspaceFoldersChangeEvent
- type WorkspaceFoldersServerCapabilities
- type WorkspaceFullDocumentDiagnosticReport
- type WorkspaceSymbol
- type WorkspaceSymbolClientCapabilities
- type WorkspaceSymbolHandlerFunc
- type WorkspaceSymbolOptions
- type WorkspaceSymbolParams
- type WorkspaceSymbolResolveHandlerFunc
- type WorkspaceSymbolResolveSupport
- type WorkspaceUnchangedDocumentDiagnosticReport
- type WorkspaceWillCreateFilesHandlerFunc
- type WorkspaceWillDeleteFilesHandlerFunc
- type WorkspaceWillRenameFilesHandlerFunc
Examples ¶
Constants ¶
const ( TraceValueOff = TraceValue("off") TraceValueMessage = TraceValue("messages") TraceValueVerbose = TraceValue("verbose") )
const ( SemanticTokenTypeNamespace = SemanticTokenType("namespace") // Represents a generic type. Acts as a fallback for types which // can't be mapped to a specific type like class or enum. SemanticTokenTypeType = SemanticTokenType("type") SemanticTokenTypeClass = SemanticTokenType("class") SemanticTokenTypeEnum = SemanticTokenType("enum") SemanticTokenTypeInterface = SemanticTokenType("interface") SemanticTokenTypeStruct = SemanticTokenType("struct") SemanticTokenTypeTypeParameter = SemanticTokenType("typeParameter") SemanticTokenTypeParameter = SemanticTokenType("parameter") SemanticTokenTypeVariable = SemanticTokenType("variable") SemanticTokenTypeProperty = SemanticTokenType("property") SemanticTokenTypeEnumMember = SemanticTokenType("enumMember") SemanticTokenTypeEvent = SemanticTokenType("event") SemanticTokenTypeFunction = SemanticTokenType("function") SemanticTokenTypeMethod = SemanticTokenType("method") SemanticTokenTypeMacro = SemanticTokenType("macro") SemanticTokenTypeKeyword = SemanticTokenType("keyword") SemanticTokenTypeModifier = SemanticTokenType("modifier") SemanticTokenTypeComment = SemanticTokenType("comment") SemanticTokenTypeString = SemanticTokenType("string") SemanticTokenTypeNumber = SemanticTokenType("number") SemanticTokenTypeRegexp = SemanticTokenType("regexp") SemanticTokenTypeOperator = SemanticTokenType("operator") )
const ( SemanticTokenModifierDeclaration = SemanticTokenModifier("declaration") SemanticTokenModifierDefinition = SemanticTokenModifier("definition") SemanticTokenModifierReadonly = SemanticTokenModifier("readonly") SemanticTokenModifierStatic = SemanticTokenModifier("static") SemanticTokenModifierDeprecated = SemanticTokenModifier("deprecated") SemanticTokenModifierAbstract = SemanticTokenModifier("abstract") SemanticTokenModifierAsync = SemanticTokenModifier("async") SemanticTokenModifierModification = SemanticTokenModifier("modification") SemanticTokenModifierDocumentation = SemanticTokenModifier("documentation") SemanticTokenModifierDefaultLibrary = SemanticTokenModifier("defaultLibrary") )
const ( // Size of a tab in spaces. FormattingOptionTabSize = "tabSize" // Prefer spaces over tabs. FormattingOptionInsertSpaces = "insertSpaces" // Trim trailing whitespace on a line. // // @since 3.15.0 FormattingOptionTrimTrailingWhitespace = "trimTrailingWhitespace" // Insert a newline character at the end of the file if one does not exist. // // @since 3.15.0 FormattingOptionInsertFinalNewline = "insertFinalNewline" // Trim all newlines after the final newline at the end of the file. // // @since 3.15.0 FormattingOptionTrimFinalNewlines = "trimFinalNewlines" )
Value-object describing what options formatting should use.
const ClientRegisterCapability = Method("client/registerCapability")
ClientRegisterCapability is the method that can be used by a server to register a new capability with the client.
const ClientUnregisterCapability = Method("client/unregisterCapability")
ClientUnregisterCapability is the method that can be used by a server to de-register a capability with the client.
const ( // If the protocol version provided by the client can't be handled by the // server. // // @deprecated This initialize error got replaced by client capabilities. // There is no version handshake in version 3.0x InitializeErrorCodeUnknownProtocolVersion = InitializeErrorCode(1) )
const MethodCallHierarchyIncomingCalls = Method("callHierarchy/incomingCalls")
const MethodCallHierarchyOutgoingCalls = Method("callHierarchy/outgoingCalls")
const MethodCancelRequest = Method("$/cancelRequest")
const MethodCodeAction = Method("textDocument/codeAction")
const MethodCodeActionResolve = Method("codeAction/resolve")
const MethodCodeLens = Method("textDocument/codeLens")
const MethodCodeLensRefresh = Method("workspace/codeLens/refresh")
const MethodCodeLensResolve = Method("codeLens/resolve")
const MethodCompletion = Method("textDocument/completion")
const MethodCompletionItemResolve = Method("completionItem/resolve")
const MethodDiagnosticsRefresh = Method("workspace/diagnostic/refresh")
const MethodDocumentColor = Method("textDocument/documentColor")
const MethodDocumentColorPresentation = Method("textDocument/colorPresentation")
const MethodDocumentDiagnostic = Method("textDocument/diagnostic")
MethodDiagnostic is the method for the textDocument/diagnostic request made from the client to "pull" diagnostics for a specific document from the server.
const MethodDocumentFormatting = Method("textDocument/formatting")
const MethodDocumentHighlight = Method("textDocument/documentHighlight")
const MethodDocumentLink = Method("textDocument/documentLink")
const MethodDocumentLinkResolve = Method("documentLink/resolve")
const MethodDocumentLinkedEditingRange = Method("textDocument/linkedEditingRange")
const MethodDocumentOnTypeFormatting = Method("textDocument/onTypeFormatting")
const MethodDocumentPrepareRename = Method("textDocument/prepareRename")
const MethodDocumentRangeFormatting = Method("textDocument/rangeFormatting")
const MethodDocumentRename = Method("textDocument/rename")
const MethodDocumentSymbol = Method("textDocument/documentSymbol")
const MethodExit = Method("exit")
MethodExit is the method name for the exit notification as defined in the language server protocol.
const MethodFindReferences = Method("textDocument/references")
const MethodFoldingRange = Method("textDocument/foldingRange")
const MethodGotoDeclaration = Method("textDocument/declaration")
const MethodGotoDefinition = Method("textDocument/definition")
const MethodGotoImplementation = Method("textDocument/implementation")
const MethodGotoTypeDefinition = Method("textDocument/typeDefinition")
const MethodHover = Method("textDocument/hover")
const MethodInitialize = Method("initialize")
MethodInitialize is the method name for the initialize request as defined in the language server protocol.
const MethodInitialized = Method("initialized")
MethodInitialized is the method name for the initialized notification as defined in the language server protocol.
const MethodInlayHint = Method("textDocument/inlayHint")
const MethodInlayHintRefresh = Method("workspace/inlayHint/refresh")
const MethodInlayHintResolve = Method("inlayHint/resolve")
const MethodInlineValue = Method("textDocument/inlineValue")
const MethodInlineValueRefresh = Method("workspace/inlineValue/refresh")
const MethodLogMessage = Method("window/logMessage")
const MethodLogTrace = Method("$/logTrace")
MethodLogTrace is the method name for the logTrace notification as defined in the language server protocol.
const MethodMoniker = Method("textDocument/moniker")
const MethodNotebookDocumentDidChange = Method("notebookDocument/didChange")
const MethodNotebookDocumentDidClose = Method("notebookDocument/didClose")
const MethodNotebookDocumentDidOpen = Method("notebookDocument/didOpen")
const MethodNotebookDocumentDidSave = Method("notebookDocument/didSave")
const MethodPrepareCallHierarchy = Method("textDocument/prepareCallHierarchy")
const MethodPrepareTypeHierarchy = Method("textDocument/prepareTypeHierarchy")
const MethodProgress = Method("$/progress")
const MethodPublishDiagnostics = Method("textDocument/publishDiagnostics")
const MethodSelectionRange = Method("textDocument/selectionRange")
const MethodSemanticTokensFull = Method("textDocument/semanticTokens/full")
const MethodSemanticTokensFullDelta = Method("textDocument/semanticTokens/full/delta")
const MethodSemanticTokensRange = Method("textDocument/semanticTokens/range")
const MethodSemanticTokensRefresh = Method("workspace/semanticTokens/refresh")
const MethodSetTrace = Method("$/setTrace")
MethodSetTrace is the method name for the setTrace notification as defined in the language server protocol.
const MethodShowMessageNotification = Method("window/showMessage")
const MethodShowMessageRequest = Method("window/showMessageRequest")
const MethodShutdown = Method("shutdown")
MethodShutdown is the method name for the shutdown request as defined in the language server protocol.
const MethodSignatureHelp = Method("textDocument/signatureHelp")
const MethodTelemetryEvent = Method("telemetry/event")
const MethodTextDocumentDidChange = Method("textDocument/didChange")
const MethodTextDocumentDidClose = Method("textDocument/didClose")
const MethodTextDocumentDidOpen = Method("textDocument/didOpen")
const MethodTextDocumentDidSave = Method("textDocument/didSave")
const MethodTextDocumentWillSave = Method("textDocument/willSave")
const MethodTextDocumentWillSaveWaitUntil = Method("textDocument/willSaveWaitUntil")
const MethodTypeHierarchySubtypes = Method("typeHierarchy/subtypes")
const MethodTypeHierarchySupertypes = Method("typeHierarchy/supertypes")
const MethodWorkDoneProgressCancel = Method("window/workDoneProgress/cancel")
const MethodWorkDoneProgressCreate = Method("window/workDoneProgress/create")
const MethodWorkspaceApplyEdit = Method("workspace/applyEdit")
const MethodWorkspaceConfiguration = Method("workspace/configuration")
const MethodWorkspaceDiagnostic = Method("workspace/diagnostic")
const MethodWorkspaceDidChangeConfiguration = Method("workspace/didChangeConfiguration")
const MethodWorkspaceDidChangeFolders = Method("workspace/didChangeWorkspaceFolders")
const MethodWorkspaceDidChangeWatchedFiles = Method("workspace/didChangeWatchedFiles")
const MethodWorkspaceDidCreateFiles = Method("workspace/didCreateFiles")
const MethodWorkspaceDidDeleteFiles = Method("workspace/didDeleteFiles")
const MethodWorkspaceDidRenameFiles = Method("workspace/didRenameFiles")
const MethodWorkspaceExecuteCommand = Method("workspace/executeCommand")
const MethodWorkspaceFolders = Method("workspace/workspaceFolders")
const MethodWorkspaceSymbol = Method("workspace/symbol")
const MethodWorkspaceSymbolResolve = Method("workspaceSymbol/resolve")
const MethodWorkspaceWillCreateFiles = Method("workspace/willCreateFiles")
const MethodWorkspaceWillDeleteFiles = Method("workspace/willDeleteFiles")
const MethodWorkspaceWillRenameFiles = Method("workspace/willRenameFiles")
Variables ¶
var ( ErrInvalidDocumentDiagnosticReportKind = errors.New("invalid document diagnostic report kind") ErrInvalidCodeActionOrCommand = errors.New("invalid code action or command") )
var EOL = []string{"\n", "\r\n", "\r"}
var (
True = true
)
Functions ¶
This section is empty.
Types ¶
type AnnotatedTextEdit ¶
type AnnotatedTextEdit struct {
TextEdit
// The actual annotation identifier.
AnnotationID ChangeAnnotationIdentifier `json:"annotationId"`
}
A special text edit with additional change annotation.
@since 3.16.0
type ApplyWorkspaceEditParams ¶
type ApplyWorkspaceEditParams struct {
// An optional label of the workspace edit. This label is
// presented in the user interface for example on an undo
// stack to undo the workspace edit.
Label *string `json:"label,omitempty"`
// The edits to apply.
Edit WorkspaceEdit `json:"edit"`
}
ApplyWorkspaceEditParams contains the parameters for the `workspace/applyEdit` request.
type ApplyWorkspaceEditResult ¶
type ApplyWorkspaceEditResult struct {
// Indicates whether the edit was applied or not.
Applied bool `json:"applied"`
// An optional textual description for why the edit was not applied.
// This may be used by the server for diagnostic logging or to provide
// a suitable error for a request that triggered the edit.
FailureReason *string `json:"failureReason,omitempty"`
// Depending on the client's failure handling strategy `failedChange`
// might contain the index of the change that failed. This property is
// only available if the client signals a `failureHandling` strategy
// in its client capabilities.
FailedChange *UInteger `json:"failedChange,omitempty"`
}
ApplyWorkspaceEditResult is the result of the `workspace/applyEdit` request.
type BoolOrString ¶
BoolOrString represents a value that can be either a boolean or a string in LSP messages. boolean | string (used in WorkspaceFoldersServerCapabilities for example)
func (*BoolOrString) MarshalJSON ¶
func (b *BoolOrString) MarshalJSON() ([]byte, error)
Fulfils the json.Marshaler interface.
func (*BoolOrString) String ¶
func (b *BoolOrString) String() string
Fulfils the fmt.Stringer interface.
func (*BoolOrString) UnmarshalJSON ¶
func (b *BoolOrString) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface
type CallHierarchyClientCapabilities ¶
type CallHierarchyClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `(TextDocumentRegistrationOptions &
// StaticRegistrationOptions)` return value for the corresponding server
// capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
CallHierarchyClientCapabilities describes the capabilities of a client for call hierarchy requests.
type CallHierarchyIncomingCall ¶
type CallHierarchyIncomingCall struct {
// The item that makes the call.
From CallHierarchyItem `json:"from"`
// The range at which at which the calls appears. This is relative to the caller
// denoted by [`this.from`](#CallHierarchyIncomingCall.from).
FromRanges []Range `json:"fromRanges"`
}
CallHierarchyIncomingCall represents an incoming call within the call hierarchy.
type CallHierarchyIncomingCallsHandlerFunc ¶
type CallHierarchyIncomingCallsHandlerFunc func( ctx *common.LSPContext, params *CallHierarchyIncomingCallsParams, ) ([]CallHierarchyIncomingCall, error)
CallHierarchyIncomingCallsHandlerFunc is the function signature for the callHierarchy/incomingCalls request handler that can be registered for a language server.
type CallHierarchyIncomingCallsParams ¶
type CallHierarchyIncomingCallsParams struct {
WorkDoneProgressParams
PartialResultParams
Item CallHierarchyItem `json:"item"`
}
CallHierarchyIncomingCallsParams contains the callHierarchy/incomingCalls request parameters.
type CallHierarchyItem ¶
type CallHierarchyItem struct {
// The name of this item.
Name string `json:"name"`
// The kind of this item.
Kind SymbolKind `json:"kind"`
// Tags for this item.
Tags []SymbolTag `json:"tags,omitempty"`
// More detail for this item, e.g. the signature of a function.
Detail *string `json:"detail,omitempty"`
// The resource identifier of this item.
URI DocumentURI `json:"uri"`
// The range enclosing this symbol not including leading/trailing whitespace
// but everything else, e.g. comments and code.
Range Range `json:"range"`
// The range that should be selected and revealed when this symbol is being
// picked, e.g. the name of a function. Must be contained by the
// [`range`](#CallHierarchyItem.range).
SelectionRange Range `json:"selectionRange"`
// A data entry field that is preserved between a call hierarchy prepare and
// incoming calls or outgoing calls requests.
Data any `json:"data,omitempty"`
}
CallHierarchyItem represents an item within the call hierarchy.
type CallHierarchyOptions ¶
type CallHierarchyOptions struct {
WorkDoneProgressOptions
}
CallHierarchyOptions provides server capability options for call hierarchy requests.
type CallHierarchyOutgoingCall ¶
type CallHierarchyOutgoingCall struct {
// The item that is called.
To CallHierarchyItem `json:"to"`
// The range at which this item is called. This is the range relative to
// the caller, e.g the item passed to `callHierarchy/outgoingCalls` request.
FromRanges []Range `json:"fromRanges"`
}
CallHierarchyOutgoingCall represents an outgoing call within the call hierarchy.
type CallHierarchyOutgoingCallsHandlerFunc ¶
type CallHierarchyOutgoingCallsHandlerFunc func( ctx *common.LSPContext, params *CallHierarchyOutgoingCallsParams, ) ([]CallHierarchyOutgoingCall, error)
CallHierarchyOutgoingCallsHandlerFunc is the function signature for the callHierarchy/outgoingCalls request handler that can be registered for a language server.
type CallHierarchyOutgoingCallsParams ¶
type CallHierarchyOutgoingCallsParams struct {
WorkDoneProgressParams
PartialResultParams
Item CallHierarchyItem `json:"item"`
}
CallHierarchyOutgoingCallsParams contains the callHierarchy/outgoingCalls request parameters.
type CallHierarchyPrepareParams ¶
type CallHierarchyPrepareParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
CallHierarchyPrepareParams contains the textDocument/prepareCallHierarchy request parameters.
type CallHierarchyRegistrationOptions ¶
type CallHierarchyRegistrationOptions struct {
CallHierarchyOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
CallHierarchyRegistrationOptions provides server capability registration options for call hierarchy requests.
type CancelParams ¶
type CancelParams struct {
// ID of the request to cancel.
ID *IntOrString `json:"id"`
}
CancelParams contains the cancel request parameters.
type CancelRequestHandlerFunc ¶
type CancelRequestHandlerFunc func(ctx *common.LSPContext, params *CancelParams) error
CancelRequestHandlerFunc is the function signature for the cancelRequest request that can be registered for a language server.
type ChangeAnnotation ¶
type ChangeAnnotation struct {
// A human-readable string describing the change.
// This is rendered prominently in the user interface.
Label string `json:"label"`
// A flag which indicates that user confirmation is needed
// before applying the change.
NeedsConfirmation *bool `json:"needsConfirmation,omitempty"`
// A human-readable string which is rendered less prominent
// in the user interface.
Description *string `json:"description,omitempty"`
}
ChangeAnnotation provides additinoa information that describes document changes.
@since 3.16.0
type ChangeAnnotationIdentifier ¶
type ChangeAnnotationIdentifier = string
ChangeAnnotationIdentifier is a string that identifies a change annotation managed by a workspace edit.
@since 3.16.0
type ChangeAnnotationSupport ¶
type ChangeAnnotationSupport struct {
// Whether the client groups edits with equal labels into tree nodes,
// for instance all edits labelled with "Changes in Strings" would be
// a tree node.
GroupsOnLabel *bool `json:"groupsOnLabel,omitempty"`
}
type ClientCapabilities ¶
type ClientCapabilities struct {
// Workspace specific client capabilities.
Workspace *ClientWorkspaceCapabilities `json:"workspace,omitempty"`
// Text document specific client capabilities.
TextDocument *TextDocumentClientCapabilities `json:"textDocument,omitempty"`
// Capabilities specific to the notebook document support.
//
// @since 3.17.0
NotebookDocument *NotebookDocumentClientCapabilities `json:"notebook,omitempty"`
// Window specific client capabilities.
Window *WindowClientCapabilities `json:"window,omitempty"`
// General client capabilities.
//
// @since 3.16.0
General *GeneralClientCapabilities `json:"general,omitempty"`
// Experimenal client capabilities.
Experimental LSPAny `json:"experimental,omitempty"`
}
ClientCapabilities represents the capabilities of the client (editor or tool).
type ClientWorkspaceCapabilities ¶
type ClientWorkspaceCapabilities struct {
// the cliet supports applying batch edits to the workspace
// by supporting the request `workspace/applyEdit`.
ApplyEdit *bool `json:"applyEdit,omitempty"`
// Capabilities specific to `WorkspaceEdit`s
WorkspaceEdit *WorkspaceEditClientCapabilities `json:"workspaceEdit,omitempty"`
// Capabilities specific to the `workspace/didChangeConfiguration` notification.
DidChangeConfiguration *DidChangeConfigurationClientCapabilities `json:"didChangeConfiguration,omitempty"`
// Capabilities specific to the `workspace/didChangeWatchedFiles` notification.
DidChangeWatchedFiles *DidChangeWatchedFilesClientCapabilities `json:"didChangeWatchedFiles,omitempty"`
// Capabilities specific to the `workspace/symbol` request.
Symbol *WorkspaceSymbolClientCapabilities `json:"symbol,omitempty"`
// Capabilities specific to the `workspace/executeCommand` request.
ExecuteCommand *ExecuteCommandClientCapabilities `json:"executeCommand,omitempty"`
// The client has support for workspace folders.
//
// @since 3.6.0
WorkspaceFolders *bool `json:"workspaceFolders,omitempty"`
// The client supports `workspace/configuration` requests.
//
// @since 3.6.0
Configuration *bool `json:"configuration,omitempty"`
// Capabilities specific to the semantic token requiests scoped to the
// workspace.
//
// @since 3.16.0
SemanticTokens *SemanticTokensWorkspaceClientCapabilities `json:"semanticTokens,omitempty"`
// Capabilities specific to the code lens requests scoped to the workspace.
//
// @since 3.16.0
CodeLens *CodeLensWorkspaceClientCapabilities `json:"codeLens,omitempty"`
// The client has support for file requests/notifications.
//
// @since 3.16.0
FileOperations *FileOperationClientCapabilities `json:"fileOperations,omitempty"`
// Client workspace capabilities specific to inline values.
//
// @since 3.17.0
InlineValue *InlineValueWorkspaceClientCapabilities `json:"inlineValue,omitempty"`
// Client workspace capabilities specific to inlay hints.
//
// @since 3.17.0
InlayHint *InlayHintWorkspaceClientCapabilities `json:"inlayHint,omitempty"`
// Client workspace capabilities specific to diagnostics.
//
// @since 3.17.0
Diagnostics *DiagnosticWorkspaceClientCapabilities `json:"diagnostics,omitempty"`
}
ClientWorkspaceCapabilities represents the capabilities of the client related to workspaces.
type CodeAction ¶
type CodeAction struct {
// A short, human-readable, title for this code action.
Title string `json:"title"`
// The kind of the code action.
//
// Used to filter code actions.
Kind *CodeActionKind `json:"kind,omitempty"`
// The diagnostics that this code action resolves.
Diagnostics []Diagnostic `json:"diagnostics,omitempty"`
// Marks this as a preferred action. Preferred actions are used by the
// `auto fix` command and can be targeted by keybindings.
//
// A quick fix should be marked preferred if it properly addresses the
// underlying error. A refactoring should be marked preferred if it is the
// most reasonable choice of actions to take.
//
// @since 3.15.0
IsPreferred *bool `json:"isPreferred,omitempty"`
// Marks that the code action cannot currently be applied.
//
// Clients should follow the following guidelines regarding disabled code
// actions:
//
// - Disabled code actions are not shown in automatic lightbulbs code
// action menus.
//
// - Disabled actions are shown as faded out in the code action menu when
// the user request a more specific type of code action, such as
// refactorings.
//
// - If the user has a keybinding that auto applies a code action and only
// a disabled code actions are returned, the client should show the user
// an error message with `reason` in the editor.
//
// @since 3.16.0
Disabled *CodeActionDisabledReason `json:"disabled,omitempty"`
// The workspace edit this code action performs.
Edit *WorkspaceEdit `json:"edit,omitempty"`
// A command this code action executes. If a code action
// provides an edit and a command, first the edit is
// executed and then the command.
Command *Command `json:"command,omitempty"`
// A data entry field that is preserved on a code action between
// a `textDocument/codeAction` and a `codeAction/resolve` request.
//
// @since 3.16.0
Data LSPAny `json:"data,omitempty"`
}
CodeAction represents a change that can be performed in code, e.g. to fix a problem or to refactor code.
A CodeAction must set either `edit` and/or a `command`. If both are supplied, the `edit` is applied first, then the `command` is executed.
type CodeActionClientCapabilities ¶
type CodeActionClientCapabilities struct {
// Whether code action supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports code action literals as a valid
// response of the `textDocument/codeAction` request.
//
// @since 3.8.0
CodeActionLiteralSupport *CodeActionLiteralSupport `json:"codeActionLiteralSupport,omitempty"`
// Whether code action supports the `isPreferred` property.
//
// @since 3.15.0
IsPreferredSupport *bool `json:"isPreferredSupport,omitempty"`
// Whether code action supports the `disabled` property.
//
// @since 3.16.0
DisabledSupport *bool `json:"disabledSupport,omitempty"`
// Whether code action supports the `data` property which is
// preserved between a `textDocument/codeAction` and a
// `codeAction/resolve` request.
//
// @since 3.16.0
DataSupport *bool `json:"dataSupport,omitempty"`
// Whether the client supports resolving additional code action
// properties via a separate `codeAction/resolve` request.
//
// @since 3.16.0
ResolveSupport *CodeActionResolveSupport `json:"resolveSupport,omitempty"`
// Whether the client honors the change annotations in
// text edits and resource operations returned via the
// `CodeAction#edit` property by for example presenting
// the workspace edit in the user interface and asking
// for confirmation.
//
// @since 3.16.0
HonorsChangeAnnotations *bool `json:"honorsChangeAnnotations,omitempty"`
}
CodeActionClientCapabilities describes the capabilities of a client for code action requests.
type CodeActionContext ¶
type CodeActionContext struct {
// An array of diagnostics known on the client side overlapping the range
// provided to the `textDocument/codeAction` request. They are provided so
// that the server knows which errors are currently presented to the user
// for the given range. There is no guarantee that these accurately reflect
// the error state of the resource. The primary parameter
// to compute code actions is the provided range.
Diagnostics []Diagnostic `json:"diagnostics"`
// Requested kind of actions to return.
//
// Actions not of this kind are filtered out by the client before being
// shown. So servers can omit computing them.
Only []CodeActionKind `json:"only,omitempty"`
// The reason why code actions were requested.
//
// @since 3.17.0
TriggerKind *CodeActionTriggerKind `json:"triggerKind,omitempty"`
}
CodeActionContext Contains additional diagnostic information about the context in which a code action is run.
type CodeActionDisabledReason ¶
type CodeActionDisabledReason struct {
// Human readable description of why the code action is disabled.
//
// This is displayed in the code actions user interface.
Reason string `json:"reason"`
}
CodeActionDisabledReason is the reason why a code action is disabled.
type CodeActionHandlerFunc ¶
type CodeActionHandlerFunc func( ctx *common.LSPContext, params *CodeActionParams, ) ([]*CodeActionOrCommand, error)
CodeActionHandlerFunc is the function signature for the textDocument/codeAction request handler that can be registered for a language server.
type CodeActionKind ¶
type CodeActionKind = string
The kind of a code action.
Kinds are a hierarchical list of identifiers separated by `.`, e.g. `"refactor.extract.function"`.
The set of kinds is open and client needs to announce the kinds it supports to the server during initialization.
const ( // CodeActionKindEmpty for the empty kind. CodeActionKindEmpty CodeActionKind = "" // CodeActionKindQuickFix is the base kind // for quickfix actions: 'quickfix'. CodeActionKindQuickFix CodeActionKind = "quickfix" // CodeActionKindRefactor is the base kind // for refactoring actions: 'refactor'. CodeActionKindRefactor CodeActionKind = "refactor" // CodeActionKindRefactorExtract is the kind for // refactoring extraction actions: 'refactor.extract'. // // Example extract actions: // // - Extract method // - Extract function // - Extract variable // - Extract interface from class // - ... CodeActionKindRefactorExtract CodeActionKind = "refactor.extract" // CodeActionKindRefactorInline is the base kind for // refactoring inline actions: 'refactor.inline'. // // Example inline actions: // // - Inline function // - Inline variable // - Inline constant // - ... CodeActionKindRefactorInline CodeActionKind = "refactor.inline" // CodeActionKindRefactorRewrite is the base kind for // refactoring rewrite actions: 'refactor.rewrite'. // // Example rewrite actions: // // - Convert JavaScript function to class // - Add or remove parameter // - Encapsulate field // - Make method static // - Move method to base class // - ... CodeActionKindRefactorRewrite CodeActionKind = "refactor.rewrite" // CodeActionKindSource is the base kind for // source actions: `source`. // // Source code actions apply to the entire file. CodeActionKindSource CodeActionKind = "source" // CodeActionKindSourceOrganizeImports is the base kind for // an organize imports source action: `source.organizeImports`. CodeActionKindSourceOrganizeImports CodeActionKind = "source.organizeImports" // CodeActionKindSourceFixAll is the base kind for // a 'fix all' source action: `source.fixAll`. // // 'Fix all' actions automatically fix errors that hae a clear fix that // do not require user input. They should not suppress errors or perform // unsafe fixes such as generating new types or classes. // // @since 3.17.0 CodeActionKindSourceFixAll CodeActionKind = "source.fixAll" )
type CodeActionKindCapabilities ¶
type CodeActionKindCapabilities struct {
// The code action kind values the client supports. When this
// property exists the client also guarantees that it will
// handle values outside its set gracefully and falls back
// to a default value when unknown.
ValueSet []CodeActionKind `json:"valueSet,omitempty"`
}
CodeActionKindCapabilities describes the capabilities of a client for code action kinds.
type CodeActionLiteralSupport ¶
type CodeActionLiteralSupport struct {
// The code action kind is supported with the following value
// set.
CodeActionKind *CodeActionKindCapabilities `json:"codeActionKind,omitempty"`
}
CodeActionLiteralSupport describes the capabilities of a client for code action literals.
type CodeActionOptions ¶
type CodeActionOptions struct {
WorkDoneProgressOptions
// CodeActionKinds that this server may return.
//
// The list of kinds may be generic, such as `CodeActionKind.Refactor`,
// or the server may list out every specific kind they provide.
CodeActionKinds []CodeActionKind `json:"codeActionKinds,omitempty"`
// The server provides support to resolve additional
// information for a code action.
//
// @since 3.16.0
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
CodeActionOptions provides server capability options for code action requests.
type CodeActionOrCommand ¶
type CodeActionOrCommand struct {
CodeAction *CodeAction `json:"codeAction,omitempty"`
Command *Command `json:"command,omitempty"`
}
CodeActionOrCommand represents a union type of a code action or command.
func (*CodeActionOrCommand) MarshalJSON ¶
func (c *CodeActionOrCommand) MarshalJSON() ([]byte, error)
Fulfils the json.Marshaler interface.
func (*CodeActionOrCommand) UnmarshalJSON ¶
func (c *CodeActionOrCommand) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarsrhaler interface.
type CodeActionParams ¶
type CodeActionParams struct {
// The document in which the command was invoked.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The range for which the command was invoked.
Range Range `json:"range"`
// Context carrying additional information.
Context CodeActionContext `json:"context"`
}
CodeActionParams contains the parameters for the textDocument/codeAction request.
type CodeActionResolveHandlerFunc ¶
type CodeActionResolveHandlerFunc func( ctx *common.LSPContext, params *CodeAction, ) (*CodeAction, error)
CodeActionResolveHandlerFunc is the function signature for the codeAction/resolve request handler that can be registered for a language server.
type CodeActionResolveSupport ¶
type CodeActionResolveSupport struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
}
CodeActionResolveSupport describes the capabilities of a client for resolving code actions lazily.
type CodeActionTriggerKind ¶
type CodeActionTriggerKind = Integer
CodeActionTriggerKind is the reason why code actions were requested.
@since 3.17.0
var ( // CodeActionTriggerKindInvoked is for code actions were explicitly // requested by the user or by an extension. CodeActionTriggerKindInvoked CodeActionTriggerKind = 1 // CodeActionTriggerKindAutomatic is for code actions were // requested automatically. // // This typically happens when current selection in a file changes, but can // also be triggered when file content changes. CodeActionTriggerKindAutomatic CodeActionTriggerKind = 2 )
type CodeDescription ¶
type CodeDescription struct {
// A URI to open with more information about the diagnostic error.
Href URI `json:"href"`
}
Structure to capture a description for an error code. @since 3.16.0
type CodeLens ¶
type CodeLens struct {
// The range in which this code lens is valid. Should only span a single line.
Range Range `json:"range"`
// The command this code lens represents.
Command *Command `json:"command,omitempty"`
// A data entry field that is preserved on a code lens item between
// a code lens and a code lens resolve request.
Data LSPAny `json:"data,omitempty"`
}
CodeLens represents a command that should be shown along with source text, like the number of references, a way to run tests, etc.
A code lens is _unresolved_ when no command is associated to it. For performance reasons the creation of a code lens and resolving should be done in two stages.
type CodeLensClientCapabilities ¶
type CodeLensClientCapabilities struct {
// Whether code lens supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
CodeLensClientCapabilities describes the capabilities of a client for code lens requests.
type CodeLensHandlerFunc ¶
type CodeLensHandlerFunc func( ctx *common.LSPContext, params *CodeLensParams, ) ([]CodeLens, error)
CodeLensHandlerFunc is the function signature for the textDocument/codeLens request handler that can be registered for a language server.
type CodeLensOptions ¶
type CodeLensOptions struct {
WorkDoneProgressOptions
// Code lens has a resolve provider as well.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
CodeLensOptions provides server capability options for code lens requests.
type CodeLensParams ¶
type CodeLensParams struct {
WorkDoneProgressParams
PartialResultParams
// The document to request code lens for.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
CodeLensParams contains the textDocument/codeLens request parameters.
type CodeLensResolveHandlerFunc ¶
type CodeLensResolveHandlerFunc func( ctx *common.LSPContext, params *CodeLens, ) (*CodeLens, error)
CodeLensResolveHandlerFunc is the function signature for the codeLens/resolve request handler that can be registered for a language server.
type CodeLensWorkspaceClientCapabilities ¶
type CodeLensWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from the
// server to the client.
//
// Note that this event is global and will force the client to refresh all
// code lenses currently shown. It should be used with absolute care and is
// useful for situation where a server for example detect a project wide
// change that requires such a calculation.
RefreshSupport *bool `json:"refreshSupport,omitempty"`
}
CodeLensWorkspaceClientCapabilities describes the capabilities of a client for code lenses in workspaces.
type Color ¶
type Color struct {
// The red component of this color in the range [0-1]
Red Decimal `json:"red"`
// The green component of this color in the range [0-1].
Green Decimal `json:"green"`
// The blue component of this color in the range [0-1].
Blue Decimal `json:"blue"`
// The alpha component of this color in the range [0-1].
Alpha Decimal `json:"alpha"`
}
Color represents a color in RGBA space.
type ColorInformation ¶
type ColorInformation struct {
// The range in the document where this color appears.
Range Range `json:"range"`
// The actual color value for this color range.
Color Color `json:"color"`
}
ColorInformation contains the response data type of each item in the array for a textDocument/documentColor request.
type ColorPresentation ¶
type ColorPresentation struct {
// The label of this color presentation. It will be shown on the color
// picker header. By default this is also the text that is inserted when
// selecting this color presentation.
Label string `json:"label"`
// An [edit](#TextEdit) which is applied to a document when selecting
// this presentation for the color. When omitted the
// [label](#ColorPresentation.label) is used.
TextEdit *TextEdit `json:"textEdit,omitempty"`
// An optional array of additional [text edits](#TextEdit) that are applied
// when selecting this color presentation. Edits must not overlap with the
// main [edit](#ColorPresentation.textEdit) nor with themselves.
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
}
ColorPresentation contains the response data type of each item in the array for a textDocument/colorPresentation request.
type ColorPresentationParams ¶
type ColorPresentationParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The color information to request presentations for.
Color Color `json:"color"`
// The range where the color would be inserted. Serves as a context.
Range Range `json:"range"`
}
ColorPresentationParams contains parameters for the textDocument/colorPresentation request.
type Command ¶
type Command struct {
// Title of the command, like `save`.
Title string `json:"title"`
// The identifier of the actual command handler.
Command string `json:"command"`
// Arguments that the command handler should be
// invoked with.
Arguments []LSPAny `json:"arguments,omitempty"`
}
Command represents a reference to a command. Provides a title which will be used to represente a command in the UI. Commands are identified by a string identifier. The recommended way to handle commands is to implement their execution on the server side if the client and server provides the corresponding capabilities. Alternatively, the toll extension code could handle the command. The protocol currently doesn't specify a set of well-known commands.
type CompletionClientCapabilities ¶
type CompletionClientCapabilities struct {
// Whether completion supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports the following `CompletionItem` specific capabilities.
CompletionItem *CompletionItemCapabilities `json:"completionItem,omitempty"`
// The completion item kind values the client support
CompletionItemKind *CompletionItemKindCapabilities `json:"completionItemKind,omitempty"`
// The client supports to send additional context information for a
// `textDocument/completion` request.
ContextSupport *bool `json:"contextSupport,omitempty"`
// The client's default when the completion item doesn't provide a
// `insertTextMode` property.
//
// @since 3.17.0
InsertTextMode *CompletionItemInsertTextMode `json:"insertTextMode,omitempty"`
// The client supports the following `CompletionList` specific
// capabilities.
//
// @since 3.17.0
CompletionList *CompletionListCapabilities `json:"completionList,omitempty"`
}
CompletionClientCapabilities describes the capabilities of a client for completion requests.
type CompletionContext ¶
type CompletionContext struct {
// How the completion was triggered.
TriggerKind CompletionTriggerKind `json:"triggerKind"`
// The trigger character (a single character) that has trigger code
// complete. Is undefined if
// `triggerKind !== CompletionTriggerKind.TriggerCharacter`
TriggerCharacter *string `json:"triggerCharacter,omitempty"`
}
CompletionContext contains additional information abou the context in which a completion request is triggered.
type CompletionHandlerFunc ¶
type CompletionHandlerFunc func( ctx *common.LSPContext, params *CompletionParams, ) (any, error)
CompletionHandlerFunc is the function signature for the textDocument/completion request handler that can be registered for a language server.
Returns: *CompletionList | []*CompletionItem | nil
type CompletionItem ¶
type CompletionItem struct {
// The label of this completion item.
//
// The label property is also by default the text that
// is inserted when selecting this completion.
//
// If label details are provided the label itself should
// be an unqualified name of the completion item.
Label string `json:"label"`
// Additional details for the label.
//
// @since 3.17.0
LabelDetails *CompletionItemLabelDetails `json:"labelDetails,omitempty"`
// The kind of this completion item. Based of the kind
// an icon is chosen by the editor. The standardized set
// of available values is defined in `CompletionItemKind`.
Kind *CompletionItemKind `json:"kind,omitempty"`
// Tags for this completion item.
//
// @since 3.15.0
Tags []CompletionItemTag `json:"tags,omitempty"`
// A human-readable string with additional information
// about this item, like type or symbol information.
Detail *string `json:"detail,omitempty"`
// A human-readable string that represents a doc-comment.
//
// string | MarkupContent | nil
Documentation any `json:"documentation,omitempty"`
// Indicates if this item is deprecated.
//
// @deprecated Use `tags` instead if supported.
Deprecated *bool `json:"deprecated,omitempty"`
// Select this item when showing.
//
// *Note* that only one completion item can be selected and that the
// tool / client decides which item that is. The rule is that the *first*
// item of those that match best is selected.
Preselect *bool `json:"preselect,omitempty"`
// A string that should be used when comparing this item
// with other items. When omitted the label is used
// as the sort text for this item.
SortText *string `json:"sortText,omitempty"`
// A string that should be used when filtering a set of
// completion items. When omitted the label is used as the
// filter text for this item.
FilterText *string `json:"filterText,omitempty"`
// A string that should be inserted into a document when selecting
// this completion. When omitted the label is used as the insert text
// for this item.
//
// The `insertText` is subject to interpretation by the client side.
// Some tools might not take the string literally. For example
// VS Code when code complete is requested in this example
// `con<cursor position>` and a completion item with an `insertText` of
// `console` is provided it will only insert `sole`. Therefore it is
// recommended to use `textEdit` instead since it avoids additional client
// side interpretation.
InsertText *string `json:"insertText,omitempty"`
// The format of the insert text. The format applies to both the
// `insertText` property and the `newText` property of a provided
// `textEdit`. If omitted defaults to `InsertTextFormat.PlainText`.
//
// Please note that the insertTextFormat doesn't apply to
// `additionalTextEdits`.
InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitempty"`
// How whitespace and indentation is handled during completion
// item insertion. If not provided the client's default value depends on
// the `textDocument.completion.insertTextMode` client capability.
//
// @since 3.16.0
// @since 3.17.0 - support for `textDocument.completion.insertTextMode`
InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
// An edit which is applied to a document when selecting this completion.
// When an edit is provided the value of `insertText` is ignored.
//
// *Note:* The range of the edit must be a single line range and it must
// contain the position at which completion has been requested.
//
// Most editors support two different operations when accepting a completion
// item. One is to insert a completion text and the other is to replace an
// existing text with a completion text. Since this can usually not be
// predetermined by a server it can report both ranges. Clients need to
// signal support for `InsertReplaceEdit`s via the
// `textDocument.completion.completionItem.insertReplaceSupport` client
// capability property.
//
// *Note 1:* The text edit's range as well as both ranges from an insert
// replace edit must be a [single line] and they must contain the position
// at which completion has been requested.
// *Note 2:* If an `InsertReplaceEdit` is returned the edit's insert range
// must be a prefix of the edit's replace range, that means it must be
// contained and starting at the same position.
//
// @since 3.16.0 additional type `InsertReplaceEdit`
//
// TextEdit | InsertReplaceEdit | nil
TextEdit any `json:"textEdit,omitempty"`
// The edit text used if the completion item is part of a CompletionList and
// CompletionList defines an item default for the text edit range.
//
// Clients will only honor this property if they opt into completion list
// item defaults using the capability `completionList.itemDefaults`.
//
// If not provided and a list's default range is provided the label
// property is used as a text.
//
// @since 3.17.0
TextEditText *string `json:"textEditText,omitempty"`
// An optional array of additional text edits that are applied when
// selecting this completion. Edits must not overlap (including the same
// insert position) with the main edit nor with themselves.
//
// Additional text edits should be used to change text unrelated to the
// current cursor position (for example adding an import statement at the
// top of the file if the completion item will insert an unqualified type).
AdditionalTextEdits []TextEdit `json:"additionalTextEdits,omitempty"`
// An optional set of characters that when pressed while this completion is
// active will accept it first and then type that character. Note that all
// commit characters should have `length=1` and that superfluous characters
// will be ignored.
CommitCharacters []string `json:"commitCharacters,omitempty"`
// An optional command that is executed *after* inserting this completion.
// *Note* that additional modifications to the current document should be
// described with the additionalTextEdits-property.
Command *Command `json:"command,omitempty"`
// A data entry field that is preserved on a completion item between
// a completion and a completion resolve request.
Data LSPAny `json:"data,omitempty"`
}
CompletionItem represents a completion item that is presented in a completion list in a client editor.
func (*CompletionItem) UnmarshalJSON ¶
func (i *CompletionItem) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarhaller interface.
type CompletionItemCapabilities ¶
type CompletionItemCapabilities struct {
// Client supports snippets as insert text.
//
// A snippet can define tab stops and placeholders with `$1`, `$2`
// and `${3:foo}`. `$0` defines the final tab stop, it defaults to
// the end of the snippet. Placeholders with equal identifiers are
// linked, that is typing in one will update others too.
SnippetSupport *bool `json:"snippetSupport,omitempty"`
// Client supports commit characters on a completion item.
CommitCharactersSupport *bool `json:"commitCharactersSupport,omitempty"`
// Client supports the follow content formats for the documentation
// property. The order describes the preferred format of the client.
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
// Client supports the deprecated property on a completion item.
DeprecatedSupport *bool `json:"deprecatedSupport,omitempty"`
// Client supports the preselect property on a completion item.
PreselectSupport *bool `json:"preselectSupport,omitempty"`
// Client supports the tag property on a completion item. Clients
// supporting tags have to handle unknown tags gracefully. Clients
// especially need to preserve unknown tags when sending a completion
// item back to the server in a resolve call.
//
// @since 3.15.0
TagSupport *CompletionItemTagSupport `json:"tagSupport,omitempty"`
// Client supports insert replace edit to control different behavior if
// a completion item is inserted in the text or should replace text.
//
// @since 3.16.0
InsertReplaceSupport *bool `json:"insertReplaceSupport,omitempty"`
// Indicates which properties a client can resolve lazily on a
// completion item. Before version 3.16.0 only the predefined properties
// `documentation` and `detail` could be resolved lazily.
//
// @since 3.16.0
ResolveSupport *CompletionItemResolveSupport `json:"resolveSupport,omitempty"`
// The client supports the `insertTextMode` property on
// a completion item to override the whitespace handling
// mode as defined by the client (see `insertTextMode`).
//
// @since 3.16.0
InsertTextModeSupport *CompletionItemInsertTextModeSupport `json:"insertTextModeSupport,omitempty"`
// The client has support for completion item label
// details (see also `CompletionItemLabelDetails`).
//
// @since 3.17.0
LabelDetailsSupport *bool `json:"labelDetailsSupport,omitempty"`
}
CompletionItemCapabilities describes the capabilities of a client for completion items.
type CompletionItemDefaults ¶
type CompletionItemDefaults struct {
// A default commit character set.
//
// @since 3.17.0
CommitCharacters []string `json:"commitCharacters,omitempty"`
// A default edit range.
//
// @since 3.17.0
//
// Range | InsertReplaceRange | nil
EditRange any `json:"editRange,omitempty"`
// A default insert text format.
//
// @since 3.17.0
InsertTextFormat *InsertTextFormat `json:"insertTextFormat,omitempty"`
// A default insert text mode.
//
// @since 3.17.0
InsertTextMode *InsertTextMode `json:"insertTextMode,omitempty"`
// A default data value.
//
// @since 3.17.0
Data LSPAny `json:"data,omitempty"`
}
CompletionItemDefaults provides default values for each kind of completion item.
func (*CompletionItemDefaults) UnmarshalJSON ¶
func (d *CompletionItemDefaults) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type CompletionItemInsertTextMode ¶
type CompletionItemInsertTextMode = Integer
CompletionItemInsertTextMode determines how whitespace and indentation is handled during completion item insertion.
@since 3.16.0
const ( // CompletionItemInsertTextModeAsIs means that the // insertion or string replacement is taken as it is. // If the value is multi line, the lines below the cursor // will be inserted using the indentation defined in the string value. // The client will not apply any kind of adjustments to the string. CompletionItemInsertTextModeAsIs CompletionItemInsertTextMode = 1 // CompletionItemInsertTextModeAdjustIndentation means that // the editor adjusts leading whitespace of new lines so that tehy match // the indentation up to the cursor of the line for which the item is accepted. // // Consider a line lik this: <2tabs><cursor><3tabs>foo. Accepting a // multi line completion item is indentned using 2 tabs and all // following lines inserted will be indented using 2 tabs as well. CompletionItemInsertTextModeAdjustIndentation CompletionItemInsertTextMode = 2 )
type CompletionItemInsertTextModeSupport ¶
type CompletionItemInsertTextModeSupport struct {
ValueSet []CompletionItemInsertTextMode `json:"valueSet"`
}
CompletionItemCapabilities describes the capabilities of a client for completion items with respect to insert text mode.
type CompletionItemKind ¶
type CompletionItemKind = Integer
CompletionItemKind represents a kind of completion item.
const ( // CompletionItemKindText is a plain text completion item. CompletionItemKindText CompletionItemKind = 1 // CompletionItemKindMethod is a method completion item. CompletionItemKindMethod CompletionItemKind = 2 // CompletionItemKindFunction is a function completion item. CompletionItemKindFunction CompletionItemKind = 3 // CompletionItemKindConstructor is a constructor completion item. CompletionItemKindConstructor CompletionItemKind = 4 // CompletionItemKindField is a field completion item. CompletionItemKindField CompletionItemKind = 5 // CompletionItemKindVariable is a variable completion item. CompletionItemKindVariable CompletionItemKind = 6 // CompletionItemKindClass is a class completion item. CompletionItemKindClass CompletionItemKind = 7 // CompletionItemKindInterface is an interface completion item. CompletionItemKindInterface CompletionItemKind = 8 // CompletionItemKindModule is a module completion item. CompletionItemKindModule CompletionItemKind = 9 // CompletionItemKindProperty is a property completion item. CompletionItemKindProperty CompletionItemKind = 10 // CompletionItemKindUnit is a unit completion item. CompletionItemKindUnit CompletionItemKind = 11 // CompletionItemKindValue is a value completion item. CompletionItemKindValue CompletionItemKind = 12 // CompletionItemKindEnum is an enum completion item. CompletionItemKindEnum CompletionItemKind = 13 // CompletionItemKindKeyword is a keyword completion item. CompletionItemKindKeyword CompletionItemKind = 14 // CompletionItemKindSnippet is a snippet completion item. CompletionItemKindSnippet CompletionItemKind = 15 // CompletionItemKindColor is a color completion item. CompletionItemKindColor CompletionItemKind = 16 // CompletionItemKindFile is a file completion item. CompletionItemKindFile CompletionItemKind = 17 // CompletionItemKindReference is a reference completion item. CompletionItemKindReference CompletionItemKind = 18 // CompletionItemKindFolder is a folder completion item. CompletionItemKindFolder CompletionItemKind = 19 // CompletionItemKindEnumMember is an enum member completion item. CompletionItemKindEnumMember CompletionItemKind = 20 // CompletionItemKindConstant is a constant completion item. CompletionItemKindConstant CompletionItemKind = 21 // CompletionItemKindStruct is a struct completion item. CompletionItemKindStruct CompletionItemKind = 22 // CompletionItemKindEvent is an event completion item. CompletionItemKindEvent CompletionItemKind = 23 // CompletionItemKindOperator is an operator completion item. CompletionItemKindOperator CompletionItemKind = 24 // CompletionItemKindTypeParameter is a type parameter completion item. CompletionItemKindTypeParameter CompletionItemKind = 25 )
type CompletionItemKindCapabilities ¶
type CompletionItemKindCapabilities struct {
// The completion item kind values the client supports. When this
// property exists the client also guarantees that it will
// handle values outside its set gracefully and falls back
// to a default value when unknown.
//
// If this property is not present the client only supports
// the completion items kinds from `Text` to `Reference` as defined in
// the initial version of the protocol.
ValueSet []CompletionItemKind `json:"valueSet,omitempty"`
}
CompletionItemKindCapabilities describes the capabilities of a client for completion item kinds.
type CompletionItemLabelDetails ¶
type CompletionItemLabelDetails struct {
// An optional string which is rendered less prominently directly after
// {@link CompletionItem.label label}, without any spacing. Should be
// used for function signatures or type annotations.
Detail *string `json:"detail,omitempty"`
// An optional string which is rendered less prominently after
// {@link CompletionItemLabelDetails.detail}. Should be used for fully qualified
// names or file path.
Description *string `json:"description,omitempty"`
}
CompletionItemLabelDetails provides additional details for a completion item label.
@since 3.17.0
type CompletionItemResolveHandlerFunc ¶
type CompletionItemResolveHandlerFunc func( ctx *common.LSPContext, params *CompletionItem, ) (*CompletionItem, error)
CompletionItemResolveHandlerFunc is the function signature for the completionItem/resolve request handler that can be registered for a language server.
type CompletionItemResolveSupport ¶
type CompletionItemResolveSupport struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
}
CompletionItemResolveSupport describes the capabilities of a client for resolving completion items lazily.
type CompletionItemTag ¶
type CompletionItemTag = Integer
CompletionItemTags are extra annotations that tweak the rendering of a completion item.
@since 3.15.0
const ( // CompletionItemTagDeprecated renders a completion // as obsolete, usually using a strike-out. CompletionItemTagDeprecated CompletionItemTag = 1 )
type CompletionItemTagSupport ¶
type CompletionItemTagSupport struct {
// The tags supported by the client.
ValueSet []CompletionItemTag `json:"valueSet"`
}
CompletionItemTagSupport describes the capabilities of a client for completion item tags.
type CompletionList ¶
type CompletionList struct {
// This list is not complete. Further typing should result in recomputing
// this list.
//
// Recomputed lists have all their items replaced (not appended) in the
// incomplete completion sessions.
IsIncomplete bool `json:"isIncomplete"`
// In many cases the items of an actual completion result share the same
// value for properties like `commitCharacters` or the range of a text
// edit. A completion list can therefore define item defaults which will
// be used if a completion item itself doesn't specify the value.
//
// If a completion list specifies a default value and a completion item
// also specifies a corresponding value the one from the item is used.
//
// Servers are only allowed to return default values if the client
// signals support for this via the `completionList.itemDefaults`
// capability.
//
// @since 3.17.0
ItemDefaults *CompletionItemDefaults `json:"itemDefaults,omitempty"`
// The completion items.
Items []*CompletionItem `json:"items"`
}
CompletionList represents a collection of [completion items](#CompletionItem) to be presented in the editor.
type CompletionListCapabilities ¶
type CompletionListCapabilities struct {
// The client supports the following itemDefaults on
// a completion list.
//
// The value lists the supported property names of the
// `CompletionList.itemDefaults` object. If omitted
// no properties are supported.
//
// @since 3.17.0
ItemDefaults []string `json:"itemDefaults,omitempty"`
}
CompletionListCapabilities describes the capabilities of a client for completion lists.
type CompletionOptions ¶
type CompletionOptions struct {
WorkDoneProgressOptions
// The additional characters, beyond the defaults provided by the client (typically
// [a-zA-Z]), that should automatically trigger a completion request. For example
// `.` in JavaScript represents the beginning of an object property or method and is
// thus a good candidate for triggering a completion request.
//
// Most tools trigger a completion request automatically without explicitly
// requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they
// do so when the user starts to type an identifier. For example if the user
// types `c` in a JavaScript file code complete will automatically pop up
// present `console` besides others as a completion item. Characters that
// make up identifiers don't need to be listed here.
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
// The list of all possible characters that commit a completion. This field
// can be used if clients don't support individual commit characters per
// completion item. See client capability
// `completion.completionItem.commitCharactersSupport`.
//
// If a server provides both `allCommitCharacters` and commit characters on
// an individual completion item the ones on the completion item win.
//
// @since 3.2.0
AllCommitCharacters []string `json:"allCommitCharacters,omitempty"`
// The server provides support to resolve additional
// information for a completion item.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
// The server supports the following `CompletionItem` specific
// capabilities.
//
// @since 3.17.0
CompletionItem *CompletionOptionsItem `json:"completionItem,omitempty"`
}
CompletionOptions provides server capability options for completion requests.
type CompletionOptionsItem ¶
type CompletionOptionsItem struct {
// The server has support for completion item label
// details (see also `CompletionItemLabelDetails`) when receiving
// a completion item in a resolve call.
//
// @since 3.17.0
LabelDetailsSupport *bool `json:"labelDetailsSupport,omitempty"`
}
CompletionItemOptions provides server capability options for completion items.
type CompletionParams ¶
type CompletionParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
// The completion context. This is only available if the client specifies
// to send this using the client capability
// `completion.contextSupport === true`
Context *CompletionContext `json:"context,omitempty"`
}
CompletionParams contains the textDocument/completion request parameters.
type CompletionTriggerKind ¶
type CompletionTriggerKind = Integer
CompletionTriggerKind defines how a completion request was triggered.
const ( // CompletionTriggerKindInvoked means the completion was triggered // by the user typing an identifier (24x7 code complete), // manual invocation (e.g. Ctrl+Space) or via API. CompletionTriggerKindInvoked CompletionTriggerKind = 1 // CompletionTriggerKindTriggerCharacter means the completion was // triggered by a trigger character specified by the `triggerCharacters` // properties of the `CompletionRegistrationOptions`. CompletionTriggerKindTriggerCharacter CompletionTriggerKind = 2 // CompletionTriggerKindTriggerForIncompleteCompletions means the // completion was re-triggered as the current completion list is // incomplete. CompletionTriggerKindTriggerForIncompleteCompletions CompletionTriggerKind = 3 )
type ConfigurationItem ¶
type ConfigurationItem struct {
// The scope to get the configuration section for.
ScopeURI *URI `json:"scopeUri,omitempty"`
// The configuration section asked for.
Section *string `json:"section,omitempty"`
}
ConfigurationItem is a workspace configuration item to be fetched.
type ConfigurationParams ¶
type ConfigurationParams struct {
Items []ConfigurationItem `json:"items"`
}
ConfigurationParams contains the parameters for the `workspace/configuration` request made from the server to the client.
type CreateFile ¶
type CreateFile struct {
// A create operatoin
Kind string `json:"kind"` // == "create"
// The resource to create.
URI DocumentURI `json:"uri"`
// Additional options
Options *CreateFileOptions `json:"options,omitempty"`
// An optional annotation identifier describing the operation.
//
// @since 3.16.0
AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}
CreateFile defines an operation to create a file.
type CreateFileOptions ¶
type CreateFileOptions struct {
// Overwrite existing file. Overwrite wins over `ignoreIfExists`
Overwrite *bool `json:"overwrite,omitempty"`
// Ignore if exists.
IgnoreIfExists *bool `json:"ignoreIfExists,omitempty"`
}
CreateFileOptions provides options to create a file.
type CreateFilesParams ¶
type CreateFilesParams struct {
// An array of all files/folders created in this operation.
Files []FileCreate `json:"files"`
}
CreateFilesParams contains the parameters sent in notifications/requests for user-initiated creation of files.
@since 3.16.0
type Decimal ¶
type Decimal = float64
Decimal defins a decimal number. Since decimal numbers are very rare in the language server specification we denote the exact range with every decimal using the mathematics interval notation (e.g. [0, 1] denotes all decimals d with 0 <= d <= 1.
type DeclarationClientCapabilities ¶
type DeclarationClientCapabilities struct {
// Whether declaration supports dynamic registration. If this is set to
// `true` the client supports the new `DeclarationRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of declaration links.
LinkSupport *bool `json:"linkSupport,omitempty"`
}
DeclarationClientCapabilities describes the capabilities of a client for goto declaration requests.
type DeclarationOptions ¶
type DeclarationOptions struct {
WorkDoneProgressOptions
}
DeclarationOptions provides server capability options for goto declaration requests.
type DeclarationParams ¶
type DeclarationParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
DeclarationParams contains the textDocument/declaration request parameters.
type DeclarationRegistrationOptions ¶
type DeclarationRegistrationOptions struct {
DeclarationOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
DeclarationRegistrationOptions provides server capability registration options for goto declaration requests.
type DefinitionClientCapabilities ¶
type DefinitionClientCapabilities struct {
// Whether definition supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
LinkSupport *bool `json:"linkSupport,omitempty"`
}
DefinitionClientCapabilities describes the capabilities of a client for goto definition requests.
type DefinitionOptions ¶
type DefinitionOptions struct {
WorkDoneProgressOptions
}
DefinitionOptions provides server capability options for goto definition requests.
type DefinitionParams ¶
type DefinitionParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
DefinitionParams contains the textDocument/definition request parameters.
type DeleteFile ¶
type DeleteFile struct {
// A delete operation.
Kind string `json:"kind"` // == "delete"
// The file to delete.
URI DocumentURI `json:"uri"`
// Delete options.
Options *DeleteFileOptions `json:"options,omitempty"`
// An optional annotation identifier describing the operation.
//
// @since 3.16.0
AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}
DeleteFile defines an operation to delete a file.
type DeleteFileOptions ¶
type DeleteFileOptions struct {
// Delete the content recursively if a folder is denoted.
Recursive *bool `json:"recursive,omitempty"`
// Ignore the operation if the file doesn't exist.
IgnoreIfNotExists *bool `json:"ignoreIfNotExists,omitempty"`
}
DeleteFileOptions provides options to delete a file.
type DeleteFilesParams ¶
type DeleteFilesParams struct {
// An array of all files/folders deleted in this operation.
Files []FileDelete `json:"files"`
}
DeleteFilesParams contains the parameters sent in notifications/requests for user-initiated deletion of files.
@since 3.16.0
type Diagnostic ¶
type Diagnostic struct {
// The range at which the message applies.
Range Range `json:"range"`
// The diagnostic's severity. Can be omitted. If omitted it is up to the
// client to interpret diagnostics as error, warning, info or hint.
Severity *DiagnosticSeverity `json:"severity,omitempty"`
// The diagnostic's code, which might appear in the user interface.
Code *IntOrString `json:"code,omitempty"`
// An optional property to describe the error code.
// @since 3.16.0
CodeDescription *CodeDescription `json:"codeDescription,omitempty"`
// A human-readable string describing the source of this
// diagnostic, e.g. 'typescript' or 'super lint'.
Source *string `json:"source,omitempty"`
// The diagnostic's message.
Message string `json:"message"`
// Additional metadata about the diagnostic.
//
// @since 3.15.0
Tags []DiagnosticTag `json:"tags,omitempty"`
// An array of related diagnostic information, e.g. when symbol-names within
// a scope collide all definitions can be marked via this property.
RelatedInformation []DiagnosticRelatedInformation `json:"relatedInformation,omitempty"`
// A data entry field that is preserved between a `textDocument/publishDiagnostics`
// notification and `textDocument/codeAction` request.
//
// @since 3.16.0
Data any `json:"data,omitempty"`
}
A Diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
type DiagnosticClientCapabilities ¶
type DiagnosticClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new
// `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Whether the clients support related documents for document diagnostic
// pulls.
RelatedDocumentSupport *bool `json:"relatedDocumentSupport,omitempty"`
}
DiagnosticClientCapabilities represents the client capabilities specific to diagnostic pull requests.
@since 3.17.0
type DiagnosticOptions ¶
type DiagnosticOptions struct {
WorkDoneProgressOptions
// An optional identifier under which the diagnostics are
// managed by the client.
Identifier *string `json:"identifier,omitempty"`
// Whether the language has inter file dependencies meaning that
// editing code in one file can result in a different diagnostic
// set in another file. Inter file dependencies are common for
// most programming languages and typically uncommon for linters.
InterFileDependencies bool `json:"interFileDependencies"`
// The server provides support for workspace diagnostics as well.
WorkspaceDiagnostics bool `json:"workspaceDiagnostics"`
}
DiagnosticOptions provides server capability options for pull diagnostics behaviour.
@since 3.17.0
type DiagnosticRegistrationOptions ¶
type DiagnosticRegistrationOptions struct {
DiagnosticOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
DiagnosticRegistrationOptions provides server capability registration options for pull diagnostics behaviour.
@since 3.17.0
type DiagnosticRelatedInformation ¶
type DiagnosticRelatedInformation struct {
// The location of this related diagnostic information.
Location Location `json:"location"`
// The message of this related diagnostic information.
Message string `json:"message"`
}
DiagnosticRelatedInformation represents a related message and source code location for a diagnostic. This should be used to point to code locations that cause or related to a diagnostics, e.g when duplicating a symbol in a scope.
type DiagnosticSeverity ¶
type DiagnosticSeverity = UInteger
const ( // Reports an error. DiagnosticSeverityError DiagnosticSeverity = 1 // Reports a warning. DiagnosticSeverityWarning DiagnosticSeverity = 2 // Reports an information. DiagnosticSeverityInformation DiagnosticSeverity = 3 // Reports a hint. DiagnosticSeverityHint DiagnosticSeverity = 4 )
type DiagnosticTag ¶
type DiagnosticTag = UInteger
const ( // Unused or unnecessary code. // Clients are allowed to render diagnostics with this tag faded out instead of having // an error squiggle. DiagnosticTagUnnecessary DiagnosticTag = 1 // Deprecated or obsolete code. // Clients are allowed to rendered diagnostics with this tag strike through. DiagnosticTagDeprecated DiagnosticTag = 2 )
type DiagnosticTagSupport ¶
type DiagnosticTagSupport struct {
// The tags supported by the client.
ValueSet []DiagnosticTag `json:"valueSet"`
}
DiagnosticTagSupport represents the client capabilities specific to diagnostic tags.
type DiagnosticWorkspaceClientCapabilities ¶
type DiagnosticWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from
// the server to the client.
//
// Note that this event is global and will force the client to refresh all
// pulled diagnostics currently shown. It should be used with absolute care
// and is useful for situation where a server for example detects a project
// wide change that requires such a calculation.
RefreshSupport *bool `json:"refreshSupport,omitempty"`
}
DiagnosticWorkspaceClientCapabilities describes the capabilities of a client specific to diagnostic pull requests.
@since 3.17.0
type DidChangeConfigurationClientCapabilities ¶
type DidChangeConfigurationClientCapabilities struct {
// Did change configuration notification supports dynamic registration.
//
// @since 3.6.0 to support the new pull model.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DidChangeConfigurationClientCapabilities describes the capabilities of a client for the `workspace/didChangeConfiguration` request.
type DidChangeConfigurationParams ¶
type DidChangeConfigurationParams struct {
// The actual changed settings.
Settings LSPAny `json:"settings"`
}
DidChangeConfigurationParams contains the parameters for the `workspace/didChangeConfiguration` notification.
type DidChangeNotebookDocumentParams ¶
type DidChangeNotebookDocumentParams struct {
// The notebook document that changed.
// The version number points to the version after
// all provided changes have been applied.
NotebookDocument VersionedNotebookDocumentIdentifier `json:"notebookDocument"`
// The actual changes to the notebook document.
//
// The change describes single state change to the notebook document.
// So it moves a notebook document, its cells and its cell text document
// contents from state S to S'.
//
// To mirror the content of a notebook using change events use the
// following approach:
// - start with the same initial content
// - apply the 'notebookDocument/didChange' notifications in the order
// you receive them.
Change NotebookDocumentChangeEvent `json:"change"`
}
DidChangeNotebookDocumentParams contains the parameters sent in a change notebook document notification.
@since 3.17.0
type DidChangeTextDocumentParams ¶
type DidChangeTextDocumentParams struct {
// The document that did change. The version number points
// to the version after all provided content changes have
// been applied.
TextDocument VersionedTextDocumentIdentifier `json:"textDocument"`
// The actual content changes. The content changes describe single state
// changes to the document. So if there are two content changes c1 (at
// array index 0) and c2 (at array index 1) for a document in state S then
// c1 moves the document from S to S' and c2 from S' to S”. So c1 is
// computed on the state S and c2 is computed on the state S'.
//
// To mirror the content of a document using change events use the following
// approach:
// - start with the same initial content
// - apply the 'textDocument/didChange' notifications in the order you
// receive them.
// - apply the `TextDocumentContentChangeEvent`s in a single notification
// in the order you receive them.
//
// TextDocumentContentChangeEvent | TextDocumentContentChangeEventWhole
ContentChanges []any `json:"contentChanges"`
}
DidChangeTextDocumentParams contains the parameters of the textDocument/didChange notification.
func (*DidChangeTextDocumentParams) UnmarshalJSON ¶
func (p *DidChangeTextDocumentParams) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type DidChangeWatchedFilesClientCapabilities ¶
type DidChangeWatchedFilesClientCapabilities struct {
// Did change watched files notification supports dynamic registration.
// Please note that the current protocol doesn't support static
// configuration for file changes from the server side.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Whether the client has support for relative patterns
// or not.
//
// @since 3.17.0
RelativePatternSupport *bool `json:"relativePatternSupport,omitempty"`
}
DidChangeWatchedFilesClientCapabilities describes the capabilities of a client for the `workspace/didChangeWatchedFiles` request.
type DidChangeWatchedFilesParams ¶
type DidChangeWatchedFilesParams struct {
// The actual file events.
Changes []FileEvent `json:"changes"`
}
DidChangeWatchedFilesParams contains the parameters for the `workspace/didChangeWatchedFiles` notification.
type DidChangeWorkspaceFoldersParams ¶
type DidChangeWorkspaceFoldersParams struct {
// The actual workspace folder change event.
Event WorkspaceFoldersChangeEvent `json:"event"`
}
DidChangeWorkspaceFoldersParams contains the parameters for the `workspace/didChangeWorkspaceFolders` notification.
type DidCloseNotebookDocumentParams ¶
type DidCloseNotebookDocumentParams struct {
// The notebook document that was closed.
NotebookDocument NotebookDocumentIdentifier `json:"notebookDocument"`
// The text documents that represent the content
// of a notebook cell that was closed.
CellTextDocuments []TextDocumentIdentifier `json:"cellTextDocuments"`
}
DidCloseNotebookDocumentParams contains the parameters sent in a close notebook document notification.
@since 3.17.0
type DidCloseTextDocumentParams ¶
type DidCloseTextDocumentParams struct {
// The document that was closed.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DidCloseTextDocumentParams are the parameters of a did close text document notification.
type DidOpenNotebookDocumentParams ¶
type DidOpenNotebookDocumentParams struct {
// The document that was opened.
Notebook NotebookDocument `json:"notebook"`
// The text documents that represent the content
// of a notebook cell.
CellTextDocuments []TextDocumentItem `json:"cellTextDocuments"`
}
DidOpenNotebookDocumentParams contains the notebookDocument/didOpen notification parameters.
@since 3.17.0
type DidOpenTextDocumentParams ¶
type DidOpenTextDocumentParams struct {
// The document that was opened.
TextDocument TextDocumentItem `json:"textDocument"`
}
DidOpenTextDocumentParams contains the parameters of the textDocument/didOpen notification.
type DidSaveNotebookDocumentParams ¶
type DidSaveNotebookDocumentParams struct {
// The notebook document that was saved.
NotebookDocument NotebookDocumentIdentifier `json:"notebookDocument"`
}
DidSaveNotebookDocumentParams contains the parameters sent in a save notebook document notification.
@since 3.17.0
type DidSaveTextDocumentParams ¶
type DidSaveTextDocumentParams struct {
// The document that was saved.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// Optional, contains the content when saved.
// Whether this is present or not depends on the includeText value
// when the save notification was requested.
Text *string `json:"text,omitempty"`
}
DidSaveTextDocumentParams are the parameters of a did save text document notification.
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher provides a convenient way to dispatch requests and notification to the client with types for known requests and notifications that a server can send to a client in LSP 3.17.0.
func NewDispatcher ¶
func NewDispatcher(ctx *common.LSPContext) *Dispatcher
NewDispatcher creates a new instance of a dispatcher. A dispatcher is wrapped around a current LSP context and should live as long as the underlying LSP context.
func (*Dispatcher) ApplyWorkspaceEdit ¶
func (d *Dispatcher) ApplyWorkspaceEdit(params ApplyWorkspaceEditParams) (*ApplyWorkspaceEditResult, error)
ApplyWorkspaceEdit requests that the client applies a workspace edit.
func (*Dispatcher) CancelRequest ¶
func (d *Dispatcher) CancelRequest(params CancelParams) error
CancelRequest cancels a request with the client.
func (*Dispatcher) CodeLensRefresh ¶
func (d *Dispatcher) CodeLensRefresh() error
CodeLensRefresh requests the client to refresh all code lenses.
func (*Dispatcher) Context ¶
func (d *Dispatcher) Context() *common.LSPContext
Context returns the underlying LSP context.
func (*Dispatcher) CreateWorkDoneProgress ¶
func (d *Dispatcher) CreateWorkDoneProgress(params WorkDoneProgressCreateParams) error
CreateWorkDoneProgress sends a request to the client to create a new work done progress.
func (*Dispatcher) DiagnosticsRefresh ¶
func (d *Dispatcher) DiagnosticsRefresh() error
DiagnosticsRefresh requests that the client refreshes all needed document and workspace diagnostics. This is useful if the server detects a project wide configuration change which requires a re-calculation of all diagnostics.
func (*Dispatcher) InlayHintRefresh ¶
func (d *Dispatcher) InlayHintRefresh() error
InlayHintRefresh requests the client to refresh inlay hints currently shown in editors.
func (*Dispatcher) InlineValueRefresh ¶
func (d *Dispatcher) InlineValueRefresh() error
InlineValueRefresh requests the client to refresh inline values currently shown in editors.
func (*Dispatcher) LogMessage ¶
func (d *Dispatcher) LogMessage(params LogMessageParams) error
LogMessage sends a notification to the client to log a message.
func (*Dispatcher) LogTrace ¶
func (d *Dispatcher) LogTrace(params LogTraceParams) error
LogTrace sends a notification to log the trace of the server’s execution. The amount of content of these notifications depends on the current `trace` configuration. If `trace`, the server should not send any `logTrace` notification. If `trace` is `messages`, the server should not add the `verbose` field in the `LogTraceParams`.
func (*Dispatcher) Progress ¶
func (d *Dispatcher) Progress(params ProgressParams) error
Progress notifies the client of progress for a specific task.
func (*Dispatcher) PublishDiagnostics ¶
func (d *Dispatcher) PublishDiagnostics(params PublishDiagnosticsParams) error
PublishDiagnostics sends diagnostics from the server to the client to signal results of validation runs.
func (*Dispatcher) RegisterCapability ¶
func (d *Dispatcher) RegisterCapability(params RegistrationParams) error
RegisterCapability registers a new capability with the client.
func (*Dispatcher) SemanticTokensRefresh ¶
func (d *Dispatcher) SemanticTokensRefresh() error
SemanticTokensRefresh requests the client to refresh the editors for which this server provides semantic tokens. As a result the client should ask the server to recompute the semantic tokens for these editors. This is useful if a server detects a project wide configuration change which requires a re-calculation of all semantic tokens. Note that the client still has the freedom to delay the re-calculation of the semantic tokens if for example an editor is currently not visible.
func (*Dispatcher) ShowMessageNotification ¶
func (d *Dispatcher) ShowMessageNotification(params ShowMessageParams) error
ShowMessageNotification sends a notification to the client to show a message without waiting for a response.
func (*Dispatcher) ShowMessageRequest ¶
func (d *Dispatcher) ShowMessageRequest(params ShowMessageRequestParams) (*MessageActionItem, error)
ShowMessageRequest sends a request to the client to show a message where the request can pass actions and wait for an answer from the client.
func (*Dispatcher) Telemetry ¶
func (d *Dispatcher) Telemetry(params TelemetryEventParams) error
Telemetry sends a notification to the client to log a telemetry event.
func (*Dispatcher) UnregisterCapability ¶
func (d *Dispatcher) UnregisterCapability(params UnregistrationParams) error
UnregisterCapability de-registers a capability with the client.
func (*Dispatcher) WorkspaceConfiguration ¶
func (d *Dispatcher) WorkspaceConfiguration(params ConfigurationParams, target any) error
WorkspaceConfiguration requests the client to fetch the configuration settings for the given scopes and configuration sections within a workspace.
func (*Dispatcher) WorkspaceFolders ¶
func (d *Dispatcher) WorkspaceFolders() ([]WorkspaceFolder, error)
WorkspaceFolders requests that the client fetches the workspace folders that are currently open.
type DocumentColorClientCapabilities ¶
type DocumentColorClientCapabilities struct {
// Whether document color supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DocumentColorClientCapabilities describes the capabilities of a client for document color requests.
type DocumentColorHandlerFunc ¶
type DocumentColorHandlerFunc func( ctx *common.LSPContext, params *DocumentColorParams, ) ([]ColorInformation, error)
DocumentColorHandlerFunc is the function signature for the textDocument/documentColor request handler that can registered for a language server.
type DocumentColorOptions ¶
type DocumentColorOptions struct {
WorkDoneProgressOptions
}
DocumentColorOptions provides server capability options for document color requests.
type DocumentColorParams ¶
type DocumentColorParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DocumentColorParams contains parameters for the textDocument/documentColor request.
type DocumentColorPresentationHandlerFunc ¶
type DocumentColorPresentationHandlerFunc func( ctx *common.LSPContext, params *ColorPresentationParams, ) ([]ColorPresentation, error)
DocumentColorPresentationHandlerFunc is the function signature for the textDocument/colorPresentation request handler that can be registered for a language server.
type DocumentColorRegistrationOptions ¶
type DocumentColorRegistrationOptions struct {
DocumentColorOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
DocumentRegistrationOptions provides server capability registration options for document color requests.
type DocumentDiagnosticHandlerFunc ¶
type DocumentDiagnosticHandlerFunc func( ctx *common.LSPContext, params *DocumentDiagnosticParams, ) (any, error)
DocumentDiagnosticHandlerFunc is the function signature for the textDocument/diagnostic request handler that can be registered for a language server.
returns: RelatedFullDocumentDiagnosticReport | RelatedUnchangedDocumentDiagnosticReport | DocumentDiagnosticReportPartialResult
Note: When returning a server cancellation error response (@since 3.17.0), an instance of the `ErrorWithData` error type should be returned containing the `ServerCancelled` code and the data of the `DiagnosticServerCancellationData` type.
For example:
serverCancelled := "ServerCancelled"
return nil, &ErrorWithData{
Code: &IntOrString{ StrVal: &serverCancelled },
Data: &DiagnosticServerCancellationData{
RetriggerRequest: false,
},
}
type DocumentDiagnosticParams ¶
type DocumentDiagnosticParams struct {
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The additional identifier provided during registration.
Identifier *string `json:"identifier,omitempty"`
// The result id of a previous response if provided.
PreviousResultID *string `json:"previousResultId,omitempty"`
}
DocumentDiagnosticParams contains the parameters for the textDocument/diagnostic request.
type DocumentDiagnosticReportKind ¶
type DocumentDiagnosticReportKind = string
DocumentDiagnosticReportKind represents the available document diagnostic report kinds.
const ( // DocumentDiagnosticReportKindFull represents a diagnostic report // with a full set of problems. DocumentDiagnosticReportKindFull DocumentDiagnosticReportKind = "full" // DocumentDiagnosticReportKindUnchanged represents a diagnostic report // indicating that the last returned report is still accurate. DocumentDiagnosticReportKindUnchanged DocumentDiagnosticReportKind = "unchanged" )
type DocumentDiagnosticReportPartialResult ¶
type DocumentDiagnosticReportPartialResult struct {
// map[string](FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport)
RelatedDocuments map[string]any `json:"relatedDocuments"`
}
DocumentDiagnosticReportPartialResult is a partial result for a document diagnostic report.
@since 3.17.0
func (*DocumentDiagnosticReportPartialResult) UnmarshalJSON ¶
func (r *DocumentDiagnosticReportPartialResult) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type DocumentFilter ¶
type DocumentFilter struct {
// A language id, like `typescript`.
Language *string `json:"language,omitempty"`
// A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
Scheme *string `json:"scheme,omitempty"`
// A glob pattern, like `*.{ts,js}`.
// - `*` to match one or more characters in a path segment
// - `?` to match on one character in a path segment
// - `**` to match any number of path segments, including none
// - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}`
// matches all TypeScript and JavaScript files)
// - `[]` to declare a range of characters to match in a path segment
// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
// - `[!...]` to negate a range of characters to match in a path segment
// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
// not `example.0`)
Pattern *string `json:"pattern,omitempty"`
}
A DocumentFilter denotes a document through properties like language, scheme or pattern. An example is a filter that applies to TypeScript files on disk. Another example is a filter that applies to JSON files with name package.json: { language: 'typescript', scheme: 'file' } { language: 'json', pattern: '**/package.json' }
type DocumentFormattingClientCapabilities ¶
type DocumentFormattingClientCapabilities struct {
// Whether formatting supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DocumentFormattingClientCapabilities describes the capabilities of a client for document formatting requests.
type DocumentFormattingHandlerFunc ¶
type DocumentFormattingHandlerFunc func( ctx *common.LSPContext, params *DocumentFormattingParams, ) ([]TextEdit, error)
DocumentFormattingHandlerFunc is the function signature for the textDocument/formatting request handler that can be registered for a language server.
type DocumentFormattingOptions ¶
type DocumentFormattingOptions struct {
WorkDoneProgressOptions
}
DocumentFormattingOptions provides server capability options for document formatting requests.
type DocumentFormattingParams ¶
type DocumentFormattingParams struct {
WorkDoneProgressParams
// The document to format.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The format options.
Options FormattingOptions `json:"options"`
}
DocumentFormattingParams contains parameters for the textDocument/formatting requests.
type DocumentHighlight ¶
type DocumentHighlight struct {
// The range this highlight applies to.
Range Range `json:"range"`
// The highlight kind, default is DocumentHighlightKind.Text.
Kind *DocumentHighlightKind `json:"kind,omitempty"`
}
DocumentHighlight represents a document highlight.
type DocumentHighlightClientCapabilities ¶
type DocumentHighlightClientCapabilities struct {
// Whether document highlight supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DocumentHighlightClientCapabilities describes the capabilities of a client for document highlight requests.
type DocumentHighlightHandlerFunc ¶
type DocumentHighlightHandlerFunc func( ctx *common.LSPContext, params *DocumentHighlightParams, ) ([]DocumentHighlight, error)
DocumentHighlightHandlerFunc is the function signature for the textDocument/documentHighlight request handler that can be registered for a language server.
type DocumentHighlightKind ¶
type DocumentHighlightKind = Integer
var ( // DocumentHighlightKindText is for a textual occurrence. DocumentHighlightKindText DocumentHighlightKind = 1 // DocumentHighlightKindRead is for read-access of a symbol, like reading a variable. DocumentHighlightKindRead DocumentHighlightKind = 2 // DocumentHighlightKindWrite is for write-access of a symbol, like writing to a variable. DocumentHighlightKindWrite DocumentHighlightKind = 3 )
type DocumentHighlightOptions ¶
type DocumentHighlightOptions struct {
WorkDoneProgressOptions
}
DocumentHighlightOptions provides server capability options for document highlight requests.
type DocumentHighlightParams ¶
type DocumentHighlightParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
DocumentHighlightParams contains the textDocument/documentHighlight request parameters.
type DocumentLink ¶
type DocumentLink struct {
// The range this link applies to.
Range Range `json:"range"`
// The uri this link points to. If missing a resolve request is sent later.
Target *DocumentURI `json:"target,omitempty"`
// The tooltip text when you hover over this link.
//
// If a tooltip is provided, is will be displayed in a string that includes
// instructions on how to trigger the link, such as `{0} (ctrl + click)`.
// The specific instructions vary depending on OS, user settings, and
// localization.
//
// @since 3.15.0
Tooltip *string `json:"tooltip,omitempty"`
// A data entry field that is preserved on a document link between a
// DocumentLinkRequest and a DocumentLinkResolveRequest.
Data LSPAny `json:"data,omitempty"`
}
DocumentLink represents a document link. This is range in a text document that links to an internal or external resource, like another text document or a web site.
type DocumentLinkClientCapabilities ¶
type DocumentLinkClientCapabilities struct {
// Whether document link supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Whether the client supports the `tooltip` property on `DocumentLink`.
//
// @since 3.15.0
TooltipSupport *bool `json:"tooltipSupport,omitempty"`
}
DocumentLinkClientCapabilities describes the capabilities of a client for document link requests.
type DocumentLinkHandlerFunc ¶
type DocumentLinkHandlerFunc func( ctx *common.LSPContext, params *DocumentLinkParams, ) ([]DocumentLink, error)
DocumentLinkHandlerFunc is the function signature for the textDocument/documentLink request handler that can be registered for a language server.
type DocumentLinkOptions ¶
type DocumentLinkOptions struct {
WorkDoneProgressOptions
// Code lens has a resolve provider as well.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
DocumentLinkOptions provides server capability options for document link requests.
type DocumentLinkParams ¶
type DocumentLinkParams struct {
WorkDoneProgressParams
PartialResultParams
// The document to provide document links for.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DocumentLinkParams contains the textDocument/documentLink request parameters.
type DocumentLinkResolveHandlerFunc ¶
type DocumentLinkResolveHandlerFunc func( ctx *common.LSPContext, params *DocumentLink, ) (*DocumentLink, error)
DocumentLinkResolveHandlerFunc is the function signature for the documentLink/resolve request handler that can be registered for a language server.
type DocumentLinkedEditingRangeHandlerFunc ¶
type DocumentLinkedEditingRangeHandlerFunc func( ctx *common.LSPContext, params *LinkedEditingRangeParams, ) (*LinkedEditingRanges, error)
DocumentLinkedEditingRangeHandlerFunc is the function signature for the textDocument/linkedEditingRange request handler that can be registered for a language server.
type DocumentOnTypeFormattingClientCapabilities ¶
type DocumentOnTypeFormattingClientCapabilities struct {
// Whether on type formatting supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DocumentOnTypeFormattingClientCapabilities describes the capabilities of a client for document on type formatting requests.
type DocumentOnTypeFormattingHandlerFunc ¶
type DocumentOnTypeFormattingHandlerFunc func( ctx *common.LSPContext, params *DocumentOnTypeFormattingParams, ) ([]TextEdit, error)
DocumentOnTypeFormattingHandlerFunc is the function signature for the textDocument/onTypeFormatting request handler that can be registered for a language server.
type DocumentOnTypeFormattingOptions ¶
type DocumentOnTypeFormattingOptions struct {
// A character on which formatting should be triggered, like `}`.
FirstTriggerCharacter string `json:"firstTriggerCharacter"`
// More trigger characters.
MoreTriggerCharacter []string `json:"moreTriggerCharacter,omitempty"`
}
DocumentOnTypeFormattingOptions provides server capability options for document on type formatting requests.
type DocumentOnTypeFormattingParams ¶
type DocumentOnTypeFormattingParams struct {
// The document to format.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The position around which the on type formatting should happen.
// This is not necessarily the exact position where the character denoted
// by the property `ch` got typed.
Position Position `json:"position"`
// The character that has been typed that triggered the formatting
// on type request. That is not necessarily the last character that
// got inserted into the document since the client could auto insert
// characters as well (e.g. like automatic brace completion).
Ch string `json:"ch"`
// The formatting options.
Options FormattingOptions `json:"options"`
}
DocumentOnTypeFormattingParams contains parameters for the textDocument/onTypeFormatting requests.
type DocumentPrepareRenameHandlerFunc ¶
type DocumentPrepareRenameHandlerFunc func( ctx *common.LSPContext, params *PrepareRenameParams, ) (any, error)
DocumentPrepareRenameHandlerFunc is the function signature for the textDocument/prepareRename request handler that can be registered for a language server.
Returns: Range | RangeWithPlaceholder | PrepareRenameDefaultBehavior | nil
type DocumentRangeFormattingClientCapabilities ¶
type DocumentRangeFormattingClientCapabilities struct {
// Whether formatting supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
DocumentRangeFormattingClientCapabilities describes the capabilities of a client for document range formatting requests.
type DocumentRangeFormattingHandlerFunc ¶
type DocumentRangeFormattingHandlerFunc func( ctx *common.LSPContext, params *DocumentRangeFormattingParams, ) ([]TextEdit, error)
DocumentRangeFormattingHandlerFunc is the function signature for the textDocument/rangeFormatting request handler that can be registered for a language server.
type DocumentRangeFormattingOptions ¶
type DocumentRangeFormattingOptions struct {
WorkDoneProgressOptions
}
DocumentRangeFormattingOptions provides server capability options for document range formatting requests.
type DocumentRangeFormattingParams ¶
type DocumentRangeFormattingParams struct {
WorkDoneProgressParams
// The document to format.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The range to format.
Range Range `json:"Range"`
// The format options.
Options FormattingOptions `json:"options"`
}
DocumentRangeFormattingParams contains parameters for the textDocument/rangeFormatting requests.
type DocumentRenameHandlerFunc ¶
type DocumentRenameHandlerFunc func( ctx *common.LSPContext, params *RenameParams, ) (*WorkspaceEdit, error)
DocumentRenameHandlerFunc is the function signature for the textDocument/rename request handler that can be registered for a language server.
type DocumentSelector ¶
type DocumentSelector = []DocumentFilter
A DocumentSelector is the combination of one or more document filters.
type DocumentSymbol ¶
type DocumentSymbol struct {
// The name of this symbol. Will be displayed in the user interface and
// therefore must not be an empty string or a string only consisting of
// white spaces.
Name string `json:"name"`
// More detail for this symbol, e.g the signature of a function.
Detail *string `json:"detail,omitempty"`
// The kind of this symbol.
Kind SymbolKind `json:"kind"`
// Tags for this symbol.
//
// @since 3.16.0
Tags []SymbolTag `json:"tags,omitempty"`
// Indicates if this symbol is deprecated.
//
// @deprecated Use tags instead.
Deprecated *bool `json:"deprecated,omitempty"`
// The range enclosing this symbol not including leading/trailing whitespace
// but everything else like comments. This information is typically used to
// determine if the clients cursor is inside the symbol to reveal in the
// symbol in the UI.
Range Range `json:"range"`
// The range that should be selected and revealed when this symbol is being
// picked, e.g. the name of a function. Must be contained by the `range`.
SelectionRange Range `json:"selectionRange"`
// Children of this symbol, e.g. properties of a class.
Children []DocumentSymbol `json:"children,omitempty"`
}
DocumentSymbol represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.
type DocumentSymbolClientCapabilities ¶
type DocumentSymbolClientCapabilities struct {
// Whether document symbol supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Specific capabilities for the `SymbolKind` in the
// `textDocument/documentSymbol` request.
SymbolKind *SymbolKindCapabilities `json:"symbolKind,omitempty"`
// The client supports hierarchical document symbols.
HierarchicalDocumentSymbolSupport *bool `json:"hierarchicalDocumentSymbolSupport,omitempty"`
// The client supports tags on `SymbolInformation`. Tags are supported on
// `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true.
// Clients supporting tags have to handle unknown tags gracefully.
//
// @since 3.16.0
TagSupport *SymbolTagSupport `json:"tagSupport,omitempty"`
// The client supports an additional label presented in the UI when
// registering a document symbol provider.
//
// @since 3.16.0
LabelSupport *bool `json:"labelSupport,omitempty"`
}
DocumentSymbolClientCapabilities describes the capabilities of a client for document symbol requests.
type DocumentSymbolHandlerFunc ¶
type DocumentSymbolHandlerFunc func( ctx *common.LSPContext, params *DocumentSymbolParams, ) (any, error)
DocumentSymbolHandlerFunc is the function signature for the textDocument/documentSymbol request handler that can be registered for a language server.
Returns: []DocumentSymbol | []SymbolInformation | nil
type DocumentSymbolOptions ¶
type DocumentSymbolOptions struct {
WorkDoneProgressOptions
// A human-readable string that is shown when multiple outline trees
// are shown for the same document.
//
// @since 3.16.0
Label *string `json:"label,omitempty"`
}
DocumentSymbolOptions provides server capability options for document symbol requests.
type DocumentSymbolParams ¶
type DocumentSymbolParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
DocumentSymbolParams contains the textDocument/documentSymbol request parameters.
type DocumentURI ¶
type DocumentURI = string
DocumentURI is a string representing a URI to a document.
type DocumentURIObject ¶
type DocumentURIObject struct {
URI DocumentURI `json:"uri"`
}
DocumentURIObject represents a document URI object used in the `WorkspaceSymbol` struct.
type ErrorWithData ¶
type ErrorWithData struct {
// The error code (e.g. diagnostic error code)
Code *IntOrString
// The data to send with the error.
Data any
}
ErrorWithData is an error that contains additional data such as that for server cancellations.
type ExecuteCommandClientCapabilities ¶
type ExecuteCommandClientCapabilities struct {
// Execute command supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
ExecuteCommandClientCapabilities describes the capabilities of a client for the `workspace/executeCommand` request.
type ExecuteCommandOptions ¶
type ExecuteCommandOptions struct {
WorkDoneProgressOptions
// The commands to be executed on the server.
Commands []string `json:"commands"`
}
ExecuteCommandOptions options to be used for server capabilities for executing commands in workspaces.
type ExecuteCommandParams ¶
type ExecuteCommandParams struct {
WorkDoneProgressParams
// The identifier of the actual command handler.
Command string `json:"command"`
// Arguments that the command should be invoked with.
Arguments []LSPAny `json:"arguments,omitempty"`
}
ExecuteCommandParams contains the parameters for the `workspace/executeCommand` request.
type ExitHandlerFunc ¶
type ExitHandlerFunc func(ctx *common.LSPContext) error
ExitHandlerFunc is the function signature for the exit notification handler that can be registered for a language server.
type FailureHandlingKind ¶
type FailureHandlingKind = string
const ( // Applying the workspace change is simply aborted if one of the changes provided // fails. All operations executed before the failing operation stay executed. FailureHandlingKindAbort FailureHandlingKind = "abort" // All operations are executed transactional. That means they either all // succeed or no changes at all are applied to the workspace. FailureHandlingKindTransactional FailureHandlingKind = "transactional" // If the workspace edit contains only textual file changes they are executed transactional. // If resource changes (create, rename or delete file) are part of the change the failure // handling strategy is abort. FailureHandlingKindTextOnlyTransactional FailureHandlingKind = "textOnlyTransactional" // The client tries to undo the operations already executed. But there is no // guarantee that this is succeeding. FailureHandlingKindUndo FailureHandlingKind = "undo" )
type FileChangeType ¶
type FileChangeType = Integer
FileChangeType represents a file event type.
const ( // FileChangeCreated is the event type for a file creation. FileChangeCreated FileChangeType = 1 // FileChangeChanged is the event type for a file change. FileChangeChanged FileChangeType = 2 // FileChangeDeleted is the event type for a file deletion. FileChangeDeleted FileChangeType = 3 )
type FileCreate ¶
type FileCreate struct {
// A file:// URI for the location of the file/folder being created.
URI string `json:"uri"`
}
FileCreate represents information on a file/folder creation.
@since 3.16.0
type FileDelete ¶
type FileDelete struct {
// A file:// URI for the location of the file/folder being deleted.
URI string `json:"uri"`
}
FileDelete represents information on a file/folder deletion.
@since 3.16.0
type FileEvent ¶
type FileEvent struct {
// The file's URI.
URI DocumentURI `json:"uri"`
// The change type.
Type FileChangeType `json:"type"`
}
FileEvent is an event describing a file change.
type FileOperationClientCapabilities ¶
type FileOperationClientCapabilities struct {
// Whether the client supports dynamic regristration for file requests/notifications.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client has support for sending didCreateFiles notifications.
DidCreate *bool `json:"didCreate,omitempty"`
// The client has support for sending willCreateFiles requests.
WillCreate *bool `json:"willCreate,omitempty"`
// The client has support for sending didRenameFiles notifications.
DidRename *bool `json:"didRename,omitempty"`
// The client has support for sending willRenameFiles requests.
WillRename *bool `json:"willRename,omitempty"`
// The client has support for sending didDeleteFiles notifications.
DidDelete *bool `json:"didDelete,omitempty"`
// The client has support for sending willDeleteFiles requests.
WillDelete *bool `json:"willDelete,omitempty"`
}
FileOperationClientCapabilities represents the capabilities of the client related to file operations.
type FileOperationFilter ¶
type FileOperationFilter struct {
// A Uri like `file` or `untitled`.
Scheme *string `json:"scheme,omitempty"`
// The actual file operation pattern.
Pattern FileOperationPattern `json:"pattern"`
}
FileOperationFilter dseecribes in which file operation requests or notification the server is interested in.
@since 3.16.0
type FileOperationPattern ¶
type FileOperationPattern struct {
// The glob pattern to match. Glob patterns can have the following syntax:
// - `*` to match one or more characters in a path segment
// - `?` to match on one character in a path segment
// - `**` to match any number of path segments, including none
// - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}`
// matches all TypeScript and JavaScript files)
// - `[]` to declare a range of characters to match in a path segment
// (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
// - `[!...]` to negate a range of characters to match in a path segment
// (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
// not `example.0`)
Glob string `json:"glob"`
// Whether to match files or folders with this pattern.
//
// Matches both if undefined.
Matches *FileOperationPatternKind `json:"matches,omitempty"`
// Additional options used during matching.
Options *FileOperationPatternOptions `json:"options,omitempty"`
}
FileOperationPattern describes a file operation pattern to describe in which file operation requests or notifications the server is interested in.
@since 3.16.0
type FileOperationPatternKind ¶
type FileOperationPatternKind = string
FileOperationPatternKind describes if a glob pattern matches a file or folder.
const ( // FileOperationPatternKindFile matches files only. FileOperationPatternKindFile FileOperationPatternKind = "file" // FileOperationPatternKindFolder matches folders only. FileOperationPatternKindFolder FileOperationPatternKind = "folder" )
type FileOperationPatternOptions ¶
type FileOperationPatternOptions struct {
// The pattern should be matched ignoring casing.
IgnoreCase *bool `json:"ignoreCase,omitempty"`
}
FileOperationPatternOptions provides matching options for file operation patterns.
@since 3.16.0
type FileOperationRegistrationOptions ¶
type FileOperationRegistrationOptions struct {
// The actual filters.
Filters []FileOperationFilter `json:"filters"`
}
WorkspaceFoldersClientCapabilities describes the options to register for file operations.
type FileRename ¶
type FileRename struct {
// A file:// URI for the location of the file/folder being renamed.
OldURI string `json:"oldUri"`
// A file:// URI for the new location of the file/folder being renamed.
NewURI string `json:"newUri"`
}
FileRename represents information on a file/folder rename.
@since 3.16.0
type FindReferencesHandlerFunc ¶
type FindReferencesHandlerFunc func(ctx *common.LSPContext, params *ReferencesParams) ([]Location, error)
FindReferencesHandlerFunc is the function signature for the textDocument/references request handler that can be registered for a language server.
type FoldingRange ¶
type FoldingRange struct {
// The zero-based start line of the range to fold. The folded area starts
// after the line's last character. To be valid, the end must be zero or
// larger and smaller than the number of lines in the document.
StartLine UInteger `json:"startLine"`
// The zero-based character offset from where the folded range starts. If
// not defined, defaults to the length of the start line.
StartCharacter *UInteger `json:"startCharacter,omitempty"`
// The zero-based end line of the range to fold. The folded area ends with
// the line's last character. To be valid, the end must be zero or larger
// and smaller than the number of lines in the document.
EndLine UInteger `json:"endLine"`
// The zero-based character offset before the folded range ends. If not
// defined, defaults to the length of the end line.
EndCharacter *UInteger `json:"endCharacter,omitempty"`
// Describes the kind of the folding range such as `comment` or `region`.
// The kind is used to categorize folding ranges and used by commands like
// 'Fold all comments'. See [FoldingRangeKind](#FoldingRangeKind) for an
// enumeration of standardized kinds.
Kind *FoldingRangeKind `json:"kind,omitempty"`
// The text that the client should show when the specified range is
// collapsed. If not defined or not supported by the client, a default
// will be chosen by the client.
//
// @since 3.17.0 - proposed
CollapsedText *string `json:"collapsedText,omitempty"`
}
FoldingRange represents a folding range. To be valid, start and end line must be bigger than zero and smaller than the number of lines in the document. Clients are free to ignore invalid ranges.
type FoldingRangeCapabilities ¶
type FoldingRangeCapabilities struct {
// If set, the client signals that it supports setting collapsedText on
// folding ranges to display custom labels instead of the default text.
//
// @since 3.17.0
CollapsedText *bool `json:"collapsedText,omitempty"`
}
FoldingRangeCapabilities describes the additiona options for the capabilities of a client for folding ranges.
type FoldingRangeClientCapabilities ¶
type FoldingRangeClientCapabilities struct {
// Whether implementation supports dynamic registration for folding range
// providers. If this is set to `true` the client supports the new
// `FoldingRangeRegistrationOptions` return value for the corresponding
// server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The maximum number of folding ranges that the client prefers to receive
// per document. The value serves as a hint, servers are free to follow the
// limit.
RangeLimit *UInteger `json:"rangeLimit,omitempty"`
// If set, the client signals that it only supports folding complete lines.
// If set, client will ignore specified `startCharacter` and `endCharacter`
// properties in a FoldingRange.
LineFoldingOnly *bool `json:"lineFoldingOnly,omitempty"`
// Specific options for the folding range kind.
//
// @since 3.17.0
FoldingRangeKind *FoldingRangeKindCapabilities `json:"foldingRangeKind,omitempty"`
// Specific options for the folding range.
// @since 3.17.0
FoldingRange *FoldingRangeCapabilities `json:"foldingRange,omitempty"`
}
FoldingRangeClientCapabilities describes the capabilities of a client for folding range requests.
type FoldingRangeHandlerFunc ¶
type FoldingRangeHandlerFunc func( ctx *common.LSPContext, params *FoldingRangeParams, ) ([]FoldingRange, error)
FoldingRangeHandlerFunc is the function signature for the textDocument/foldingRange request handler that can be registered for a language server.
type FoldingRangeKind ¶
type FoldingRangeKind = string
FoldingRangeKind represents predefined range kinds.
var ( // FoldingRangeKindComment represents a folding range // for a comment. FoldingRangeKindComment FoldingRangeKind = "comment" // FoldingRangeKindImports represents a folding range // for imports. FoldingRangeKindImports FoldingRangeKind = "imports" // FoldingRangeKindRegion represents a folding range // for a region (e.g. `#region`). FoldingRangeKindRegion FoldingRangeKind = "region" )
type FoldingRangeKindCapabilities ¶
type FoldingRangeKindCapabilities struct {
// The folding range kind values the client supports. When this
// property exists the client also guarantees that it will
// handle values outside its set gracefully and falls back
// to a default value when unknown.
ValueSet []FoldingRangeKind `json:"valueSet,omitempty"`
}
FoldingRangeKindCapabilities describes the capabilities of a client for folding range kinds.
type FoldingRangeOptions ¶
type FoldingRangeOptions struct {
WorkDoneProgressOptions
}
FoldingRangeOptions provides server capability options for folding range requests.
type FoldingRangeParams ¶
type FoldingRangeParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
FoldingRangeParams contains the textDocument/foldingRange request parameters.
type FoldingRangeRegistrationOptions ¶
type FoldingRangeRegistrationOptions struct {
FoldingRangeOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
FoldingRangeRegistrationOptions provides server capability registration options for folding range requests.
type FormattingOptions ¶
FormattingOptions is a value-object describing what options formatting should use.
map[string](bool | Integer | string)
type FullDocumentDiagnosticReport ¶
type FullDocumentDiagnosticReport struct {
// A full document diagnostic report.
// Expected to be DocumentDiagnosticReportKindFull.
Kind DocumentDiagnosticReportKind `json:"kind"`
// An optional result id. If provided, it will be sent on the next
// diagnostic request for the same document.
ResultID *string `json:"resultId,omitempty"`
// The actual items.
Items []Diagnostic `json:"items"`
}
FullDocumentDiagnosticReport is a diagnostic report with a full set of problems.
@since 3.17.0
type GeneralClientCapabilities ¶
type GeneralClientCapabilities struct {
// Client capability that signals how the client handles stale requests
// (e.g. a request for which the client will not process the response anymor
// since teh information is outdated).
//
// @since 3.17.0
StaleRequestSupport *StaleRequestSupport `json:"staleRequestSupport,omitempty"`
// Client capabilities specific to regular expressions.
//
// @since 3.16.0
RegularExpressions *RegularExpressionsClientCapabilities `json:"regularExpressions,omitempty"`
// Client capabilities specific to the client's markdown parser.
//
// @since 3.16.0
Markdown *MarkdownClientCapabilities `json:"markdown,omitempty"`
// The position encodings supported by the client. Client and server
// have to agree on the same position encoding to ensure that offsets
// (e.g. character position in a line) are interpreted the same on both
// side.
//
// To keep the protocol backwards compatible the following applies: if
// the value 'utf-16' is missing from the array of position encodings
// servers can assume that the client supports UTF-16. UTF-16 is
// therefore a mandatory encoding.
//
// If omitted it defaults to ['utf-16'].
//
// Implementation considerations: since the conversion from one encoding
// into another requires the content of the file / line the conversion
// is best done where the file is read which is usually on the server
// side.
//
// @since 3.17.0
PositionEncodings []PositionEncodingKind `json:"positionEncodings,omitempty"`
}
GeneralClientCapabilities represents the general capabilities of the client.
@since 3.16.0
type GotoDeclarationHandlerFunc ¶
type GotoDeclarationHandlerFunc func(ctx *common.LSPContext, params *DeclarationParams) (any, error)
GoToDeclarationHandlerFunc is the function signature for the textDocument/declaration request handler that can be registered for a language server.
Returns: Location | []Location | []LocationLink | nil
type GotoDefinitionHandlerFunc ¶
type GotoDefinitionHandlerFunc func(ctx *common.LSPContext, params *DefinitionParams) (any, error)
GoToDefinitionHandlerFunc is the function signature for the textDocument/definition request handler that can be registered for a language server.
Returns: Location | []Location | []LocationLink | nil
type GotoImplementationHandlerFunc ¶
type GotoImplementationHandlerFunc func(ctx *common.LSPContext, params *ImplementationParams) (any, error)
GoToImplementationHandlerFunc is the function signature for the textDocument/implementation request handler that can be registered for a language server.
Returns: Location | []Location | []LocationLink | nil
type GotoTypeDefinitionHandlerFunc ¶
type GotoTypeDefinitionHandlerFunc func(ctx *common.LSPContext, params *TypeDefinitionParams) (any, error)
GoToTypeDefinitionHandlerFunc is the function signature for the textDocument/typeDefinition request handler that can be registered for a language server.
Returns: Location | []Location | []LocationLink | nil
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler defines a set of message handlers that allows the server to respond to client notifications and requests. Server capabilities can be derived from the handlers defined here. Instances of handlers should be created with the `NewHandler` function with message handlers provided as options or set after creation using `Set*Handler` methods.
func NewHandler ¶
func NewHandler(opts ...HandlerOption) *Handler
NewHandler creates a new instance of a handler, optionally, with a provided set of method handlers.
func (*Handler) CreateServerCapabilities ¶
func (h *Handler) CreateServerCapabilities() ServerCapabilities
CreateServerCapabilities creates a server capabilities object to be sent to the client during initialization. This derives a base set of capabilities from the configured handlers that can be modified before being sent to the client. All handlers that are not dynamically registered must be set before calling this method.
For notebook synchronisation events, the server capabilities need to be set with notebook selectors to indicate which notebooks should be supported. See: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notebookDocument_synchronization (Go to the "Server Capability" section)
func (*Handler) Handle ¶
func (h *Handler) Handle(ctx *common.LSPContext) (r any, validMethod bool, validParams bool, err error)
Fulfils the common.Handler interface.
func (*Handler) IsInitialized ¶
IsInitialized returns whether or not the connection to the client has been initialized as per "Lifecycle Messages" of the LSP specification.
func (*Handler) SetCallHierarchyIncomingCallsHandler ¶
func (h *Handler) SetCallHierarchyIncomingCallsHandler(handler CallHierarchyIncomingCallsHandlerFunc)
SetCallHierarchyIncomingCallsHandler sets the handler for the `textDocument/incomingCalls` request.
func (*Handler) SetCallHierarchyOutgoingCallsHandler ¶
func (h *Handler) SetCallHierarchyOutgoingCallsHandler(handler CallHierarchyOutgoingCallsHandlerFunc)
SetCallHierarchyOutgoingCallsHandler sets the handler for the `textDocument/outgoingCalls` request.
func (*Handler) SetCancelRequestHandler ¶
func (h *Handler) SetCancelRequestHandler(handler CancelRequestHandlerFunc)
SetCancelRequestHandler sets the handler for the `$/cancelRequest` notification.
func (*Handler) SetCodeActionHandler ¶
func (h *Handler) SetCodeActionHandler(handler CodeActionHandlerFunc)
SetCodeActionHandler sets the handler for the `textDocument/codeAction` request.
func (*Handler) SetCodeActionResolveHandler ¶
func (h *Handler) SetCodeActionResolveHandler(handler CodeActionResolveHandlerFunc)
SetCodeActionResolveHandler sets the handler for the `codeAction/resolve` request.
func (*Handler) SetCodeLensHandler ¶
func (h *Handler) SetCodeLensHandler(handler CodeLensHandlerFunc)
SetCodeLensHandler sets the handler for the `textDocument/codeLens` request.
func (*Handler) SetCodeLensResolveHandler ¶
func (h *Handler) SetCodeLensResolveHandler(handler CodeLensResolveHandlerFunc)
SetCodeLensResolveHandler sets the handler for the `codeLens/resolve` request.
func (*Handler) SetCompletionHandler ¶
func (h *Handler) SetCompletionHandler(handler CompletionHandlerFunc)
SetCompletionHandler sets the handler for the `textDocument/completion` request.
func (*Handler) SetCompletionItemResolveHandler ¶
func (h *Handler) SetCompletionItemResolveHandler(handler CompletionItemResolveHandlerFunc)
SetCompletionItemResolveHandler sets the handler for the `completionItem/resolve` request.
func (*Handler) SetDocumentColorHandler ¶
func (h *Handler) SetDocumentColorHandler(handler DocumentColorHandlerFunc)
SetDocumentColorHandler sets the handler for the `textDocument/documentColor` request.
func (*Handler) SetDocumentColorPresentationHandler ¶
func (h *Handler) SetDocumentColorPresentationHandler(handler DocumentColorPresentationHandlerFunc)
SetDocumentColorPresentationHandler sets the handler for the `textDocument/colorPresentation` request.
func (*Handler) SetDocumentDiagnosticsHandler ¶
func (h *Handler) SetDocumentDiagnosticsHandler(handler DocumentDiagnosticHandlerFunc)
SetDocumentDiagnosticsHandler sets the handler for the `textDocument/diagnostics` request.
func (*Handler) SetDocumentFormattingHandler ¶
func (h *Handler) SetDocumentFormattingHandler(handler DocumentFormattingHandlerFunc)
SetDocumentFormattingHandler sets the handler for the `textDocument/formatting` request.
func (*Handler) SetDocumentHighlightHandler ¶
func (h *Handler) SetDocumentHighlightHandler(handler DocumentHighlightHandlerFunc)
SetDocumentHighlightHandler sets the handler for the `textDocument/documentHighlight` request.
func (*Handler) SetDocumentLinkHandler ¶
func (h *Handler) SetDocumentLinkHandler(handler DocumentLinkHandlerFunc)
SetDocumentLinkHandler sets the handler for the `textDocument/documentLink` request.
func (*Handler) SetDocumentLinkResolveHandler ¶
func (h *Handler) SetDocumentLinkResolveHandler(handler DocumentLinkResolveHandlerFunc)
SetDocumentLinkResolveHandler sets the handler for the `documentLink/resolve` request.
func (*Handler) SetDocumentLinkedEditingRangeHandler ¶
func (h *Handler) SetDocumentLinkedEditingRangeHandler(handler DocumentLinkedEditingRangeHandlerFunc)
SetDocumentLinkedEditingRangeHandler sets the handler for the `textDocument/linkedEditingRange` request.
func (*Handler) SetDocumentOnTypeFormattingHandler ¶
func (h *Handler) SetDocumentOnTypeFormattingHandler(handler DocumentOnTypeFormattingHandlerFunc)
SetDocumentOnTypeFormattingHandler sets the handler for the `textDocument/onTypeFormatting` request.
func (*Handler) SetDocumentPrepareRenameHandler ¶
func (h *Handler) SetDocumentPrepareRenameHandler(handler DocumentPrepareRenameHandlerFunc)
SetDocumentPrepareRenameHandler sets the handler for the `textDocument/prepareRename` request.
func (*Handler) SetDocumentRangeFormattingHandler ¶
func (h *Handler) SetDocumentRangeFormattingHandler(handler DocumentRangeFormattingHandlerFunc)
SetDocumentRangeFormattingHandler sets the handler for the `textDocument/rangeFormatting` request.
func (*Handler) SetDocumentRenameHandler ¶
func (h *Handler) SetDocumentRenameHandler(handler DocumentRenameHandlerFunc)
SetDocumentRenameHandler sets the handler for the `textDocument/rename` request.
func (*Handler) SetDocumentSymbolHandler ¶
func (h *Handler) SetDocumentSymbolHandler(handler DocumentSymbolHandlerFunc)
SetDocumentSymbolHandler sets the handler for the `textDocument/documentSymbol` request.
func (*Handler) SetExitHandler ¶
func (h *Handler) SetExitHandler(handler ExitHandlerFunc)
SetExitHandler sets the handler for the `exit` notification.
func (*Handler) SetFindReferencesHandler ¶
func (h *Handler) SetFindReferencesHandler(handler FindReferencesHandlerFunc)
SetFindReferencesHandler sets the handler for the `textDocument/references` request.
func (*Handler) SetFoldingRangeHandler ¶
func (h *Handler) SetFoldingRangeHandler(handler FoldingRangeHandlerFunc)
SetFoldingRangeHandler sets the handler for the `textDocument/foldingRange` request.
func (*Handler) SetGotoDeclarationHandler ¶
func (h *Handler) SetGotoDeclarationHandler(handler GotoDeclarationHandlerFunc)
SetGotoDeclarationHandler sets the handler for the `textDocument/declaration` request.
func (*Handler) SetGotoDefinitionHandler ¶
func (h *Handler) SetGotoDefinitionHandler(handler GotoDefinitionHandlerFunc)
SetGotoDefinitionHandler sets the handler for the `textDocument/definition` request.
func (*Handler) SetGotoImplementationHandler ¶
func (h *Handler) SetGotoImplementationHandler(handler GotoImplementationHandlerFunc)
SetGotoImplementationHandler sets the handler for the `textDocument/implementation` request.
func (*Handler) SetGotoTypeDefinitionHandler ¶
func (h *Handler) SetGotoTypeDefinitionHandler(handler GotoTypeDefinitionHandlerFunc)
SetGotoTypeDefinitionHandler sets the handler for the `textDocument/typeDefinition` request.
func (*Handler) SetHoverHandler ¶
func (h *Handler) SetHoverHandler(handler HoverHandlerFunc)
SetHoverHandler sets the handler for the `textDocument/hover` request.
func (*Handler) SetInitializeHandler ¶
func (h *Handler) SetInitializeHandler(handler InitializeHandlerFunc)
SetInitializeHandler sets the handler for the `initialize` request.
func (*Handler) SetInitialized ¶
SetInitialized sets the initialized state of the connection to the client as per "Lifecycle Messages" of the LSP specification.
func (*Handler) SetInitializedHandler ¶
func (h *Handler) SetInitializedHandler(handler InitializedHandlerFunc)
SetInitializedHandler sets the handler for the `initialized` notification.
func (*Handler) SetInlayHintHandler ¶
func (h *Handler) SetInlayHintHandler(handler InlayHintHandlerFunc)
SetInlayHintHandler sets the handler for the `textDocument/inlayHint` request.
func (*Handler) SetInlayHintResolveHandler ¶
func (h *Handler) SetInlayHintResolveHandler(handler InlayHintResolveHandlerFunc)
SetInlayHintResolveHandler sets the handler for the `inlayHint/resolve` request.
func (*Handler) SetInlineValueHandler ¶
func (h *Handler) SetInlineValueHandler(handler InlineValueHandlerFunc)
SetInlineValueHandler sets the handler for the `inlineValue` request.
func (*Handler) SetMonikerHandler ¶
func (h *Handler) SetMonikerHandler(handler MonikerHandlerFunc)
SetMonikerHandler sets the handler for the `textDocument/moniker` request.
func (*Handler) SetNotebookDocumentDidChangeHandler ¶
func (h *Handler) SetNotebookDocumentDidChangeHandler(handler NotebookDocumentDidChangeHandlerFunc)
SetNotebookDocumentDidChangeHandler sets the handler for the `notebookDocument/didChange` notification.
func (*Handler) SetNotebookDocumentDidCloseHandler ¶
func (h *Handler) SetNotebookDocumentDidCloseHandler(handler NotebookDocumentDidCloseHandlerFunc)
SetNotebookDocumentDidCloseHandler sets the handler for the `notebookDocument/didClose` notification.
func (*Handler) SetNotebookDocumentDidOpenHandler ¶
func (h *Handler) SetNotebookDocumentDidOpenHandler(handler NotebookDocumentDidOpenHandlerFunc)
SetNotebookDocumentDidOpenHandler sets the handler for the `notebookDocument/didOpen` notification.
func (*Handler) SetNotebookDocumentDidSaveHandler ¶
func (h *Handler) SetNotebookDocumentDidSaveHandler(handler NotebookDocumentDidSaveHandlerFunc)
SetNotebookDocumentDidSaveHandler sets the handler for the `notebookDocument/didSave` notification.
func (*Handler) SetPrepareCallHierarchyHandler ¶
func (h *Handler) SetPrepareCallHierarchyHandler(handler PrepareCallHierarchyHandlerFunc)
SetPrepareCallHierarchyHandler sets the handler for the `textDocument/prepareCallHierarchy` request.
func (*Handler) SetPrepareTypeHierarchyHandler ¶
func (h *Handler) SetPrepareTypeHierarchyHandler(handler PrepareTypeHierarchyHandlerFunc)
SetPrepareTypeHierarchyHandler sets the handler for the `textDocument/prepareTypeHierarchy` request.
func (*Handler) SetProgressHandler ¶
func (h *Handler) SetProgressHandler(handler ProgressHandlerFunc)
SetProgressHandler sets the handler for the `$/progress` notification.
func (*Handler) SetSelectionRangeHandler ¶
func (h *Handler) SetSelectionRangeHandler(handler SelectionRangeHandlerFunc)
SetSelectionRangeHandler sets the handler for the `textDocument/selectionRange` request.
func (*Handler) SetSemanticTokensFullDeltaHandler ¶
func (h *Handler) SetSemanticTokensFullDeltaHandler(handler SemanticTokensFullDeltaHandlerFunc)
SetSemanticTokensFullDeltaHandler sets the handler for the `textDocument/semanticTokens/full/delta` request.
func (*Handler) SetSemanticTokensFullHandler ¶
func (h *Handler) SetSemanticTokensFullHandler(handler SemanticTokensFullHandlerFunc)
SetSemanticTokensFullHandler sets the handler for the `textDocument/semanticTokens/full` request.
func (*Handler) SetSemanticTokensRangeHandler ¶
func (h *Handler) SetSemanticTokensRangeHandler(handler SemanticTokensRangeHandlerFunc)
SetSemanticTokensRangeHandler sets the handler for the `textDocument/semanticTokens/range` request.
func (*Handler) SetShutdownHandler ¶
func (h *Handler) SetShutdownHandler(handler ShutdownHandlerFunc)
SetShutdownHandler sets the handler for the `shutdown` request.
func (*Handler) SetSignatureHelpHandler ¶
func (h *Handler) SetSignatureHelpHandler(handler SignatureHelpHandlerFunc)
SetSignatureHelpHandler sets the handler for the `textDocument/signatureHelp` request.
func (*Handler) SetTextDocumentDidChangeHandler ¶
func (h *Handler) SetTextDocumentDidChangeHandler(handler TextDocumentDidChangeHandlerFunc)
SetTextDocumentDidChangeHandler sets the handler for the `textDocument/didChange` notification.
func (*Handler) SetTextDocumentDidCloseHandler ¶
func (h *Handler) SetTextDocumentDidCloseHandler(handler TextDocumentDidCloseHandlerFunc)
SetTextDocumentDidCloseHandler sets the handler for the `textDocument/didClose` notification.
func (*Handler) SetTextDocumentDidOpenHandler ¶
func (h *Handler) SetTextDocumentDidOpenHandler(handler TextDocumentDidOpenHandlerFunc)
SetTextDocumentDidOpenHandler sets the handler for the `textDocument/didOpen` notification.
func (*Handler) SetTextDocumentDidSaveHandler ¶
func (h *Handler) SetTextDocumentDidSaveHandler(handler TextDocumentDidSaveHandlerFunc)
SetTextDocumentDidSaveHandler sets the handler for the `textDocument/didSave` notification.
func (*Handler) SetTextDocumentWillSaveHandler ¶
func (h *Handler) SetTextDocumentWillSaveHandler(handler TextDocumentWillSaveHandlerFunc)
SetTextDocumentWillSaveHandler sets the handler for the `textDocument/willSave` notification.
func (*Handler) SetTextDocumentWillSaveWaitUntilHandler ¶
func (h *Handler) SetTextDocumentWillSaveWaitUntilHandler(handler TextDocumentWillSaveWaitUntilHandlerFunc)
SetTextDocumentWillSaveWaitUntilHandler sets the handler for the `textDocument/willSaveWaitUntil` request.
func (*Handler) SetTraceHandler ¶
func (h *Handler) SetTraceHandler(handler SetTraceHandlerFunc)
SetTraceHandler sets the handler for the `$/setTrace` notification.
func (*Handler) SetTypeHierarchySubtypesHandler ¶
func (h *Handler) SetTypeHierarchySubtypesHandler(handler TypeHierarchySubtypesHandlerFunc)
SetTypeHierarchySubtypesHandler sets the handler for the `typeHierarchy/subtypes` request.
func (*Handler) SetTypeHierarchySupertypesHandler ¶
func (h *Handler) SetTypeHierarchySupertypesHandler(handler TypeHierarchySupertypesHandlerFunc)
SetTypeHierarchySupertypesHandler sets the handler for the `typeHierarchy/supertypes` request.
func (*Handler) SetWindowWorkDoneProgressCancelHandler ¶
func (h *Handler) SetWindowWorkDoneProgressCancelHandler(handler WindowWorkDoneProgressCancelHandler)
SetWindowWorkDoneProgressCancelHandler sets the handler for the `window/workDoneProgress/cancel` notification.
func (*Handler) SetWorkspaceDiagnosticHandler ¶
func (h *Handler) SetWorkspaceDiagnosticHandler(handler WorkspaceDiagnosticHandlerFunc)
SetWorkspaceDiagnosticHandler sets the handler for the `workspace/diagnostics` request.
func (*Handler) SetWorkspaceDidChangeConfigurationHandler ¶
func (h *Handler) SetWorkspaceDidChangeConfigurationHandler(handler WorkspaceDidChangeConfigurationHandlerFunc)
SetWorkspaceDidChangeConfigurationHandler sets the handler for the `workspace/didChangeConfiguration` notification.
func (*Handler) SetWorkspaceDidChangeFoldersHandler ¶
func (h *Handler) SetWorkspaceDidChangeFoldersHandler(handler WorkspaceDidChangeFoldersHandlerFunc)
SetWorkspaceDidChangeFoldersHandler sets the handler for the `workspace/didChangeWorkspaceFolders` notification.
func (*Handler) SetWorkspaceDidChangeWatchedFilesHandler ¶
func (h *Handler) SetWorkspaceDidChangeWatchedFilesHandler(handler WorkspaceDidChangeWatchedFilesHandlerFunc)
SetWorkspaceDidChangeWatchedFilesHandler sets the handler for the `workspace/didChangeWatchedFiles` notification.
func (*Handler) SetWorkspaceDidCreateFilesHandler ¶
func (h *Handler) SetWorkspaceDidCreateFilesHandler(handler WorkspaceDidCreateFilesHandlerFunc)
SetWorkspaceDidCreateFilesHandler sets the handler for the `workspace/didCreateFiles` notification.
func (*Handler) SetWorkspaceDidDeleteFilesHandler ¶
func (h *Handler) SetWorkspaceDidDeleteFilesHandler(handler WorkspaceDidDeleteFilesHandlerFunc)
SetWorkspaceDidDeleteFilesHandler sets the handler for the `workspace/didDeleteFiles` notification.
func (*Handler) SetWorkspaceDidRenameFilesHandler ¶
func (h *Handler) SetWorkspaceDidRenameFilesHandler(handler WorkspaceDidRenameFilesHandlerFunc)
SetWorkspaceDidRenameFilesHandler sets the handler for the `workspace/didRenameFiles` notification.
func (*Handler) SetWorkspaceExecuteCommandHandler ¶
func (h *Handler) SetWorkspaceExecuteCommandHandler(handler WorkspaceExecuteCommandHandlerFunc)
SetWorkspaceExecuteCommandHandler sets the handler for the `workspace/executeCommand` request.
func (*Handler) SetWorkspaceSymbolHandler ¶
func (h *Handler) SetWorkspaceSymbolHandler(handler WorkspaceSymbolHandlerFunc)
SetWorkspaceSymbolHandler sets the handler for the `workspace/symbol` request.
func (*Handler) SetWorkspaceSymbolResolveHandler ¶
func (h *Handler) SetWorkspaceSymbolResolveHandler(handler WorkspaceSymbolResolveHandlerFunc)
SetWorkspaceSymbolResolveHandler sets the handler for the `workspaceSymbol/resolve` request.
func (*Handler) SetWorkspaceWillCreateFilesHandler ¶
func (h *Handler) SetWorkspaceWillCreateFilesHandler(handler WorkspaceWillCreateFilesHandlerFunc)
SetWorkspaceWillCreateFilesHandler sets the handler for the `workspace/willCreateFiles` request.
func (*Handler) SetWorkspaceWillDeleteFilesHandler ¶
func (h *Handler) SetWorkspaceWillDeleteFilesHandler(handler WorkspaceWillDeleteFilesHandlerFunc)
SetWorkspaceWillDeleteFilesHandler sets the handler for the `workspace/willDeleteFiles` request.
func (*Handler) SetWorkspaceWillRenameFilesHandler ¶
func (h *Handler) SetWorkspaceWillRenameFilesHandler(handler WorkspaceWillRenameFilesHandlerFunc)
SetWorkspaceWillRenameFilesHandler sets the handler for the `workspace/willRenameFiles` request.
type HandlerOption ¶
type HandlerOption func(*Handler)
HandlerOption is a function that can be used to configure a handler with options such as message handlers.
func WithCallHierarchyIncomingCallsHandler ¶
func WithCallHierarchyIncomingCallsHandler(handler CallHierarchyIncomingCallsHandlerFunc) HandlerOption
WithCallHierarchyIncomingCallsHandler sets the handler for the `textDocument/incomingCalls` request.
func WithCallHierarchyOutgoingCallsHandler ¶
func WithCallHierarchyOutgoingCallsHandler(handler CallHierarchyOutgoingCallsHandlerFunc) HandlerOption
WithCallHierarchyOutgoingCallsHandler sets the handler for the `textDocument/outgoingCalls` request.
func WithCancelRequestHandler ¶
func WithCancelRequestHandler(handler CancelRequestHandlerFunc) HandlerOption
WithCancelRequestHandler sets the handler for the `$/cancelRequest` notification.
func WithCodeActionHandler ¶
func WithCodeActionHandler(handler CodeActionHandlerFunc) HandlerOption
WithCodeActionHandler sets the handler for the `textDocument/codeAction` request.
func WithCodeActionResolveHandler ¶
func WithCodeActionResolveHandler(handler CodeActionResolveHandlerFunc) HandlerOption
WithCodeActionResolveHandler sets the handler for the `codeAction/resolve` request.
func WithCodeLensHandler ¶
func WithCodeLensHandler(handler CodeLensHandlerFunc) HandlerOption
WithCodeLensHandler sets the handler for the `textDocument/codeLens` request.
func WithCodeLensResolveHandler ¶
func WithCodeLensResolveHandler(handler CodeLensResolveHandlerFunc) HandlerOption
WithCodeLensResolveHandler sets the handler for the `codeLens/resolve` request.
func WithCompletionHandler ¶
func WithCompletionHandler(handler CompletionHandlerFunc) HandlerOption
WithCompletionHandler sets teh handler for the `textDocument/completion` request.
func WithCompletionItemResolveHandler ¶
func WithCompletionItemResolveHandler(handler CompletionItemResolveHandlerFunc) HandlerOption
WithCompletionItemResolveHandler sets the handler for the `completionItem/resolve` request.
func WithDocumentColorHandler ¶
func WithDocumentColorHandler(handler DocumentColorHandlerFunc) HandlerOption
WithDocumentColorHandler sets the handler for the `textDocument/documentColor` request.
func WithDocumentColorPresentationHandler ¶
func WithDocumentColorPresentationHandler(handler DocumentColorPresentationHandlerFunc) HandlerOption
WithDocumentColorPresentationHandler sets the handler for the `textDocument/colorPresentation` request.
func WithDocumentDiagnosticsHandler ¶
func WithDocumentDiagnosticsHandler(handler DocumentDiagnosticHandlerFunc) HandlerOption
WithDocumentDiagnosticsHandler sets the handler for the `textDocument/diagnostics` request.
func WithDocumentFormattingHandler ¶
func WithDocumentFormattingHandler(handler DocumentFormattingHandlerFunc) HandlerOption
WithDocumentFormattingHandler sets the handler for the `textDocument/formatting` request.
func WithDocumentHighlightHandler ¶
func WithDocumentHighlightHandler(handler DocumentHighlightHandlerFunc) HandlerOption
WithDocumentHighlightHandler sets the handler for the `textDocument/documentHighlight` request.
func WithDocumentLinkHandler ¶
func WithDocumentLinkHandler(handler DocumentLinkHandlerFunc) HandlerOption
WithDocumentLinkHandler sets the handler for the `textDocument/documentLink` request.
func WithDocumentLinkResolveHandler ¶
func WithDocumentLinkResolveHandler(handler DocumentLinkResolveHandlerFunc) HandlerOption
WithDocumentLinkResolveHandler sets the handler for the `documentLink/resolve` request.
func WithDocumentLinkedEditingRangeHandler ¶
func WithDocumentLinkedEditingRangeHandler(handler DocumentLinkedEditingRangeHandlerFunc) HandlerOption
WithDocumentLinkedEditingRangeHandler sets the handler for the `textDocument/linkedEditingRange` request.
func WithDocumentOnTypeFormattingHandler ¶
func WithDocumentOnTypeFormattingHandler(handler DocumentOnTypeFormattingHandlerFunc) HandlerOption
WithDocumentOnTypeFormattingHandler sets the handler for the `textDocument/onTypeFormatting` request.
func WithDocumentPrepareRenameHandler ¶
func WithDocumentPrepareRenameHandler(handler DocumentPrepareRenameHandlerFunc) HandlerOption
WithDocumentPrepareRenameHandler sets the handler for the `textDocument/prepareRename` request.
func WithDocumentRangeFormattingHandler ¶
func WithDocumentRangeFormattingHandler(handler DocumentRangeFormattingHandlerFunc) HandlerOption
WithDocumentRangeFormattingHandler sets the handler for the `textDocument/rangeFormatting` request.
func WithDocumentRenameHandler ¶
func WithDocumentRenameHandler(handler DocumentRenameHandlerFunc) HandlerOption
WithDocumentRenameHandler sets the handler for the `textDocument/rename` request.
func WithDocumentSymbolHandler ¶
func WithDocumentSymbolHandler(handler DocumentSymbolHandlerFunc) HandlerOption
WithDocumentSymbolHandler sets the handler for the `textDocument/documentSymbol` request.
func WithExitHandler ¶
func WithExitHandler(handler ExitHandlerFunc) HandlerOption
WithExitHandler sets the handler for the `exit` notification.
func WithFindReferencesHandler ¶
func WithFindReferencesHandler(handler FindReferencesHandlerFunc) HandlerOption
WithFindReferencesHandler sets the handler for the `textDocument/references` request.
func WithFoldingRangeHandler ¶
func WithFoldingRangeHandler(handler FoldingRangeHandlerFunc) HandlerOption
WithFoldingRangeHandler sets the handler for the `textDocument/foldingRange` request.
func WithGotoDeclarationHandler ¶
func WithGotoDeclarationHandler(handler GotoDeclarationHandlerFunc) HandlerOption
WithGotoDeclarationHandler sets the handler for the `textDocument/declaration` request.
func WithGotoDefinitionHandler ¶
func WithGotoDefinitionHandler(handler GotoDefinitionHandlerFunc) HandlerOption
WithGotoDefinitionHandler sets the handler for the `textDocument/definition` request.
func WithGotoImplementationHandler ¶
func WithGotoImplementationHandler(handler GotoImplementationHandlerFunc) HandlerOption
WithGotoImplementationHandler sets the handler for the `textDocument/implementation` request.
func WithGotoTypeDefinitionHandler ¶
func WithGotoTypeDefinitionHandler(handler GotoTypeDefinitionHandlerFunc) HandlerOption
WithGotoTypeDefinitionHandler sets the handler for the `textDocument/typeDefinition` request.
func WithHoverHandler ¶
func WithHoverHandler(handler HoverHandlerFunc) HandlerOption
WithHoverHandler sets the handler for the `textDocument/hover` request.
func WithInitializeHandler ¶
func WithInitializeHandler(handler InitializeHandlerFunc) HandlerOption
WithInitializeHandler sets the handler for the `initialize` request.
func WithInitializedHandler ¶
func WithInitializedHandler(handler InitializedHandlerFunc) HandlerOption
WithInitializedHandler sets the handler for the `initialized` notification.
func WithInlayHintHandler ¶
func WithInlayHintHandler(handler InlayHintHandlerFunc) HandlerOption
WithInlayHintHandler sets the handler for the `textDocument/inlayHint` request.
func WithInlayHintResolveHandler ¶
func WithInlayHintResolveHandler(handler InlayHintResolveHandlerFunc) HandlerOption
WithInlayHintResolveHandler sets the handler for the `inlayHint/resolve` request.
func WithInlineValueHandler ¶
func WithInlineValueHandler(handler InlineValueHandlerFunc) HandlerOption
WithInlineValueHandler sets the handler for the `inlineValue` request.
func WithMonikerHandler ¶
func WithMonikerHandler(handler MonikerHandlerFunc) HandlerOption
WithMonikerHandler sets the handler for the `textDocument/moniker` request.
func WithNotebookDocumentDidChangeHandler ¶
func WithNotebookDocumentDidChangeHandler(handler NotebookDocumentDidChangeHandlerFunc) HandlerOption
WithNotebookDocumentDidChangeHandler sets the handler for the `notebookDocument/didChange` notification.
func WithNotebookDocumentDidCloseHandler ¶
func WithNotebookDocumentDidCloseHandler(handler NotebookDocumentDidCloseHandlerFunc) HandlerOption
WithNotebookDocumentDidCloseHandler sets the handler for the `notebookDocument/didClose` notification.
func WithNotebookDocumentDidOpenHandler ¶
func WithNotebookDocumentDidOpenHandler(handler NotebookDocumentDidOpenHandlerFunc) HandlerOption
WithNotebookDocumentDidOpenHandler sets the handler for the `notebookDocument/didOpen` notification.
func WithNotebookDocumentDidSaveHandler ¶
func WithNotebookDocumentDidSaveHandler(handler NotebookDocumentDidSaveHandlerFunc) HandlerOption
WithNotebookDocumentDidSaveHandler sets the handler for the `notebookDocument/didSave` notification.
func WithPrepareCallHierarchyHandler ¶
func WithPrepareCallHierarchyHandler(handler PrepareCallHierarchyHandlerFunc) HandlerOption
WithPrepareCallHierarchyHandler sets the handler for the `textDocument/prepareCallHierarchy` request.
func WithPrepareTypeHierarchyHandler ¶
func WithPrepareTypeHierarchyHandler(handler PrepareTypeHierarchyHandlerFunc) HandlerOption
WithPrepareTypeHierarchyHandler sets the handler for the `textDocument/prepareTypeHierarchy` request.
func WithProgressHandler ¶
func WithProgressHandler(handler ProgressHandlerFunc) HandlerOption
WithProgressHandler sets the handler for the `$/progress` notification.
func WithSelectionRangeHandler ¶
func WithSelectionRangeHandler(handler SelectionRangeHandlerFunc) HandlerOption
WithSelectionRangeHandler sets the handler for the `textDocument/selectionRange` request.
func WithSemanticTokensFullDeltaHandler ¶
func WithSemanticTokensFullDeltaHandler(handler SemanticTokensFullDeltaHandlerFunc) HandlerOption
WithSemanticTokensFullDeltaHandler sets the handler for the `textDocument/semanticTokens/full/delta` request.
func WithSemanticTokensFullHandler ¶
func WithSemanticTokensFullHandler(handler SemanticTokensFullHandlerFunc) HandlerOption
WithSemanticTokensFullHandler sets the handler for the `textDocument/semanticTokens/full` request.
func WithSemanticTokensRangeHandler ¶
func WithSemanticTokensRangeHandler(handler SemanticTokensRangeHandlerFunc) HandlerOption
WithSemanticTokensRangeHandler sets the handler for the `textDocument/semanticTokens/range` request.
func WithSetTraceHandler ¶
func WithSetTraceHandler(handler SetTraceHandlerFunc) HandlerOption
WithSetTraceHandler sets the handler for the `$/setTrace` notification.
func WithShutdownHandler ¶
func WithShutdownHandler(handler ShutdownHandlerFunc) HandlerOption
WithShutdownHandler sets the handler for the `shutdown` request.
func WithSignatureHelpHandler ¶
func WithSignatureHelpHandler(handler SignatureHelpHandlerFunc) HandlerOption
WithSignatureHelpHandler sets the handler for the `textDocument/signatureHelp` request.
func WithTextDocumentDidChangeHandler ¶
func WithTextDocumentDidChangeHandler(handler TextDocumentDidChangeHandlerFunc) HandlerOption
WithTextDocumentDidChangeHandler sets the handler for the `textDocument/didChange` notification.
func WithTextDocumentDidCloseHandler ¶
func WithTextDocumentDidCloseHandler(handler TextDocumentDidCloseHandlerFunc) HandlerOption
WithTextDocumentDidCloseHandler sets the handler for the `textDocument/didClose` notification.
func WithTextDocumentDidOpenHandler ¶
func WithTextDocumentDidOpenHandler(handler TextDocumentDidOpenHandlerFunc) HandlerOption
WithTextDocumentDidOpenHandler sets the handler for the `textDocument/didOpen` notification.
func WithTextDocumentDidSaveHandler ¶
func WithTextDocumentDidSaveHandler(handler TextDocumentDidSaveHandlerFunc) HandlerOption
WithTextDocumentDidSaveHandler sets the handler for the `textDocument/didSave` notification.
func WithTextDocumentWillSaveHandler ¶
func WithTextDocumentWillSaveHandler(handler TextDocumentWillSaveHandlerFunc) HandlerOption
WithTextDocumentWillSaveHandler sets the handler for the `textDocument/willSave` notification.
func WithTextDocumentWillSaveWaitUntilHandler ¶
func WithTextDocumentWillSaveWaitUntilHandler(handler TextDocumentWillSaveWaitUntilHandlerFunc) HandlerOption
WithTextDocumentWillSaveWaitUntilHandler sets the handler for the `textDocument/willSaveWaitUntil` request.
func WithTypeHierarchySubtypesHandler ¶
func WithTypeHierarchySubtypesHandler(handler TypeHierarchySubtypesHandlerFunc) HandlerOption
WithTypeHierarchySubtypesHandler sets the handler for the `typeHierarchy/subtypes` request.
func WithTypeHierarchySupertypesHandler ¶
func WithTypeHierarchySupertypesHandler(handler TypeHierarchySupertypesHandlerFunc) HandlerOption
WithTypeHierarchySupertypesHandler sets the handler for the `typeHierarchy/supertypes` request.
func WithWindowWorkDoneProgressCancelHandler ¶
func WithWindowWorkDoneProgressCancelHandler(handler WindowWorkDoneProgressCancelHandler) HandlerOption
WithWindowWorkDoneProgressCancelHandler sets the handler for the `window/workDoneProgress/cancel` notification.
func WithWorkspaceDiagnosticHandler ¶
func WithWorkspaceDiagnosticHandler(handler WorkspaceDiagnosticHandlerFunc) HandlerOption
WithWorkspaceDiagnosticHandler sets the handler for the `workspace/diagnostics` request.
func WithWorkspaceDidChangeConfigurationHandler ¶
func WithWorkspaceDidChangeConfigurationHandler(handler WorkspaceDidChangeConfigurationHandlerFunc) HandlerOption
WithWorkspaceDidChangeConfigurationHandler sets the handler for the `workspace/didChangeConfiguration` notification.
func WithWorkspaceDidChangeFoldersHandler ¶
func WithWorkspaceDidChangeFoldersHandler(handler WorkspaceDidChangeFoldersHandlerFunc) HandlerOption
WithWorkspaceDidChangeFoldersHandler sets the handler for the `workspace/didChangeWorkspaceFolders` notification.
func WithWorkspaceDidChangeWatchedFilesHandler ¶
func WithWorkspaceDidChangeWatchedFilesHandler(handler WorkspaceDidChangeWatchedFilesHandlerFunc) HandlerOption
WithWorkspaceDidChangeWatchedFilesHandler sets the handler for the `workspace/didChangeWatchedFiles` notification.
func WithWorkspaceDidCreateFilesHandler ¶
func WithWorkspaceDidCreateFilesHandler(handler WorkspaceDidCreateFilesHandlerFunc) HandlerOption
WithWorkspaceDidCreateFilesHandler sets the handler for the `workspace/didCreateFiles` notification.
func WithWorkspaceDidDeleteFilesHandler ¶
func WithWorkspaceDidDeleteFilesHandler(handler WorkspaceDidDeleteFilesHandlerFunc) HandlerOption
WithWorkspaceDidDeleteFilesHandler sets the handler for the `workspace/didDeleteFiles` notification.
func WithWorkspaceDidRenameFilesHandler ¶
func WithWorkspaceDidRenameFilesHandler(handler WorkspaceDidRenameFilesHandlerFunc) HandlerOption
WithWorkspaceDidRenameFilesHandler sets the handler for the `workspace/didRenameFiles` notification.
func WithWorkspaceExecuteCommandHandler ¶
func WithWorkspaceExecuteCommandHandler(handler WorkspaceExecuteCommandHandlerFunc) HandlerOption
WithWorkspaceExecuteCommandHandler sets the handler for the `workspace/executeCommand` request.
func WithWorkspaceSymbolHandler ¶
func WithWorkspaceSymbolHandler(handler WorkspaceSymbolHandlerFunc) HandlerOption
WithWorkspaceSymbolHandler sets the handler for the `workspace/symbol` request.
func WithWorkspaceSymbolResolveHandler ¶
func WithWorkspaceSymbolResolveHandler(handler WorkspaceSymbolResolveHandlerFunc) HandlerOption
WithWorkspaceSymbolResolveHandler sets the handler for the `workspaceSymbol/resolve` request.
func WithWorkspaceWillCreateFilesHandler ¶
func WithWorkspaceWillCreateFilesHandler(handler WorkspaceWillCreateFilesHandlerFunc) HandlerOption
WithWorkspaceWillCreateFilesHandler sets the handler for the `workspace/willCreateFiles` request.
func WithWorkspaceWillDeleteFilesHandler ¶
func WithWorkspaceWillDeleteFilesHandler(handler WorkspaceWillDeleteFilesHandlerFunc) HandlerOption
WithWorkspaceWillDeleteFilesHandler sets the handler for the `workspace/willDeleteFiles` request.
func WithWorkspaceWillRenameFilesHandler ¶
func WithWorkspaceWillRenameFilesHandler(handler WorkspaceWillRenameFilesHandlerFunc) HandlerOption
WithWorkspaceWillRenameFilesHandler sets the handler for the `workspace/willRenameFiles` request.
type Hover ¶
type Hover struct {
// The hover's content.
//
// MarkedString | []MarkedString | MarkupContent
Contents any `json:"contents"`
// An optional range is a range inside a text document
// that is used to visualize a hover, e.g. by changing
// the background color.
Range *Range `json:"range,omitempty"`
}
Hover represents the result of a hover request.
func (*Hover) UnmarshalJSON ¶
Fulfils the json.Unmarshaler interface.
type HoverClientCapabilities ¶
type HoverClientCapabilities struct {
// Whether hover supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
HoverClientCapabilities describes the capabilities of a client for hover requests.
type HoverHandlerFunc ¶
type HoverHandlerFunc func( ctx *common.LSPContext, params *HoverParams, ) (*Hover, error)
HoverHandlerFunc is the function signature for the textDocument/hover request handler that can be registered for a language server.
type HoverOptions ¶
type HoverOptions struct {
WorkDoneProgressOptions
}
HoverOptions provides server capability options for hover requests.
type HoverParams ¶
type HoverParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
HoverParams contains the textDocument/hover request parameters.
type ImplementationClientCapabilities ¶
type ImplementationClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `ImplementationRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
//
// @since 3.14.0
LinkSupport *bool `json:"linkSupport,omitempty"`
}
ImplementationClientCapabilities describes the capabilities of a client for goto implementation requests.
type ImplementationOptions ¶
type ImplementationOptions struct {
WorkDoneProgressOptions
}
ImplementationOptions provides server capability options for goto implementation requests.
type ImplementationParams ¶
type ImplementationParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
ImplementationParams contains the textDocument/implementation request parameters.
type ImplementationRegistrationOptions ¶
type ImplementationRegistrationOptions struct {
ImplementationOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
ImplementationRegistrationOptions provides server capability registration options for goto implementation requests.
type InitializeClientInfo ¶
type InitializeClientInfo struct {
// The name of the client as defined by the client.
Name string `json:"name"`
// The client's version as defined by the client.
Version string `json:"version,omitempty"`
}
InitializeClientInfo represents information about the client.
type InitializeError ¶
type InitializeError struct {
// Indicates whether the client execute the following retry logic:
// (1) show the message provided by the ResponseError to the user
// (2) user selects retry or cancel
// (3) if user selected retry the initialize method is sent again.
Retry bool `json:"retry"`
}
InitializeError represents an error that occurred during the initialize request.
type InitializeErrorCode ¶
type InitializeErrorCode Integer
Known error codes for an `InitializeError`;
type InitializeHandlerFunc ¶
type InitializeHandlerFunc func(ctx *common.LSPContext, params *InitializeParams) (any, error)
InitializeHandlerFunc is the function signature for the initialize request handler that can be registered for a language server.
type InitializeParams ¶
type InitializeParams struct {
WorkDoneProgressParams
// The process ID of the parent process that started the server.
// Is null if the process has not been started by another process.
// If the parent process is not alive then the server should exit
// (see exit notification) its process.
ProcessID *Integer `json:"processId"`
// Information about the client.
//
// @since 3.15.0
ClientInfo *InitializeClientInfo `json:"clientInfo,omitempty"`
// The locale that the client is currently showing the
// user interface in. This must not necessarily be the
// locale of the operating system.
//
// Uses IETF language tags as the value's syntax
// (See https://en.wikipedia.org/wiki/IETF_language_tag)
//
// @since 3.16.0
Locale *string `json:"locale,omitempty"`
// The rootPath of the workspace. Is null
// if no folder is open.
//
// @deprecated in favour of `rootUri`.
RootPath *string `json:"rootPath,omitempty"`
// The rootUri of the workspace. Is null if no
// folder is open. If both `rootPath` and `rootUri` are set
// `rootUri` wins.
//
// @deprecated in favour of `workspaceFolders`
RootURI *DocumentURI `json:"rootUri"`
// User provided initialization options.
InitializationOptions LSPAny `json:"initializationOptions,omitempty"`
// The capabilities provided by the client (editor or tool)
Capabilities ClientCapabilities `json:"capabilities"`
// The initial trace setting. If omitted trace is disabled ('off').
Trace *TraceValue `json:"trace,omitempty"`
// The workspace folders configured in the client when the server starts.
// This property is only available if the client supports workspace folders.
// It can be `null` if the client supports workspace folders but none are
// configured.
//
// @since 3.6.0
WorkspaceFolders []WorkspaceFolder `json:"workspaceFolders,omitempty"`
}
InitializeParams contains the initialize request parameters.
type InitializeResult ¶
type InitializeResult struct {
// The capabilities the language server provides.
Capabilities ServerCapabilities `json:"capabilities"`
// Information about the server.
//
// @since 3.15.0
ServerInfo *InitializeResultServerInfo `json:"serverInfo,omitempty"`
}
InitializeResult represents the result of the initialize request.
type InitializeResultServerInfo ¶
type InitializeResultServerInfo struct {
// The name of the server as defined by the server.
Name string `json:"name"`
// The server's version as defined by the server.
Version *string `json:"version,omitempty"`
}
InitializeResultServerInfo represents information about the server.
type InitializedHandlerFunc ¶
type InitializedHandlerFunc func(ctx *common.LSPContext, params *InitializedParams) error
InitializedHandlerFunc is the function signature for the initialized notification handler that can be registered for a language server.
type InitializedParams ¶
type InitializedParams struct{}
InitializedParams contains the initialized notification parameters. With this version of the protocol, this is an empty struct.
type InlayHint ¶
type InlayHint struct {
// The position of this hint.
//
// If multiple hints have the same position, they will be shown in the order
// they appear in the response.
Position Position `json:"position"`
// The label of this hint. A human readable string or an array of
// InlayHintLabelPart label parts.
//
// *Note* that neither the string nor the label part can be empty.
//
// string | []*InlayHintLabelPart
Label any `json:"label"`
// The kind of this hint. Can be omitted in which case the client
// should fall back to a reasonable default.
Kind *InlayHintKind `json:"kind,omitempty"`
// Optional text edits that are performed when accepting this inlay hint.
//
// *Note* that edits are expected to change the document so that the inlay
// hint (or its nearest variant) is now part of the document and the inlay
// hint itself is now obsolete.
//
// Depending on the client capability `inlayHint.resolveSupport` clients
// might resolve this property late using the resolve request.
TextEdits []TextEdit `json:"textEdits,omitempty"`
// The tooltip text when you hover over this item.
//
// Depending on the client capability `inlayHint.resolveSupport` clients
// might resolve this property late using the resolve request.
//
// string | MarkupContent | nil
Tooltip any `json:"tooltip,omitempty"`
// Render padding before the hint.
//
// Note: Padding should use the editor's background color, not the
// background color of the hint itself. That means padding can be used
// to visually align/separate an inlay hint.
PaddingLeft *bool `json:"paddingLeft,omitempty"`
// Render padding after the hint.
//
// Note: Padding should use the editor's background color, not the
// background color of the hint itself. That means padding can be used
// to visually align/separate an inlay hint.
PaddingRight *bool `json:"paddingRight,omitempty"`
// A data entry field that is preserved on an inlay hint between
// a `textDocument/inlayHint` and a `inlayHint/resolve` request.
Data LSPAny `json:"data,omitempty"`
}
InlayHint holds inlay hint information.
@since 3.17.0
func (*InlayHint) UnmarshalJSON ¶
Fulfils the json.Unmarshaler interface.
type InlayHintClientCapabilities ¶
type InlayHintClientCapabilities struct {
// Whether inlay hints support dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Indicates which properties a client can resolve lazily on an inlay
// hint.
ResolveSupport *InlayHintResolveSupport `json:"resolveSupport,omitempty"`
}
InlayHintClientCapabilities describes the capabilities of a client for inlay hint requests.
type InlayHintHandlerFunc ¶
type InlayHintHandlerFunc func( ctx *common.LSPContext, params *InlayHintParams, ) ([]*InlayHint, error)
InlayHintHandlerFunc is the function signature for the textDocument/inlayHint request handler that can be registered for a language server.
type InlayHintKind ¶
type InlayHintKind = UInteger
InlayHintKind is a kind of inlay hint.
@since 3.17.0
var ( // InlayHintKindType is an inlay hint // for a type annotation. InlayHintKindType InlayHintKind = 1 // InlayHintKindParameter is an inlay hint // for a parameter annotation. InlayHintKindParameter InlayHintKind = 2 )
type InlayHintLabelPart ¶
type InlayHintLabelPart struct {
// The value of this label part.
Value string `json:"value"`
// The tooltip text when you hover over this label part. Depending on
// the client capability `inlayHint.resolveSupport` clients might resolve
// this property late using the resolve request.
//
// string | MarkupContent | nil
Tooltip any `json:"tooltip,omitempty"`
// An optional source code location that represents this
// label part.
//
// The editor will use this location for the hover and for code navigation
// features: This part will become a clickable link that resolves to the
// definition of the symbol at the given location (not necessarily the
// location itself), it shows the hover that shows at the given location,
// and it shows a context menu with further code navigation commands.
//
// Depending on the client capability `inlayHint.resolveSupport` clients
// might resolve this property late using the resolve request.
Location *Location `json:"location,omitempty"`
// An optional command for this label part.
//
// Depending on the client capability `inlayHint.resolveSupport` clients
// might resolve this property late using the resolve request.
Command *Command `json:"command,omitempty"`
}
InlayHintLabelPart represents a part of a label in an inlay hint. An inlay hint label part allows for interactive and composite labels of inlay hints.
@since 3.17.0
func (*InlayHintLabelPart) UnmarshalJSON ¶
func (lp *InlayHintLabelPart) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type InlayHintOptions ¶
type InlayHintOptions struct {
WorkDoneProgressOptions
// The server provides support to resolve additional
// information for an inlay hint item.
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
InlayHintOptions provides server capability options for inline value requests.
@since 3.17.0
type InlayHintParams ¶
type InlayHintParams struct {
WorkDoneProgressParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The visible document range for which inlay hints should be computed.
Range Range `json:"range"`
}
InlayHintParams contains the textDocument/inlayHint request parameters. A parameter literal used in inlay hints requests.
@since 3.17.0
type InlayHintRegistrationOptions ¶
type InlayHintRegistrationOptions struct {
InlayHintOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
InlayHintRegistrationOptions provides server capability registration options for inline value requests.
@since 3.17.0
type InlayHintResolveHandlerFunc ¶
type InlayHintResolveHandlerFunc func( ctx *common.LSPContext, params *InlayHint, ) (*InlayHint, error)
InlayHintResolveHandlerFunc is the function signature for the inlayHint/resolve request handler that can be registered for a language server.
type InlayHintResolveSupport ¶
type InlayHintResolveSupport struct {
// The properties that a client can resolve lazily.
Properties []string `json:"properties"`
}
InlayHintResolveSupport describes the capabilities of a client for resolving inlay hints lazily.
type InlayHintWorkspaceClientCapabilities ¶
type InlayHintWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from
// the server to the client.
//
// Note that this event is global and will force the client to refresh all
// inlay hints currently shown. It should be used with absolute care and
// is useful for situation where a server for example detects a project wide
// change that requires such a calculation.
RefreshSupport *bool `json:"refreshSupport,omitempty"`
}
InlayHintWorkspaceClientCapabilities describes the capabilities of a client for inlay hints in workspaces.
@since 3.17.0
type InlineValue ¶
type InlineValue struct {
InlineValueText *InlineValueText `json:"inlineValueText,omitempty"`
InlineValueVariableLookup *InlineValueVariableLookup `json:"inlineValueVariableLookup,omitempty"`
InlineValueEvaluatable *InlineValueEvaluatableExpression `json:"inlineValueEvaluatable,omitempty"`
}
Inline value information can be provided by different means: - directly as a text value (class InlineValueText). - as a name to use for a variable lookup (class InlineValueVariableLookup) - as an evaluatable expression (class InlineValueEvaluatableExpression) The InlineValue types combines all inline value types into one type.
@since 3.17.0
func (*InlineValue) MarshalJSON ¶
func (iv *InlineValue) MarshalJSON() ([]byte, error)
Fulfils the json.Marshaler interface.
func (*InlineValue) UnmarshalJSON ¶
func (iv *InlineValue) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type InlineValueClientCapabilities ¶
type InlineValueClientCapabilities struct {
// Whether implementation supports dynamic registration for inline
// value providers.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
InlineValueClientCapabilities describes the capabilities of a client for inline value requests.
type InlineValueContext ¶
type InlineValueContext struct {
// The stack frame (as a DAP Id) where the execution has stopped.
FrameID Integer `json:"frameId,omitempty"`
// The document range where execution has stopped.
// Typically the end position of the range denotes the line where the
// inline values are shown.
StoppedLocation Range `json:"stoppedLocation"`
}
InlineValueContext provides additional information about the context in which inline values were requested.
@since 3.17.0
type InlineValueEvaluatableExpression ¶
type InlineValueEvaluatableExpression struct {
// The document range for which the inline value applies.
// The range is used to extract the evaluatable expression from the
// underlying document.
Range Range `json:"range"`
// If specified, the expression overrides the extracted expression.
Expression *string `json:"expression,omitempty"`
}
InlineValueEvaluatableExpression provides inline value as an evaluatable expression.
If only a range is specified, the expression will be extracted from the underlying document.
An optional expression can be used to override the extracted expression.
@since 3.17.0
type InlineValueHandlerFunc ¶
type InlineValueHandlerFunc func( ctx *common.LSPContext, params *InlineValueParams, ) ([]*InlineValue, error)
InlineValueHandlerFunc is the function signature for the textDocument/inlineValue request handler that can be registered for a language server.
Inline value information can be provided by different means: - directly as a text value (class InlineValueText). - as a name to use for a variable lookup (class InlineValueVariableLookup) - as an evaluatable expression (class InlineValueEvaluatableExpression) The InlineValue types combines all inline value types into one type.
@since 3.17.0
type InlineValueOptions ¶
type InlineValueOptions struct {
WorkDoneProgressOptions
}
InlineValueOptions provides server capability options for inline value requests.
@since 3.17.0
type InlineValueParams ¶
type InlineValueParams struct {
WorkDoneProgressParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The document range for which inline values should be computed.
Range Range `json:"range"`
// Additional information about the context in which inline values were
// requested.
Context InlineValueContext `json:"context"`
}
InlineValueParams contains the textDocument/inlineValue request parameters.
@since 3.17.0
type InlineValueRegistrationOptions ¶
type InlineValueRegistrationOptions struct {
InlineValueOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
InlineValueRegistrationOptions provides server capability registration options for inline value requests.
@since 3.17.0
type InlineValueText ¶
type InlineValueText struct {
// The document range for which the inline value applies.
Range Range `json:"range"`
// The text of the inline value.
Text string `json:"text"`
}
InlineValueText provides inline value as text.
@since 3.17.0
type InlineValueVariableLookup ¶
type InlineValueVariableLookup struct {
// The document range for which the inline value applies.
// The range is used to extract the variable name from the underlying
// document.
Range Range `json:"range"`
// If specified, the name of the variable to lookup.
VariableName *string `json:"variableName,omitempty"`
// How to perform the lookup.
CaseSensitiveLookup bool `json:"caseSensitiveLookup"`
}
InlineValueVariableLookup provides inline value as a variable lookup.
If only a range is specified, the variable name will be extracted from the underlying document.
An optional variable name can be used to override the extracted name.
@since 3.17.0
type InlineValueWorkspaceClientCapabilities ¶
type InlineValueWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from
// the server to the client.
//
// Note that this event is global and will force the client to refresh all
// inline values currently shown. It should be used with absolute care and
// is useful for situation where a server for example detect a project wide
// change that requires such a calculation.
RefreshSupport *bool `json:"refreshSupport,omitempty"`
}
InlineValueWorkspaceClientCapabilities describes the capabilities of a client specific to inline values.
@since 3.17.0
type InsertReplaceEdit ¶
type InsertReplaceEdit struct {
// The string to be inserted.
NewText string `json:"newText"`
// The range if the insert is requested.
Insert *Range `json:"insert"`
// The range if the replace is requested.
Replace *Range `json:"replace"`
}
InsertReplaceEdit is a special text edit to provide an insert and a replace operation.
@since 3.16.0
type InsertReplaceRange ¶
InsertReplaceRange contains both insert and replace ranges for an edit.
type InsertTextFormat ¶
type InsertTextFormat = Integer
InsertTextFormat defins whether the insert text in a completion item should be interpreted as plain text or a snippet.
var ( // InsertTextFormatPlainText means the primary text // to be inserted is treated as a plain string. InsertTextFormatPlainText InsertTextFormat = 1 // InsertTextFormatSnippet means the primary text // to be instered is to be treated as a snippet. // // A snippet can define tab stops and placeholders with `$1`, `$2` // and `${3:foo}`. `$0` defines the final tab stop, it defaults to // the end of the snippet. Placeholders with equal identifiers are linked, // that is typing in one will update others too. InsertTextFormatSnippet InsertTextFormat = 2 )
type InsertTextMode ¶
type InsertTextMode = Integer
InsertTextMode determines how whitespace and indentations are handled during completion item insertion.
@since 3.16.0
var ( // InsertTextModeAsIs means the insertion or replace strings are taken as // they are. // If the // value is multi line the lines below the cursor will be // inserted using the indentation defined in the string value. // The client will not apply any kind of adjustments to the // string. InsertTextModeAsIs InsertTextMode = 1 // InsertTextModeAdjustIndentation means the editor adjusts leading // whitespace of new lines so that they match the indentation up to the // cursor of the line for which the item is accepted. // // Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a // multi line completion item is indented using 2 tabs and all // following lines inserted will be indented using 2 tabs as well. InsertTextModeAdjustIndentation InsertTextMode = 2 )
type IntOrString ¶
IntOrString represents a value that can be either an integer or string in LSP messages. integer | string (used in Diagnostic for example)
func (*IntOrString) MarshalJSON ¶
func (i *IntOrString) MarshalJSON() ([]byte, error)
Fulfils the json.Marshaler interface.
func (*IntOrString) UnmarshalJSON ¶
func (i *IntOrString) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type LSPAny ¶
type LSPAny = interface{}
LSPAny is the LSP "any" type @since 3.17.0
At runtime, type assertions are used to determine the actual set of allowed types. (LSPObject | LSPArray | string | integer | uinteger | decimal | boolean | null)
type LinkedEditingRangeClientCapabilities ¶
type LinkedEditingRangeClientCapabilities struct {
// Whether the implementation supports dynamic registration.
// If this is set to `true` the client supports the new
// `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
LinkedEditingRangeClientCapabilities describes the capabilities of a client for linked editing range requests.
type LinkedEditingRangeOptions ¶
type LinkedEditingRangeOptions struct {
WorkDoneProgressOptions
}
LinkedEditingRangeOptions provides server capability options for linked editing range requests.
type LinkedEditingRangeParams ¶
type LinkedEditingRangeParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
LinkedEditingRangeParams contains parameters for the textDocument/linkedEditingRange requests.
type LinkedEditingRangeRegistrationOptions ¶
type LinkedEditingRangeRegistrationOptions struct {
LinkedEditingRangeOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
LinkedEditingRangeRegistrationOptions provides server capability registration options for linked editing range requests.
type LinkedEditingRanges ¶
type LinkedEditingRanges struct {
// A list of ranges that can be renamed together. The ranges must have
// identical length and contain identical text content. The ranges cannot
// overlap.
Ranges []Range `json:"ranges"`
// An optional word pattern (regular expression) that describes valid
// contents for the given ranges. If no pattern is provided, the client
// configuration's word pattern will be used.
WordPattern *string `json:"wordPattern,omitempty"`
}
LinkedEditingRanges contains the response data type for a textDocument/linkedEditingRange request.
type Location ¶
type Location struct {
// The URI of the document.
URI DocumentURI `json:"uri"`
// The range in the document.
Range *Range `json:"range"`
}
Location represents a location inside a resource, such as a line inside a text file.
type LocationLink ¶
type LocationLink struct {
// Span of the origin of this link.
// Used as the underlined span for mouse interaction.
// Defaults to the word range at the mouse position.
OriginSelectionRange *Range `json:"originSelectionRange,omitempty"`
// The target resource identifier of this link.
TargetURI DocumentURI `json:"targetUri"`
// The full target range of this link. If the target for example is a symbol then target range is the
// range enclosing this symbol not including leading/trailing whitespace but everything else
// like comments. This information is typically used to highlight the range in the editor.
TargetRange Range `json:"targetRange"`
// The range that should be selected and revealed when this link is
// being followed, e.g the name of a function.
// Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
TargetSelectionRange Range `json:"targetSelectionRange"`
}
LocationLink represents a link between a source and a target location.
type LogMessageParams ¶
type LogMessageParams struct {
// The message type. See {@link MessageType}.
Type MessageType `json:"type"`
// The actual message.
Message string `json:"message"`
}
LogMessageParams represents the parameters of a `window/logMessage` notification.
type LogTraceParams ¶
type LogTraceParams struct {
// The message to be logged.
Message string `json:"message"`
// Additional information that can be computed if the `trace` configuration
// is set to `verbose`.
Verbose *string `json:"verbose,omitempty"`
}
LogTraceParams contains the logTrace notification parameters.
type MarkdownClientCapabilities ¶
type MarkdownClientCapabilities struct {
// The name of the parser.
Parser string `json:"parser"`
// The version of the parser.
Version *string `json:"version,omitempty"`
// A list of HTML tags that the client allows / supports
// in Markdown.
//
// @since 3.17.0
AllowedTags []string `json:"allowedTags,omitempty"`
}
MarkdownClientCapabilities describes the capabilities specific to the used markdown parser.
@since 3.16.0
type MarkedString ¶
type MarkedString struct {
Value any // string | MarkedStringLanguage
}
MarkedString can be used to render human readable text. It is either a markdown string or a code-block that provides a language and a code snippet. The language identifier is semantically equal to the optional language identifier in fenced code blocks in GitHub issues.
The pair of a language and a value is an equivalent to markdown: ```${language} ${value} ```
Note that markdown strings will be sanitized - that means html will be escaped.
@deprecated use MarkupContent instead.
func (MarkedString) MarshalJSON ¶
func (s MarkedString) MarshalJSON() ([]byte, error)
Fulfils the json.Marshaler interface.
func (*MarkedString) UnmarshalJSON ¶
func (s *MarkedString) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type MarkedStringLanguage ¶
MarkedStringLanguage is a pair of a language and a value for a MarkedString.
type MarkupContent ¶
type MarkupContent struct {
// The type of the Markup
Kind MarkupKind `json:"kind"`
// The content itself
Value string `json:"value"`
}
A MarkupContent literal represents a string value which content is interpreted base on its kind flag. Currently the protocol supports `plaintext` and `markdown` as markup kinds.
If the kind is `markdown` then the value can contain fenced code blocks like in GitHub issues.
Here is an example how such a string can be constructed using JavaScript / TypeScript: ```typescript
let markdown: MarkdownContent = {
kind: MarkupKind.Markdown,
value: [
'# Header',
'Some text',
'```typescript',
'someCode();',
'```'
].join('\n')
};
```
*Please Note* that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.
type MarkupKind ¶
type MarkupKind = string
MarkupKind describes the content type that client supports in various result literals like `Hover`, `ParameterInfo` or `CompletionItem`. Please note that `MarkupKinds` must not start with a `$`. These kinds are reserved for internal usage.
const ( // Plain text is supported as a content format MarkupKindPlainText MarkupKind = "plaintext" // Markdown is supported as a content format MarkupKindMarkdown MarkupKind = "markdown" )
type MessageActionItem ¶
type MessageActionItem struct {
// A short title like 'Retry', 'Open Log' etc.
Title string `json:"title"`
}
MessageActionItem represents an additional message action includes in a `window/showMessageRequest` requests.
type MessageActionItemClientCapabilities ¶
type MessageActionItemClientCapabilities struct {
// Whether the client supports additional attributes which
// are preserved and sent back to the server in the
// request's response.
AdditionalPropertiesSupport *bool `json:"additionalPropertiesSupport,omitempty"`
}
MessageActionItemClientCapabilities represents the client capabilities specific to the message action item.
type MessageType ¶
type MessageType = Integer
MessageType defins the type of window message.
const ( // MessageTypeError represents an error message. MessageTypeError MessageType = 1 // MessageTypeWarning represents a warning message. MessageTypeWarning MessageType = 2 // MessageTypeInfo represents an information message. MessageTypeInfo MessageType = 3 // MessageTypeLog represents a log message. MessageTypeLog MessageType = 4 // MessageTypeDebug represents a debug message. // // @since 3.18.0 // @proposed MessageTypeDebug MessageType = 5 )
type Moniker ¶
type Moniker struct {
// The scheme of the moniker, e.g. tsc or .NET
Scheme string `json:"scheme"`
// The identifier of the moniker. The value is opaque in LSIF however
// schema owners are allowed to define the structure if they want.
Identifier string `json:"identifier"`
// The scope in which the moniker is unique.
Unique UniquenessLevel `json:"unique"`
// The moniker kind, if known.
Kind *MonikerKind `json:"kind,omitempty"`
}
Moniker definition to match the LSIF 0.5 moniker definition.
type MonikerClientCapabilities ¶
type MonikerClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `(TextDocumentRegistrationOptions &
// StaticRegistrationOptions)` return value for the corresponding server
// capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
MonikerClientCapabilities describes the capabilities of a client for moniker requests.
type MonikerHandlerFunc ¶
type MonikerHandlerFunc func( ctx *common.LSPContext, params *MonikerParams, ) ([]Moniker, error)
MonikerHandlerFunc is the function signature for the textDocument/moniker request handler that can be registered for a language server.
type MonikerKind ¶
type MonikerKind = string
var ( // The moniker represents a symbol that is imported into a project MonikerKindImport MonikerKind = "import" // The moniker represents a symbol that is exported from a project MonikerKindExport MonikerKind = "export" // The moniker represents a symbol that is local to a project (e.g. a local // variable of a function, a class not visible outside the project, ...) MonikerKindLocal MonikerKind = "local" )
type MonikerOptions ¶
type MonikerOptions struct {
WorkDoneProgressOptions
}
MonikerOptions provides server capability options for moniker requests.
type MonikerParams ¶
type MonikerParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
MonikerParams contains the textDocument/moniker request parameters.
type MonikerRegistrationOptions ¶
type MonikerRegistrationOptions struct {
MonikerOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
MonikerRegistrationOptions provides server capability registration options for moniker requests.
type NotebookCell ¶
type NotebookCell struct {
// The cell's kind.
Kind NotebookCellKind `json:"kind"`
// The URI of the cell's text document content.
Document DocumentURI `json:"document"`
// Additional metadata stored with the notebook cell.
Metadata LSPObject `json:"metadata,omitempty"`
// Additional execution summary information if supported
// by the client.
ExecutionSummary *NotebookCellExecutionSummary `json:"executionSummary,omitempty"`
}
NotebookCell represents a cell in a notebook.
A cell's document URI must be unique across ALL notebook cells and can therefore be used to uniquely identify a notebook cell or the cell's text document.
@since 3.17.0
type NotebookCellArrayChange ¶
type NotebookCellArrayChange struct {
// The start offset of the cell that changed.
Start UInteger `json:"start"`
// The deleted cells.
DeleteCount UInteger `json:"deleteCount"`
// The new cells, if any.
Cells []NotebookCell `json:"cells,omitempty"`
}
NotebookCellArrayChange represents a change describing how to move a `NotebookCell` array from state S to S'.
@since 3.17.0
type NotebookCellChanges ¶
type NotebookCellChanges struct {
// Changes to the cell structure to add or remove cells.
Structure *NotebookCellChangesStructure `json:"structure,omitempty"`
// Changes to notebook cells properties like its kind,
// execution summary or metadata.
Data []NotebookCell `json:"data,omitempty"`
// Changes to the text content of notebook cells.
TextContent []NotebookCellChangesTextContent `json:"textContent,omitempty"`
}
NotebookCellChanges represents changes to notebook cells.
@since 3.17.0
type NotebookCellChangesStructure ¶
type NotebookCellChangesStructure struct {
// The change to the cell array.
Array NotebookCellArrayChange `json:"array"`
// Additional opened cell text documents.
DidOpen []TextDocumentItem `json:"didOpen,omitempty"`
// Additional closed cell text documents.
DidClose []TextDocumentIdentifier `json:"didClose,omitempty"`
}
NotebookCellChangesStructure represents the structure object of a notebook cell changes.
@since 3.17.0
type NotebookCellChangesTextContent ¶
type NotebookCellChangesTextContent struct {
Document VersionedTextDocumentIdentifier `json:"document"`
Changes []TextDocumentContentChangeEvent `json:"changes"`
}
NotebookCellChangesTextContent represents changes to the text content of notebook cells.
@since 3.17.0
type NotebookCellExecutionSummary ¶
type NotebookCellExecutionSummary struct {
// A strict monotonically increasing value
// indicating the execution order of a cell
// inside a notebook.
ExecutionOrder UInteger `json:"executionOrder"`
// Whether the execution was successful or not
// if known by the client.
Success *bool `json:"success,omitempty"`
}
NotebookCellExecutionSummary contains the summary of the execution of a notebook cell.
type NotebookCellKind ¶
type NotebookCellKind = Integer
NotebookCellKind denotes the kind of a notebook cell.
@since 3.17.0
const ( // NotebookCellKindMarkup is for a markup-cell that is // formatted source that is used to display text in instructions // and guidance. NotebookCellKindMarkup NotebookCellKind = 1 // NotebookCellKindCode is for a code-cell that is // executable source code. NotebookCellKindCode NotebookCellKind = 2 )
type NotebookCellLanguage ¶
type NotebookCellLanguage struct {
Language string `json:"language"`
}
NotebookCellLanguage denotes the language of a notebook cell.
type NotebookDocument ¶
type NotebookDocument struct {
// The notebook document's URI.
URI URI `json:"uri"`
// The type of the notebook.
NotebookType string `json:"notebookType"`
// The version number of this document (it will strictly increase after each change,
// including undo/redo).
Version Integer `json:"version"`
// Additional metadata stored with the notebook document.
Metadata LSPObject `json:"metadata,omitempty"`
// The cells of a notebook.
Cells []NotebookCell `json:"cells"`
}
NotebookDocument represents a notebook document.
@since 3.17.0
type NotebookDocumentChangeEvent ¶
type NotebookDocumentChangeEvent struct {
// The changed metadata if any.
Metadata LSPObject `json:"metadata,omitempty"`
// Changes to cells.
Cells *NotebookCellChanges `json:"cells,omitempty"`
}
NotebookDocumentChangeEvent represents a change event for a notebook document.
@since 3.17.0
type NotebookDocumentClientCapabilities ¶
type NotebookDocumentClientCapabilities struct {
// Capabilities specific to notebook document synchronization.
//
// @since 3.17.0
Synchronization *NotebookDocumentSyncClientCapabilities `json:"synchronization,omitempty"`
}
NotebookDocumentClientCapabilities provides capabilities specific to the notebook document support.
@since 3.17.0
type NotebookDocumentDidChangeHandlerFunc ¶
type NotebookDocumentDidChangeHandlerFunc func(ctx *common.LSPContext, params *DidChangeNotebookDocumentParams) error
NotebookDocumentDidChangeHandlerFunc is the function signature for the notebookDocument/didChange notification handler that can be registered for a language server.
type NotebookDocumentDidCloseHandlerFunc ¶
type NotebookDocumentDidCloseHandlerFunc func( ctx *common.LSPContext, params *DidCloseNotebookDocumentParams, ) error
NotebookDocumentDidCloseHandlerFunc is the function signature for the notebookDocument/didClose notification handler that can be registered for a language server.
type NotebookDocumentDidOpenHandlerFunc ¶
type NotebookDocumentDidOpenHandlerFunc func(ctx *common.LSPContext, params *DidOpenNotebookDocumentParams) error
NotebookDocumentDidOpenHandlerFunc is the function signature for the notebookDocument/didOpen notification handler that can be registered for a language server.
type NotebookDocumentDidSaveHandlerFunc ¶
type NotebookDocumentDidSaveHandlerFunc func( ctx *common.LSPContext, params *DidSaveNotebookDocumentParams, ) error
NotebookDocumentDidSaveHandlerFunc is the function signature for the notebookDocument/didSave notification handler that can be registered for a language server.
type NotebookDocumentFilter ¶
type NotebookDocumentFilter struct {
// The type of the enclosing notebook.
NotebookType string `json:"notebookType"`
// A URI [scheme](#Uri.scheme) like `file` or `untitled`.
Scheme *string `json:"scheme,omitempty"`
// A glob pattern.
Pattern *string `json:"pattern,omitempty"`
}
NotebookDocumentFilter denotes a notebook document by different properties.
@since 3.17.0
type NotebookDocumentIdentifier ¶
type NotebookDocumentIdentifier struct {
// The notebook document's URI.
URI URI `json:"uri"`
}
NotebookDocumentIdentifier represents a literal to identify a notebook document in the client.
@since 3.17.0
type NotebookDocumentSyncClientCapabilities ¶
type NotebookDocumentSyncClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is
// set to `true` the client supports the new
// `(NotebookDocumentSyncRegistrationOptions & NotebookDocumentSyncOptions)`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports sending execution summary data per cell.
ExecutionSummarySupport *bool `json:"executionSummarySupport,omitempty"`
}
NotebookDocumentSyncClientCapabilities represents the client capabilities specific to notebook document synchronisation.
@since 3.17.0
type NotebookDocumentSyncOptions ¶
type NotebookDocumentSyncOptions struct {
// The notebooks to be synced.
NotebookSelector []*NotebookSelectorItem `json:"notebookSelector"`
// Whether save notification should be forwarded to
// the server. Will only be honoured if mode === 'notebook'.
Save *bool `json:"save,omitempty"`
}
NotebookDocumentSyncOptions describes the options specific to a notebook plus its cells to be synced to the server.
If a selector provides a notebook document filter but no cell selector all cells of a matching notebook document will be synced.
If a selector provides no notebook document filter but only a cell selector all notebook documents that contain at least one matching cell will be synced.
@since 3.17.0
type NotebookDocumentSyncRegistrationOptions ¶
type NotebookDocumentSyncRegistrationOptions struct {
NotebookDocumentSyncOptions
StaticRegistrationOptions
}
Registration options specific to a notebook.
@since 3.17.0
type NotebookSelectorItem ¶
type NotebookSelectorItem struct {
// The notebook to be synced. If a string
// value is provided it matches against the
// notebook type. '*' matches every notebook.
// NotebookDocumentFilter | string
Notebook any `json:"notebook"`
// The cells of the matching notebook to be synced.
Cells []NotebookCellLanguage `json:"cells,omitempty"`
}
NotebookSelectorItem is the selector for a notebook to be synced.
type OptionalVersionedTextDocumentIdentifier ¶
type OptionalVersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
// The version number of this document.
// The version number of this document. If an optional versioned text document
// identifier is sent from the server to the client and the file is not
// open in the editor (the server has not received an open notification
// before) the server can send `null` to indicate that the version is
// known and the content on disk is the master (as specified with document
// content ownership).
//
// The version number of a document will increase after each change,
// including undo/redo. The number doesn't need to be consecutive.
Version *Integer `json:"version,omitempty"`
}
VersionedTextDocumentIdentifier is an identifier which optionally denotes a specific version of a text document. This information usually flows from the server to the client.
type ParameterInformation ¶
type ParameterInformation struct {
// The label of this parameter information.
//
// Either a string or an inclusive start and exclusive end offsets within
// its containing signature label. (see SignatureInformation.label). The
// offsets are based on a UTF-16 string representation as `Position` and
// `Range` does.
//
// *Note*: a label of type string should be a substring of its containing
// signature label. Its intended use case is to highlight the parameter
// label part in the `SignatureInformation.label`.
//
// string | [2]UInteger
Label any `json:"label"`
// The human-readable doc-comment of this parameter. Will be shown
// in the UI but can be omitted.
//
// string | MarkupContent | nil
Documentation any `json:"documentation,omitempty"`
}
Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.
func (*ParameterInformation) UnmarshalJSON ¶
func (p *ParameterInformation) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type ParameterInformationCapabilities ¶
type ParameterInformationCapabilities struct {
// The client supports processing label offsets instead of a
// simple label string.
//
// @since 3.14.0
LabelOffsetSupport *bool `json:"labelOffsetSupport,omitempty"`
}
ParameterInformationCapabilities describes the capabilities of a client for parameter information.
type PartialResultParams ¶
type PartialResultParams struct {
// An optional token that a server can use to report partial results (e.g.
// streaming) to the client.
PartialResultToken *ProgressToken `json:"partialResultToken,omitempty"`
}
PatialResultParams allow the passing of a partial result token in a context that supports reporting progress for partial results.
type Position ¶
type Position struct {
// Line position in a document (zero-based).
Line UInteger `json:"line"`
// Character offset on a line in a document (zero-based).
// The meaning of this offset is determined by the negotiated
// `PositionEncodingKind`.
//
// If the character value is greater than the line length it
// defaults back to the line length.
Character UInteger `json:"character"`
}
A Position in a text document expressed as zero-based line and character offset.
func (Position) EndOfLineIn ¶
func (p Position) EndOfLineIn(content string, posEncodingKind PositionEncodingKind) Position
EndOfLineIn returns the position at the end of the line this position is on.
type PositionEncodingKind ¶
type PositionEncodingKind string
PositionEncodingKind is a type that indicates how positions are encoded, specifically what column offsets mean.
@since 3.17.0
const ( // PositionEncodingKindUTF8 is used when the // character offsets count UTF-8 code units (e.g. bytes). // // @since 3.17.0 PositionEncodingKindUTF8 PositionEncodingKind = "utf-8" // @since 3.17.0 PositionEncodingKindUTF16 PositionEncodingKind = "utf-16" // PositionEncodingKindUTF32 is used when the // character offsets count UTF-32 code units. // // Note: these are the same as unicode code points, // so this `PositionEncodingKind` may also be used for an // encoding-agnostic representation of character offsets. // // @since 3.17.0 PositionEncodingKindUTF32 PositionEncodingKind = "utf-32" )
type PrepareCallHierarchyHandlerFunc ¶
type PrepareCallHierarchyHandlerFunc func(ctx *common.LSPContext, params *CallHierarchyPrepareParams) ([]CallHierarchyItem, error)
PrepareCallHierarchyHandlerFunc is the function signature for the textDocument/prepareCallHierarchy request handler that can be registered for a language server.
type PrepareRenameDefaultBehavior ¶
type PrepareRenameDefaultBehavior struct {
DefaultBehavior bool `json:"defaultBehavior"`
}
PrepareRenameDefaultBehavior is a default behavior which can be returned in the response for a textDocument/prepareRename request.
type PrepareRenameParams ¶
type PrepareRenameParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
PrepareRenameParams contains parameters for the textDocument/prepareRename requests.
type PrepareSupportDefaultBehavior ¶
type PrepareSupportDefaultBehavior = Integer
PrepareSupportDefaultBehavior is the default behavior used by the client for testing validity of operations such as rename.
const ( // PrepareSupportDefaultBehaviorIdentifier // means the client's default behavior is to select the identifier // according to the language's syntax rule. PrepareSupportDefaultBehaviorIdentifier PrepareSupportDefaultBehavior = 1 )
type PrepareTypeHierarchyHandlerFunc ¶
type PrepareTypeHierarchyHandlerFunc func( ctx *common.LSPContext, params *TypeHierarchyPrepareParams, ) ([]TypeHierarchyItem, error)
PrepareTypeHierarchyHandlerFunc is the function signature for the textDocument/prepareTypeHierarchy request handler that can be registered for a language server.
type PreviousResultID ¶
type PreviousResultID struct {
// The URI for which the client knows a result id.
URI DocumentURI `json:"uri"`
// The value of the previous result id.
Value string `json:"value"`
}
PreviousResultID is a previous result id in a workspace pull request.
@since 3.17.0
type ProgressHandlerFunc ¶
type ProgressHandlerFunc func(ctx *common.LSPContext, params *ProgressParams) error
ProgressHandlerFunc is the function signature for handling client progress notifications that can be registered for a language server.
type ProgressParams ¶
type ProgressParams struct {
// The progress token provided by the client or server.
Token *ProgressToken `json:"token"`
// The progress data.
Value LSPAny `json:"value"`
}
ProgressParams contains the progress notification parameters.
type ProgressToken ¶
type ProgressToken = IntOrString
ProgressToken is either an integer or a string which is used to report progress out of band and notifications. The token is not the same as the request ID.
type PublishDiagnosticsClientCapabilities ¶
type PublishDiagnosticsClientCapabilities struct {
// Whether the clients accepts diagnostics with related information.
RelatedInformation *bool `json:"relatedInformation,omitempty"`
// Client supports the tag property to provide meta data about a diagnostic.
// Clients supporting tags have to handle unknown tags gracefully.
//
// @since 3.15.0
TagSupport *DiagnosticTagSupport `json:"tagSupport,omitempty"`
// Whether the client interprets the version property of the
// `textDocument/publishDiagnostics` notification's parameter.
//
// @since 3.15.0
VersionSupport *bool `json:"versionSupport,omitempty"`
// Client supports a codeDescription property
//
// @since 3.16.0
CodeDescriptionSupport *bool `json:"codeDescriptionSupport,omitempty"`
// Whether code action supports the `data` property which is
// preserved between a `textDocument/publishDiagnostics` and
// `textDocument/codeAction` request.
//
// @since 3.16.0
DataSupport *bool `json:"dataSupport,omitempty"`
}
PublishDiagnosticsClientCapabilities represents the client capabilities specific to diagnostics sent from the server to the client to signal results of validation runs.
type PublishDiagnosticsParams ¶
type PublishDiagnosticsParams struct {
// The URI for which diagnostic information is reported.
URI DocumentURI `json:"uri"`
// Optional the version number of the document the diagnostics are published
// for.
//
// @since 3.15.0
Version *Integer `json:"version,omitempty"`
// An array of diagnostic information items.
Diagnostics []Diagnostic `json:"diagnostics"`
}
PublishDiagnosticsParams contains the parameters for the textDocument/publishDiagnostics notification.
type Range ¶
type Range struct {
// The range's start position.
Start Position `json:"start"`
// The range's end position.
End Position `json:"end"`
}
A Range in the text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor where the end position is exclusive.
type RangeWithPlaceholder ¶
type RangeWithPlaceholder struct {
Range Range `json:"range"`
Placeholder string `json:"placeholder"`
}
RangeWithPlaceholder is a range with a placeholder which can be returned in the response for a textDocument/prepareRename request.
type ReferenceClientCapabilities ¶
type ReferenceClientCapabilities struct {
// Whether references supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
ReferencesClientCapabilities describes the capabilities of a client for find references requests.
type ReferenceContext ¶
type ReferenceContext struct {
// Include the declaration of the current symbol.
IncludeDeclaration bool `json:"includeDeclaration"`
}
ReferenceContext contains additional information for the textDocument/references request.
type ReferenceOptions ¶
type ReferenceOptions struct {
WorkDoneProgressOptions
}
ReferenceOptions provides server capability options for find references requests.
type ReferencesParams ¶
type ReferencesParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
Context ReferenceContext `json:"context"`
}
ReferencesParams contains the textDocument/references request parameters.
type Registration ¶
type Registration struct {
// The id used to register the request. The ID can be used to deregister
// the request in the future.
ID string `json:"id"`
// The method / capability to register for.
Method string `json:"method"`
// Options necessary for the registration.
RegisterOptions LSPAny `json:"registerOptions,omitempty"`
}
Registration provides general parameters to register for a capability.
type RegistrationParams ¶
type RegistrationParams struct {
Registrations []Registration `json:"registrations"`
}
RegistrationParams contains a list of registrations.
type RegularExpressionsClientCapabilities ¶
type RegularExpressionsClientCapabilities struct {
// The engine's name.
Engine string `json:"engine"`
// The engine's version.
Version *string `json:"version,omitempty"`
}
RegularExpressionsClientCapabilities represents the capabilities of the client for regular expressions.
type RelatedFullDocumentDiagnosticReport ¶
type RelatedFullDocumentDiagnosticReport struct {
FullDocumentDiagnosticReport
// Diagnostics of related documents. This information is useful
// in programming languages where code in a file A can generate
// diagnostics in a file B which A depends on. An example of
// such a language is C/C++ where marco definitions in a file
// a.cpp and result in errors in a header file b.hpp.
//
// @since 3.17.0
//
// map[string](FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport)
RelatedDocuments map[string]any `json:"relatedDocuments,omitempty"`
}
RelatedFullDocumentDiagnosticReport is a full diagnostic report with a set of related documents.
@since 3.17.0
func (*RelatedFullDocumentDiagnosticReport) UnmarshalJSON ¶
func (r *RelatedFullDocumentDiagnosticReport) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type RelatedUnchangedDocumentDiagnosticReport ¶
type RelatedUnchangedDocumentDiagnosticReport struct {
UnchangedDocumentDiagnosticReport
// Diagnostics of related documents. This information is useful
// in programming languages where code in a file A can generate
// diagnostics in a file B which A depends on. An example of
// such a language is C/C++ where marco definitions in a file
// a.cpp and result in errors in a header file b.hpp.
//
// @since 3.17.0
//
// map[string](FullDocumentDiagnosticReport | UnchangedDocumentDiagnosticReport)
RelatedDocuments map[string]any `json:"relatedDocuments,omitempty"`
}
RelatedUnchangedDocumentDiagnosticReport is an unchanged diagnostic report with a set of related documents.
@since 3.17.0
func (*RelatedUnchangedDocumentDiagnosticReport) UnmarshalJSON ¶
func (r *RelatedUnchangedDocumentDiagnosticReport) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type RenameClientCapabilities ¶
type RenameClientCapabilities struct {
// Whether rename supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Client supports testing for validity of rename operations
// before execution.
//
// @since version 3.12.0
PrepareSupport *bool `json:"prepareSupport,omitempty"`
// Client supports the default behavior result
// (`{ defaultBehavior: boolean }`).
//
// The value indicates the default behavior used by the
// client.
//
// @since version 3.16.0
PrepareSupportDefaultBehavior *PrepareSupportDefaultBehavior `json:"prepareSupportDefaultBehavior,omitempty"`
// Whether the client honors the change annotations in
// text edits and resource operations returned via the
// rename request's workspace edit by for example presenting
// the workspace edit in the user interface and asking
// for confirmation.
//
// @since 3.16.0
HonorsChangeAnnotations *bool `json:"honorsChangeAnnotations,omitempty"`
}
RenameClientCapabilities describes the capabilities of a client for rename requests.
type RenameFile ¶
type RenameFile struct {
// A rename operation.
Kind string `json:"kind"` // == "rename"
// The old (existing) location.
OldURI DocumentURI `json:"oldUri"`
// The new location.
NewURI DocumentURI `json:"newUri"`
// Rename options.
Options *RenameFileOptions `json:"options,omitempty"`
// An optional annotation identifier describing the operation.
//
// @since 3.16.0
AnnotationID *ChangeAnnotationIdentifier `json:"annotationId,omitempty"`
}
RenameFile defines an operation to rename a file.
type RenameFileOptions ¶
type RenameFileOptions struct {
// Overwrite target if existing. Overwrite wins over `ignoreIfExists`
Overwrite *bool `json:"overwrite,omitempty"`
// Ignores if target exists.
IgnoreIfExists *bool `json:"ignoreIfExists,omitempty"`
}
RenameFileOptions provides options to rename a file.
type RenameFilesParams ¶
type RenameFilesParams struct {
// An array of all files/folders renamed in this operation.
// When a folder is renamed, only the folder will be included,
// and not its children.
Files []FileRename `json:"files"`
}
RenameFilesParams contains the parameters sent in notifications/requests for user-initiated renaming of files.
type RenameOptions ¶
type RenameOptions struct {
WorkDoneProgressOptions
// Renames should be checked and tested before being executed.
PrepareProvider *bool `json:"prepareProvider,omitempty"`
}
RenameOptions provides server capability options for rename requests.
type RenameParams ¶
type RenameParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
// The new name of the symbol. If the given name is not valid the
// request must return a [ResponseError](#ResponseError) with an
// appropriate message set.
NewName string `json:"newName"`
}
RenameParams contains parameters for the textDocument/rename requests.
type ResourceOperationKind ¶
type ResourceOperationKind = string
const ( // Supports creating new files and folders. ResourceOperationKindCreate ResourceOperationKind = "create" // Supports renaming existing files and folders. ResourceOperationKindRename ResourceOperationKind = "rename" // Supports deleting existing files and folders. ResourceOperationKindDelete ResourceOperationKind = "delete" )
type SelectionRange ¶
type SelectionRange struct {
// The [range](#Range) of this selection range.
Range Range `json:"range"`
// The parent selection range containing this range.
// Therefore `parent.range` must contain `this.range`.
Parent *SelectionRange `json:"parent,omitempty"`
}
SelectionRange represents a selection range.
type SelectionRangeClientCapabilities ¶
type SelectionRangeClientCapabilities struct {
// Whether implementation supports dynamic registration for selection range
// providers. If this is set to `true` the client supports the new
// `SelectionRangeRegistrationOptions` return value for the corresponding
// server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
SelectionRangeClientCapabilities describes the capabilities of a client for selection range requests.
type SelectionRangeHandlerFunc ¶
type SelectionRangeHandlerFunc func( ctx *common.LSPContext, params *SelectionRangeParams, ) ([]SelectionRange, error)
SelectionRangeHandlerFunc is the function signature for the textDocument/selectionRange request handler that can be registered for a language server.
type SelectionRangeOptions ¶
type SelectionRangeOptions struct {
WorkDoneProgressOptions
}
SelectionRangeOptions provides server capability options for select range requests.
type SelectionRangeParams ¶
type SelectionRangeParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The positions inside the text document.
Positions []Position `json:"positions"`
}
SelectionRangeParams contains the textDocument/selectionRange request parameters.
type SelectionRangeRegistrationOptions ¶
type SelectionRangeRegistrationOptions struct {
SelectionRangeOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
SelectionRangeRegistrationOptions provides server capability registration options for select range requests.
type SemanticDelta ¶
type SemanticDelta struct {
// The server supports deltas for full documents.
Delta *bool `json:"delta,omitempty"`
}
SemanticDelta represents the server's support for deltas in semantic tokens.
type SemanticTokenModifier ¶
type SemanticTokenModifier string
SemanticTokenModifier is a predefined token modifiers.
type SemanticTokenType ¶
type SemanticTokenType = string
SemanticTokenType is a predefined token types.
type SemanticTokens ¶
type SemanticTokens struct {
// An optional result id. If provided and clients support delta updating
// the client will include the result id in the next semantic token request.
// A server can then instead of computing all semantic tokens again simply
// send a delta.
ResultID *string `json:"resultId,omitempty"`
// The actual tokens.
Data []UInteger `json:"data"`
}
SemanticTokens represents a full set of semantic tokens.
type SemanticTokensClientCapabilities ¶
type SemanticTokensClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `(TextDocumentRegistrationOptions &
// StaticRegistrationOptions)` return value for the corresponding server
// capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Which requests the client supports and might send to the server
// depending on the server's capability. Please note that clients might not
// show semantic tokens or degrade some of the user experience if a range
// or full request is advertised by the client but not provided by the
// server. If for example the client capability `requests.full` and
// `request.range` are both set to true but the server only provides a
// range provider the client might not render a minimap correctly or might
// even decide to not show any semantic tokens at all.
Requests SemanticTokensRequests `json:"requests"`
// The token types that the client supports.
TokenTypes []string `json:"tokenTypes"`
// The token modifiers that the client supports.
TokenModifiers []string `json:"tokenModifiers"`
// The formats the clients supports.
Formats []TokenFormat `json:"formats"`
// Whether the client supports tokens that can overlap each other.
OverlappingTokenSupport *bool `json:"overlappingTokenSupport,omitempty"`
// Whether the client supports tokens that can span multiple lines.
MultilineTokenSupport *bool `json:"multilineTokenSupport,omitempty"`
// Whether the client allows the server to actively cancel a
// semantic token request, e.g. supports returning
// ErrorCodes.ServerCancelled. If a server does the client
// needs to retrigger the request.
//
// @since 3.17.0
ServerCancelSupport *bool `json:"serverCancelSupport,omitempty"`
// Whether the client uses semantic tokens to augment existing
// syntax tokens. If set to `true` client side created syntax
// tokens and semantic tokens are both used for colorization. If
// set to `false` the client only uses the returned semantic tokens
// for colorization.
//
// If the value is `undefined` then the client behavior is not
// specified.
//
// @since 3.17.0
AugmentsSyntaxTokens *bool `json:"augmentsSyntaxTokens,omitempty"`
}
SemanticTokensClientCapabilities describes the capabilities of a client for semantic tokens requests.
func (*SemanticTokensClientCapabilities) UnmarshalJSON ¶
func (c *SemanticTokensClientCapabilities) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type SemanticTokensDelta ¶
type SemanticTokensDelta struct {
ResultID *string `json:"resultId,omitempty"`
// The semantic token edits to transform a previous result into a new result.
Edits []SemanticTokensEdit `json:"edits"`
}
SemanticTokensDelta represents a delta set of semantic tokens.
type SemanticTokensDeltaParams ¶
type SemanticTokensDeltaParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The result id of a previous response. The result Id can either point to
// a full response or a delta response depending on what was received last.
PreviousResultID string `json:"previousResultId"`
}
SemanticTokensDeltaParams contains the textDocument/semanticTokens/full/delta request parameters.
type SemanticTokensEdit ¶
type SemanticTokensEdit struct {
// The start offset of the edit.
Start UInteger `json:"start"`
// The number of elements to remove.
DeleteCount UInteger `json:"deleteCount"`
// The elements to insert.
Data []UInteger `json:"data,omitempty"`
}
SemanticTokensEdit represents a semantic token edit.
type SemanticTokensFullDeltaHandlerFunc ¶
type SemanticTokensFullDeltaHandlerFunc func( ctx *common.LSPContext, params *SemanticTokensDeltaParams, ) (*SemanticTokensDelta, error)
SemanticTokensFullDeltaHandlerFunc is the function signature for the textDocument/semanticTokens/full/delta request handler that can be registered for a language server.
type SemanticTokensFullHandlerFunc ¶
type SemanticTokensFullHandlerFunc func( ctx *common.LSPContext, params *SemanticTokensParams, ) (*SemanticTokens, error)
SemanticTokensFullHandlerFunc is the function signature for the textDocument/semanticTokens/full request handler that can be registered for a language server.
type SemanticTokensLegend ¶
type SemanticTokensLegend struct {
// The token types a server uses.
TokenTypes []string `json:"tokenTypes"`
// The token modifiers a server uses.
TokenModifiers []string `json:"tokenModifiers"`
}
SemanticTokensLenged represent's the server's way of letting the client know which numbers it is using for which types and modifiers.
type SemanticTokensOptions ¶
type SemanticTokensOptions struct {
WorkDoneProgressOptions
// The legend used by the server.
Legend SemanticTokensLegend `json:"legend"`
// Server supports providing semantic tokens for a specific range of a document.
//
// bool | struct{} | nil
Range any `json:"range,omitempty"`
// Server supports providing semantic token for a full document.
//
// bool | SemanticDelta | nil
Full any `json:"full,omitempty"`
}
SemanticTokensOptions provides server capability options for semantic tokens requests.
type SemanticTokensParams ¶
type SemanticTokensParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
}
SemanticTokensParams contains the textDocument/semanticTokens/full request parameters.
type SemanticTokensRangeHandlerFunc ¶
type SemanticTokensRangeHandlerFunc func( ctx *common.LSPContext, params *SemanticTokensRangeParams, ) (*SemanticTokens, error)
SemanticTokensRangeHandlerFunc is the function signature for the textDocument/semanticTokens/range request handler that can be registered for a language server.
type SemanticTokensRangeParams ¶
type SemanticTokensRangeParams struct {
WorkDoneProgressParams
PartialResultParams
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The range the semantic tokens are requested for.
Range Range `json:"range"`
}
SemanticTokensRangeParams contains the textDocument/semanticTokens/range request parameters.
type SemanticTokensRegistrationOptions ¶
type SemanticTokensRegistrationOptions struct {
TextDocumentRegistrationOptions
StaticRegistrationOptions
SemanticTokensOptions
}
SemanticTokensRegistrationOptions provides server capability registration options for semantic tokens requests.
func (*SemanticTokensRegistrationOptions) UnmarshalJSON ¶
func (s *SemanticTokensRegistrationOptions) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type SemanticTokensRequests ¶
type SemanticTokensRequests struct {
// The client will send the `textDocument/semanticTokens/range` request
// if the server provides a corresponding handler.
//
// boolean | struct{} | nil
Range any `json:"range,omitempty"`
// The client will send the `textDocument/semanticTokens/full` request
// if the server provides a corresponding handler.
//
// boolean | SemanticDelta | nil
Full any `json:"full,omitempty"`
}
SemanticTokensRequests describes requests that a client can send to a server for semantic tokens.
type SemanticTokensWorkspaceClientCapabilities ¶
type SemanticTokensWorkspaceClientCapabilities struct {
// Whether the client implementation supports a refresh request sent from
// the server to the client.
//
// Note that this event is global and will force the client to refresh all
// semantic tokens currently shown. It should be used with absolute care
// and is useful for situation where a server for example detect a project
// wide change that requires such a calculation.
RefreshSupport *bool `json:"refreshSupport,omitempty"`
}
SemanticTokensWorkspaceClientCapabilities describes the capabilities of a client for semantic tokens in workspaces.
type ServerCapabilities ¶
type ServerCapabilities struct {
// The position encoding the server picked from the encodings offered
// by the client via the client capability `general.positionEncodings`.
//
// If the client didn't provide any position encodings the only valid
// value that a server can return is 'utf-16'.
//
// If omitted it defaults to 'utf-16'.
//
// @since 3.17.0
PositionEncoding PositionEncodingKind `json:"positionEncoding,omitempty"`
// Defines how text documents are synced. Is either a detailed structure
// defining each notification or for backwards compatibility with the
// TextDocumentSyncKind number. If omitted it defaults to
// `TextDocumentSyncKind.None`.
//
// TextDocumentSyncOptions | TextDocumentSyncKind | nil
TextDocumentSync any `json:"textDocumentSync,omitempty"`
// Defines how notebook documents are synced.
//
// @since 3.17.0
//
// NotebookDocumentSyncOptions | NotebookDocumentSyncRegistrationOptions | nil
NotebookDocumentSync any `json:"notebookSync,omitempty"`
// The server provides hover support.
CompletionProvider *CompletionOptions `json:"completionProvider,omitempty"`
// The server provides hover support.
//
// HoverOptions | boolean | nil
HoverProvider any `json:"hoverProvider,omitempty"`
// The server provides signature help support.
SignatureHelpProvider *SignatureHelpOptions `json:"signatureHelpProvider,omitempty"`
// The server provides go to definition support.
//
// @since 3.14.0
//
// DeclarationOptions | DeclarationRegistrationOptions | boolean | nil
DeclarationProvider any `json:"declarationProvider,omitempty"`
// The server provides goto definition support.
//
// DefinitionOptions | boolean | nil
DefinitionProvider any `json:"definitionProvider,omitempty"`
// The server provides goto type definition support.
//
// @since 3.6.0
//
// TypeDefinitionOptions | TypeDefinitionRegistrationOptions | boolean | nil
TypeDefinitionProvider any `json:"typeDefinitionProvider,omitempty"`
// The server provides goto implementation support.
//
// @since 3.6.0
//
// ImplementationOptions | ImplementationRegistrationOptions | boolean | nil
ImplementationProvider any `json:"implementationProvider,omitempty"`
// The server provides find references support.
// ReferenceOptions | boolean | nil
ReferencesProvider any `json:"referencesProvider,omitempty"`
// The server provides document highlight support.
// DocumentHighlightOptions | boolean | nil
DocumentHighlightProvider any `json:"documentHighlightProvider,omitempty"`
// The server provides document symbol support.
// DocumentSymbolOptions | boolean | nil
DocumentSymbolProvider any `json:"documentSymbolProvider,omitempty"`
// The server provides code actions. The `CodeActionOptions` return type is
// only valid if the client signals code action literal support via the
// property `textDocument.codeAction.codeActionLiteralSupport`.
// CodeActionOptions | boolean | nil
CodeActionProvider any `json:"codeActionProvider,omitempty"`
// The server provides code lens.
CodeLensProvider *CodeLensOptions `json:"codeLensProvider,omitempty"`
// The server provides document link support.
DocumentLinkProvider *DocumentLinkOptions `json:"documentLinkProvider,omitempty"`
// The server provides color provider support.
//
// @since 3.6.0
// DocumentColorOptions | DocumentColorRegistrationOptions | boolean | nil
ColorProvider any `json:"colorProvider,omitempty"`
// The server provides document formatting.
// DocumentFormattingOptions | boolean | nil
DocumentFormattingProvider any `json:"documentFormattingProvider,omitempty"`
// The server provides document range formatting.
// DocumentRangeFormattingOptions | boolean | nil
DocumentRangeFormattingProvider any `json:"documentRangeFormattingProvider,omitempty"`
// The server provides document formatting on typing.
DocumentOnTypeFormattingProvider *DocumentOnTypeFormattingOptions `json:"documentOnTypeFormattingProvider,omitempty"`
// The server provides rename support.
// RenameOptions may only be specified if the client states that
// it supports `prepareSupport` in its initial `initialize` request.
// RenameOptions | boolean | nil
RenameProvider any `json:"renameProvider,omitempty"`
// The server provides folding provider support.
//
// @since 3.10.0
// FoldingRangeOptions | FoldingRangeRegistrationOptions | boolean | nil
FoldingRangeProvider any `json:"foldingRangeProvider,omitempty"`
// The server provides execute command support.
ExecuteCommandProvider *ExecuteCommandOptions `json:"executeCommandProvider,omitempty"`
// The server provides selection range support.
//
// @since 3.15.0
// SelectionRangeOptions | SelectionRangeRegistrationOptions | boolean | nil
SelectionRangeProvider any `json:"selectionRangeProvider,omitempty"`
// The server provides linked editing range support.
//
// @since 3.16.0
// LinkedEditingRangeOptions | LinkedEditingRangeRegistrationOptions | boolean | nil
LinkedEditingRangeProvider any `json:"linkedEditingRangeProvider,omitempty"`
// The server provides call hierarchy support.
//
// @since 3.16.0
// CallHierarchyOptions | CallHierarchyRegistrationOptions | boolean | nil
CallHierarchyProvider any `json:"callHierarchyProvider,omitempty"`
// The server provides semantic tokens support.
//
// @since 3.16.0
// SemanticTokensOptions | SemanticTokensRegistrationOptions | nil
//
// With the way Go's unmarshalling JSON into structs work, SemanticTokensRegistrationOptions
// will succeed even if the registration-specific option fields are not present so
// `SemanticTokensOptions` and `SemanticTokensRegistrationOptions` are equivalent
// for a runtime serverCapabilities object.
SemanticTokensProvider any `json:"semanticTokensProvider,omitempty"`
// Whether server provides moniker support.
//
// @since 3.16.0
// MonikerOptions | MonikerRegistrationOptions | boolean | nil
MonikerProvider any `json:"monikerProvider,omitempty"`
// The server provides type hierarchy support.
//
// @since 3.17.0
// TypeHierarchyOptions | TypeHierarchyRegistrationOptions | boolean | nil
TypeHierarchyProvider any `json:"typeHierarchyProvider,omitempty"`
// The server provides inline values.
//
// @since 3.17.0
// InlineValueOptions | InlineValueRegistrationOptions | boolean | nil
InlineValueProvider any `json:"inlineValueProvider,omitempty"`
// The server provides inlay hints.
//
// @since 3.17.0
// InlayHintOptions | InlayHintRegistrationOptions | boolean | nil
InlayHintProvider any `json:"inlayHintProvider,omitempty"`
// The server has support for pull model diagnostics.
//
// @since 3.17.0
// DiagnosticOptions | DiagnosticRegistrationOptions | nil
DiagnosticProvider any `json:"diagnosticProvider,omitempty"`
// The server provides workspace symbol support.
// WorkspaceSymbolOptions | boolean | nil
WorkspaceSymbolProvider any `json:"workspaceSymbolProvider,omitempty"`
// Workspace specific server capabilities.
Workspace *ServerWorkspaceCapabilities `json:"workspace,omitempty"`
// Experimental server capabilities.
Experimental LSPAny `json:"experimental,omitempty"`
}
ServerCapabilities represents the capabilities of the server returned in the initialize result.
func (*ServerCapabilities) UnmarshalJSON ¶
func (s *ServerCapabilities) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface for server capabilities.
type ServerWorkspaceCapabilities ¶
type ServerWorkspaceCapabilities struct {
// The server supports workspace folder.
//
// @since 3.6.0
WorkspaceFolders *WorkspaceFoldersServerCapabilities `json:"workspaceFolders,omitempty"`
// The server is interested in file notifications/requests.
//
// @since 3.16.0
FileOperations *WorkspaceFileOperationServerCapabilities `json:"fileOperations,omitempty"`
}
ServerWorkspaceCapabilities represents the capabilities of the server related to workspaces.
type SetTraceHandlerFunc ¶
type SetTraceHandlerFunc func(ctx *common.LSPContext, params *SetTraceParams) error
SetTraceHandlerFunc is the function signature for the setTrace notification handler that can be registered for a language server.
type SetTraceParams ¶
type SetTraceParams struct {
// The new value that should be assigned to the trace setting.
Value TraceValue `json:"value"`
}
SetTraceParams contains the setTrace notification parameters.
type ShowDocumentClientCapabilities ¶
type ShowDocumentClientCapabilities struct {
// The client has support for the show document request.
Support *bool `json:"support,omitempty"`
}
ShowDocumentClientCapabilities represents the client capabilities specific to the show document request.
@since 3.16.0
type ShowMessageParams ¶
type ShowMessageParams struct {
// The message type. See {@link MessageType}.
Type MessageType `json:"type"`
// The actual message.
Message string `json:"message"`
}
ShowMessageParams represents the parameters of a `window/showMessage` notification.
type ShowMessageRequestClientCapabilities ¶
type ShowMessageRequestClientCapabilities struct {
// Capabilities specific to the `MessageActionItem` type.
MessageActionItem *MessageActionItemClientCapabilities `json:"messageActionItem,omitempty"`
}
ShowMessageRequestClientCapabilities represents the client capabilities specific to the show message request.
type ShowMessageRequestParams ¶
type ShowMessageRequestParams struct {
// The message type. See {@link MessageType}.
Type MessageType `json:"type"`
// The actual message.
Message string `json:"message"`
// The message action items to present.
Actions []MessageActionItem `json:"actions,omitempty"`
}
ShowMessageRequestParams represents the parameters of a `window/showMessageRequest` notification.
type ShutdownHandlerFunc ¶
type ShutdownHandlerFunc func(ctx *common.LSPContext) error
ShutdownHandlerFunc is the function signature for the shutdown request handler that can be registered for a language server.
type SignatureHelp ¶
type SignatureHelp struct {
// One or more signatures. If no signatures are available the signature help
// request should return `null`.
Signatures []*SignatureInformation `json:"signatures"`
// The active signature. If omitted or the value lies outside the
// range of `signatures` the value defaults to zero or is ignore if
// the `SignatureHelp` as no signatures.
//
// Whenever possible implementors should make an active decision about
// the active signature and shouldn't rely on a default value.
//
// In future version of the protocol this property might become
// mandatory to better express this.
ActiveSignature *UInteger `json:"activeSignature,omitempty"`
// The active parameter of the active signature. If omitted or the value
// lies outside the range of `signatures[activeSignature].parameters`
// defaults to 0 if the active signature has parameters. If
// the active signature has no parameters it is ignored.
// In future version of the protocol this property might become
// mandatory to better express the active parameter if the
// active signature does have any.
ActiveParameter *UInteger `json:"activeParameter,omitempty"`
}
SignatureHelp represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.
type SignatureHelpClientCapabilities ¶
type SignatureHelpClientCapabilities struct {
// Whether signature help supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports the following `SignatureInformation`
// specific properties.
SignatureInformation *SignatureInformationCapabilities `json:"signatureInformation,omitempty"`
// The client supports to send additional context information for a
// `textDocument/signatureHelp` request. A client that opts into
// contextSupport will also support the `retriggerCharacters` on
// `SignatureHelpOptions`.
//
// @since 3.15.0
ContextSupport *bool `json:"contextSupport,omitempty"`
}
SignatureHelpClientCapabilities describes the capabilities of a client for signature help requests.
type SignatureHelpContext ¶
type SignatureHelpContext struct {
// Action that caused signature help to be triggered.
TriggerKind SignatureHelpTriggerKind `json:"triggerKind"`
// Character that caused signature help to be triggered.
//
// This is undefined when `triggerKind !==
// SignatureHelpTriggerKind.TriggerCharacter`
TriggerCharacter *string `json:"triggerCharacter,omitempty"`
// `true` if signature help was already showing when it was triggered.
//
// Retriggers occur when the signature help is already active and can be
// caused by actions such as typing a trigger character, a cursor move, or
// document content changes.
IsRetrigger bool `json:"isRetrigger"`
// The currently active `SignatureHelp`.
//
// The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field
// updated based on the user navigating through available signatures.
ActiveSignatureHelp *SignatureHelp `json:"activeSignatureHelp,omitempty"`
}
Additional information about the context in which a signature help request was triggered.
@since 3.15
type SignatureHelpHandlerFunc ¶
type SignatureHelpHandlerFunc func( ctx *common.LSPContext, params *SignatureHelpParams, ) (*SignatureHelp, error)
SignatureHelpHandlerFunc is the function signature for the textDocument/signatureHelp request handler that can be registered for a language server.
type SignatureHelpOptions ¶
type SignatureHelpOptions struct {
WorkDoneProgressOptions
// The characters that trigger signature help
// automatically.
TriggerCharacters []string `json:"triggerCharacters,omitempty"`
// List of characters that re-trigger signature help.
//
// These trigger characters are only active when signature help is already
// showing. All trigger characters are also counted as re-trigger
// characters.
//
// @since 3.15.0
RetriggerCharacters []string `json:"retriggerCharacters,omitempty"`
}
SignatureHelpOptions provides server capability options for signature help requests.
type SignatureHelpParams ¶
type SignatureHelpParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
// The signature help context. This is only available if the client
// specifies to send this using the client capability
// `textDocument.signatureHelp.contextSupport === true`
//
// @since 3.15.0
Context *SignatureHelpContext `json:"context,omitempty"`
}
SignatureHelpParams contains the parameters for the textDocument/signatureHelp request.
type SignatureHelpTriggerKind ¶
type SignatureHelpTriggerKind = Integer
How a signature help was triggered.
@since 3.15.0
const ( // SignatureHelpTriggerKindInvoked means signature help was // invoked manually by the user or by a command. SignatureHelpTriggerKindInvoked SignatureHelpTriggerKind = 1 // SignatureHelpTriggerKindTriggerCharacter means signature help was // triggered by the user typing a trigger character. SignatureHelpTriggerKindTriggerCharacter SignatureHelpTriggerKind = 2 // SignatureHelpTriggerKindContentChange means signature help was // triggered by the cursor moving or by the document content changing. SignatureHelpTriggerKindContentChange SignatureHelpTriggerKind = 3 )
type SignatureInformation ¶
type SignatureInformation struct {
// The label of this signature. Will be shown in
// the UI.
Label string `json:"label"`
// The human-readable doc-comment of this signature. Will be shown
// in the UI but can be omitted.
//
// string | MarkupContent | nil
Documentation any `json:"documentation,omitempty"`
// The parameters of this signature.
Parameters []*ParameterInformation `json:"parameters"`
// The index of the active parameter.
//
// If provided, this is used in place of `SignatureHelp.activeParameter`.
//
// @since 3.16.0
ActiveParameter *UInteger `json:"activeParameter,omitempty"`
}
SignatureInformation represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.
func (*SignatureInformation) UnmarshalJSON ¶
func (si *SignatureInformation) UnmarshalJSON(data []byte) error
type SignatureInformationCapabilities ¶
type SignatureInformationCapabilities struct {
// Client supports the follow content formats for the documentation
// property. The order describes the preferred format of the client.
DocumentationFormat []MarkupKind `json:"documentationFormat,omitempty"`
// Client capabilities specific to parameter information.
ParameterInformation *ParameterInformationCapabilities `json:"parameterInformation,omitempty"`
// The client supports the `activeParameter` property on
// a `SignatureInformation` literal.
ActiveParameterSupport *bool `json:"activeParameterSupport,omitempty"`
}
SignatureInformationCapabilities describes the capabilities of a client for signature information.
type StaleRequestSupport ¶
type StaleRequestSupport struct {
// The client will actively cancel the request.
Cancel bool `json:"cancel"`
// This list of requests for which the client will retry the request
// if it receives a response with error code `ContentModified`.
RetryOnContentModified []string `json:"retryOnContentModified"`
}
StaleRequestSupport represents how the client handles stale requests.
@since 3.17.0
type StaticRegistrationOptions ¶
type StaticRegistrationOptions struct {
// The id used to register the request. The ID can be used to deregister
// the request in the future. Tou can also see Registration#id.
ID *string `json:"id,omitempty"`
}
type SymbolInformation ¶
type SymbolInformation struct {
// The name of this symbol.
Name string `json:"name"`
// The kind of this symbol.
Kind SymbolKind `json:"kind"`
// Tags for this symbol.
//
// @since 3.16.0
Tags []SymbolTag `json:"tags,omitempty"`
// Indicates if this symbol is deprecated.
//
// @deprecated Use tags instead.
Deprecated *bool `json:"deprecated,omitempty"`
// The location of this symbol. The location's range is used by a tool
// to reveal the location in the editor. If the symbol is selected in the
// tool the range's start information is used to position the cursor. So
// the range usually spans more then the actual symbol's name and does
// normally include things like visibility modifiers.
//
// The range doesn't have to denote a node range in the sense of an abstract
// syntax tree. It can therefore not be used to re-construct a hierarchy of
// the symbols.
Location Location `json:"location"`
// The name of the symbol containing this symbol. This information is for
// user interface purposes (e.g. to render a qualifier in the user interface
// if necessary). It can't be used to re-infer a hierarchy for the document
// symbols.
ContainerName *string `json:"containerName,omitempty"`
}
SymbolInformation represents information about programming constructs like variables, classes, interfaces etc.
@deprecated use DocumentSymbol or WorkspaceSymbol instead.
type SymbolKind ¶
type SymbolKind = Integer
SymbolKind represents a symbol kind in the `workspace/symbol` request.
const ( // SymbolKindFile represents a file symbol kind. SymbolKindFile SymbolKind = 1 // SymbolKindModule represents a module symbol kind. SymbolKindModule SymbolKind = 2 // SymbolKindNamespace represents a namespace symbol kind. SymbolKindNamespace SymbolKind = 3 // SymbolKindPackage represents a package symbol kind. SymbolKindPackage SymbolKind = 4 // SymbolKindClass represents a class symbol kind. SymbolKindClass SymbolKind = 5 // SymbolKindMethod represents a method symbol kind. SymbolKindMethod SymbolKind = 6 // SymbolKindProperty represents a property symbol kind. SymbolKindProperty SymbolKind = 7 // SymbolKindField represents a field symbol kind. SymbolKindField SymbolKind = 8 // SymbolKindConstructor represents a constructor symbol kind. SymbolKindConstructor SymbolKind = 9 // SymbolKindEnum represents an enum symbol kind. SymbolKindEnum SymbolKind = 10 // SymbolKindInterface represents an interface symbol kind. SymbolKindInterface SymbolKind = 11 // SymbolKindFunction represents a function symbol kind. SymbolKindFunction SymbolKind = 12 // SymbolKindVariable represents a variable symbol kind. SymbolKindVariable SymbolKind = 13 // SymbolKindConstant represents a constant symbol kind. SymbolKindConstant SymbolKind = 14 // SymbolKindString represents a string symbol kind. SymbolKindString SymbolKind = 15 // SymbolKindNumber represents a number symbol kind. SymbolKindNumber SymbolKind = 16 // SymbolKindBoolean represents a boolean symbol kind. SymbolKindBoolean SymbolKind = 17 // SymbolKindArray represents an array symbol kind. SymbolKindArray SymbolKind = 18 // SymbolKindObject represents an object symbol kind. SymbolKindObject SymbolKind = 19 // SymbolKindKey represents a key symbol kind. SymbolKindKey SymbolKind = 20 // SymbolKindNull represents a null symbol kind. SymbolKindNull SymbolKind = 21 // SymbolKindEnumMember represents an enum member symbol kind. SymbolKindEnumMember SymbolKind = 22 // SymbolKindStruct represents a struct symbol kind. SymbolKindStruct SymbolKind = 23 // SymbolKindEvent represents an event symbol kind. SymbolKindEvent SymbolKind = 24 // SymbolKindOperator represents an operator symbol kind. SymbolKindOperator SymbolKind = 25 // SymbolKindTypeParameter represents a type parameter symbol kind. SymbolKindTypeParameter SymbolKind = 26 )
type SymbolKindCapabilities ¶
type SymbolKindCapabilities struct {
// The symbol kind values the client supports. When this
// property exists the client also guarantees that it will
// handle values outside its set gracefully and falls back
// to a default value when unknown.
//
// If this property is not present the client only supports
// the symbol kinds from `File` to `Array` as defined in
// the initial version of the protocol.
ValueSet []SymbolKind `json:"valueSet,omitempty"`
}
SymbolKindCapabilities provides specific capabilities for the `SymbolKind` in symbol requests.
type SymbolTag ¶
type SymbolTag = Integer
SymbolTag is an extra annotation that tweak rendering of a symbol.
@since 3.16.0
const ( // SymbolTagDeprecated renders a symbol as obsolete, usually using a strike-out. SymbolTagDeprecated SymbolTag = 1 )
type SymbolTagSupport ¶
type SymbolTagSupport struct {
// The tags supported by the client.
ValueSet []SymbolTag `json:"valueSet"`
}
SymbolTagSupport provides specific capabilities for tags on symbol objects such as `SymbolInformation` and `WorkspaceSymbol`.
type TelemetryEventParams ¶
type TelemetryEventParams = interface{}
TelemetryEventParams represents the parameters of a `telemetry/event` notification. This is expected to be a value serialisable to a JSON object or array. This is presented in the specification as: params: ‘object’ | ‘array’;
type TextDocumentClientCapabilities ¶
type TextDocumentClientCapabilities struct {
Synchronization *TextDocumentSyncClientCapabilities `json:"synchronization,omitempty"`
// Capabilities specific to the `textDocument/completion` request.
Completion *CompletionClientCapabilities `json:"completion,omitempty"`
// Capabilities specific to the `textDocument/hover` request.
Hover *HoverClientCapabilities `json:"hover,omitempty"`
// Capabilities specific to the `textDocument/signatureHelp` request.
SignatureHelp *SignatureHelpClientCapabilities `json:"signatureHelp,omitempty"`
// Capabilities specific to the `textDocument/declaration` request.
//
// @since 3.14.0
Declaration *DeclarationClientCapabilities `json:"declaration,omitempty"`
// Capabilities specific to the `textDocument/definition` request.
Definition *DefinitionClientCapabilities `json:"definition,omitempty"`
// Capabilities specific to the `textDocument/typeDefinition` request.
//
// @since 3.6.0
TypeDefinition *TypeDefinitionClientCapabilities `json:"typeDefinition,omitempty"`
// Capabilities specific to the `textDocument/implementation` request.
//
// @since 3.6.0
Implementation *ImplementationClientCapabilities `json:"implementation,omitempty"`
// Capabilities specific to the `textDocument/references` request.
//
// @since 3.6.0
References *ReferenceClientCapabilities `json:"references,omitempty"`
// Capabilities specific to the `textDocument/documentHighlight` request.
DocumentHighlight *DocumentHighlightClientCapabilities `json:"documentHighlight,omitempty"`
// Capabilities specific to the `textDocument/documentSymbol` request.
DocumentSymbol *DocumentSymbolClientCapabilities `json:"documentSymbol,omitempty"`
// Capabilities specific to the `textDocument/codeAction` request.
CodeAction *CodeActionClientCapabilities `json:"codeAction,omitempty"`
// Capabilities specific to the `textDocument/codeLens` request.
CodeLens *CodeLensClientCapabilities `json:"codeLens,omitempty"`
// Capabilities specific to the `textDocument/documentLink` request.
DocumentLink *DocumentLinkClientCapabilities `json:"documentLink,omitempty"`
// Capabilities specific to the `textDocument/documentColor` and the
// `textDocument/colorPresentation` request.
//
// @since 3.6.0
ColorProvider *DocumentColorClientCapabilities `json:"colorProvider,omitempty"`
// Capabilities specific to the `textDocument/formatting` request.
Formatting *DocumentFormattingClientCapabilities `json:"formatting,omitempty"`
// Capabilities specific to the `textDocument/rangeFormatting` request.
RangeFormatting *DocumentRangeFormattingClientCapabilities `json:"rangeFormatting,omitempty"`
// Capabilities specific to the `textDocument/onTypeFormatting` request.
OnTypeFormatting *DocumentOnTypeFormattingClientCapabilities `json:"onTypeFormatting,omitempty"`
// Capabilities specific to the `textDocument/rename` request.
Rename *RenameClientCapabilities `json:"rename,omitempty"`
// Capabilities specific to the `textDocument/publishDiagnostics` notification.
PublishDiagnostics *PublishDiagnosticsClientCapabilities `json:"publishDiagnostics,omitempty"`
// Capabilities specific to the `textDocument/foldingRange` request.
//
// @since 3.10.0
FoldingRange *FoldingRangeClientCapabilities `json:"foldingRange,omitempty"`
// Capabilities specific to the `textDocument/selectionRange` request.
//
// @since 3.15.0
SelectionRange *SelectionRangeClientCapabilities `json:"selectionRange,omitempty"`
// Capabilities specific to the `textDocument/linkedEditingRange` request.
//
// @since 3.16.0
LinkedEditingRange *LinkedEditingRangeClientCapabilities `json:"linkedEditingRange,omitempty"`
// Capabilities specific to the various call hierarchy requests.
//
// @since 3.16.0
CallHierarchy *CallHierarchyClientCapabilities `json:"callHierarchy,omitempty"`
// Capabilities specific to the `textDocument/semanticTokens` request.
//
// @since 3.16.0
SemanticTokens *SemanticTokensClientCapabilities `json:"semanticTokens,omitempty"`
// Capabilities specific to the `textDocument/moniker` request.
//
// @since 3.16.0
Moniker *MonikerClientCapabilities `json:"moniker,omitempty"`
// Capabilities specific to the various type hierarchy requests.
//
// @since 3.17.0
TypeHierarchy *TypeHierarchyClientCapabilities `json:"typeHierarchy,omitempty"`
// Capabilities specific to the `textDocument/inlineValue` request.
//
// @since 3.17.0
InlineValue *InlineValueClientCapabilities `json:"inlineValue,omitempty"`
// Capabilities specific to the `textDocument/inlayHint` request.
//
// @since 3.17.0
InlayHint *InlayHintClientCapabilities `json:"inlayHint,omitempty"`
// Capabilities specific to the diagnostic pull model.
//
// @since 3.17.0
Diagnostics *DiagnosticClientCapabilities `json:"diagnostics,omitempty"`
}
TextDocumentClientCapabilities represents the capabilities of the client related to text documents.
type TextDocumentContentChangeEvent ¶
type TextDocumentContentChangeEvent struct {
// The range of the document that changed.
Range *Range `json:"range"`
// The optional length of the range that was replaced.
//
// @deprecated use range instead.
RangeLength *UInteger `json:"rangeLength,omitempty"`
// The new text for the provided range.
Text string `json:"text"`
}
TextDocumentContentChangeEvent represents an event describing a change to a text document. If only a text is provided it is considered to be the full content of the document.
type TextDocumentContentChangeEventWhole ¶
type TextDocumentContentChangeEventWhole struct {
// The new text of the whole document.
Text string `json:"text"`
}
TextDocumentContentChangeEventWhole represents an event describing a change to a text document where the full content of the document is provided.
type TextDocumentDidChangeHandlerFunc ¶
type TextDocumentDidChangeHandlerFunc func(ctx *common.LSPContext, params *DidChangeTextDocumentParams) error
TextDocumentDidChangeHandlerFunc is the function signature for the handler of the textDocument/didChange notification.
type TextDocumentDidCloseHandlerFunc ¶
type TextDocumentDidCloseHandlerFunc func(ctx *common.LSPContext, params *DidCloseTextDocumentParams) error
TextDocumentDidCloseHandlerFunc is the function signature for the handler of the textDocument/didClose notification.
type TextDocumentDidOpenHandlerFunc ¶
type TextDocumentDidOpenHandlerFunc func(ctx *common.LSPContext, params *DidOpenTextDocumentParams) error
TextDocumentDidOpenHandlerFunc is the function signature for the handler of the textDocument/didOpen notification.
type TextDocumentDidSaveHandlerFunc ¶
type TextDocumentDidSaveHandlerFunc func( ctx *common.LSPContext, params *DidSaveTextDocumentParams, ) error
TextDocumentDidSaveHandlerFunc is the function signature for the handler of the textDocument/didSave notification.
type TextDocumentEdit ¶
type TextDocumentEdit struct {
// The text document to change.
TextDocument OptionalVersionedTextDocumentIdentifier `json:"textDocument"`
// The edits to be applied.
//
// @since 3.16.0 - support for AnnotatedTextEdit. This
// is guarded by the client capability `workspace.workspaceEdit.changeAnnotationSupport`.
Edits []any `json:"edits"` // TextEdit | AnnotatedTextEdit (checked at runtime)
}
type TextDocumentIdentifier ¶
type TextDocumentIdentifier struct {
// The text document's URI.
URI DocumentURI `json:"uri"`
}
TextDocumentIdentifier identifies a text document.
type TextDocumentItem ¶
type TextDocumentItem struct {
// The text document's URI.
URI DocumentURI `json:"uri"`
// The text document's language identifier.
LanguageID string `json:"languageId"`
// The version number of this document (it will strictly increase after each
// change, including undo/redo).
Version Integer `json:"version"`
// The content of the opened text document.
Text string `json:"text"`
}
TextDocumentItem is an item to transfer a text document from the client to the server.
type TextDocumentPositionParams ¶
type TextDocumentPositionParams struct {
// The text document.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The position inside the text document.
Position Position `json:"position"`
}
TextDocumentPositionParams is the parameters of a request that requires a text document and a position. A parameter literal used in requests to pass a text document and a position inside that document. It is up to the client to decide how a selection is converted into a position when issuing a request for a text document. The client can for example honor or ignore the selection direction to make LSP request consistent with features implemented internally.
type TextDocumentRegistrationOptions ¶
type TextDocumentRegistrationOptions struct {
// A document selector to identify to identify the scope of the registration.
// If set to null the document selector provided on the client side will be used.
DocumentSelector *DocumentSelector `json:"documentSelector"`
}
TextDocumentRegistrationOptions provides general text document registration options.
type TextDocumentSaveReason ¶
type TextDocumentSaveReason Integer
TextDocumentSaveReason represents the reason why a text document is being saved.
const ( // TextDocumentSaveReasonManual means that the document save is manually triggered, // e.g. by the user pressing save, by starting debugging, or by an API call. TextDocumentSaveReasonManual TextDocumentSaveReason = 1 // TextDocumentSaveReasonAfterDelay means that the document save is triggered // automatically after a delay. TextDocumentSaveReasonAfterDelay TextDocumentSaveReason = 2 // TextDocumentSaveReasonFocusOut means that the document save is triggered when // the editor loses focus. TextDocumentSaveReasonFocusOut TextDocumentSaveReason = 3 )
type TextDocumentSyncClientCapabilities ¶
type TextDocumentSyncClientCapabilities struct {
// Whether text document synchronization supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports sending will save notifications.
WillSave *bool `json:"willSave,omitempty"`
// The client supports sending a will save request and
// waits for a response providing text edits which will
// be applied to the document before it is saved.
WillSaveWaitUntil *bool `json:"willSaveWaitUntil,omitempty"`
// The client supports did save notifications.
DidSave *bool `json:"didSave,omitempty"`
}
TextDocumentSyncClientCapabilities represents the client capabilities specific to text document synchronisation.
type TextDocumentSyncKind ¶
type TextDocumentSyncKind Integer
TextDocumentSyncKind defines how the host (editor) should sync document changes to the language server.
var ( // TextDocumentSyncKindNone means that documents should // not be synced at all. TextDocumentSyncKindNone TextDocumentSyncKind = 0 // TextDocumentSyncKindFull means that documents are synced // by always sending the full content of the document. TextDocumentSyncKindFull TextDocumentSyncKind = 1 // TextDocumentSyncKindIncremental means that documents are // synced by sending the full content on open. After that only // incremental updates to the document are sent. TextDocumentSyncKindIncremental TextDocumentSyncKind = 2 )
type TextDocumentSyncOptions ¶
type TextDocumentSyncOptions struct {
// Open and close notifications are sent to the server.
// If omitted open close notifications should not be sent.
OpenClose *bool `json:"openClose,omitempty"`
// Change notifications are sent to the server.
// See TextDocumentSyncKind.None, TextDocumentSyncKind.Full and
// TextDocumentSyncKind.Incremental. If omitted it defaults to
// TextDocumentSyncKind.None.
Change *TextDocumentSyncKind `json:"change,omitempty"`
// If present will save notifications are sent to the server. If omitted
// the notification should not be sent.
WillSave *bool `json:"willSave,omitempty"`
/**
* If present will save wait until requests are sent to the server. If
* omitted the request should not be sent.
*/
WillSaveWaitUntil *bool `json:"willSaveWaitUntil,omitempty"`
// If present save notifications are sent to the server. If omitted the
// notification should not be sent.
//
// SaveOptions | bool | nil
Save any `json:"save,omitempty"`
}
TextDocumentSyncOptions represents the options of a text document sync capability.
type TextDocumentWillSaveHandlerFunc ¶
type TextDocumentWillSaveHandlerFunc func( ctx *common.LSPContext, params *WillSaveTextDocumentParams, ) error
TextDocumentWillSaveHandlerFunc is the function signature for the handler of the textDocument/willSave notification.
type TextDocumentWillSaveWaitUntilHandlerFunc ¶
type TextDocumentWillSaveWaitUntilHandlerFunc func( ctx *common.LSPContext, params *WillSaveTextDocumentParams, ) ([]TextEdit, error)
TextDocumentWillSaveWaitUntilHandlerFunc is the function signature for the handler of the textDocument/willSaveWaitUntil request.
type TextEdit ¶
type TextEdit struct {
// The range of the text document to be manipulated. To insert
// text into a document create a range where start === end.
Range *Range `json:"range"`
// The string to be inserted. For delete operations use an
// empty string.
NewText string `json:"newText"`
}
TextEdit is a textual edit applicable to a text document.
type TokenFormat ¶
type TokenFormat = string
TokenFormat represents additional token format capabilities to allow future extension of the format.
const ( // TokenFormatRelative represents a relative token format. TokenFormatRelative TokenFormat = "relative" )
type TraceServerLogger ¶
type TraceServerLogger interface {
// LogMessage logs a message to the client.
LogMessage(params LogMessageParams) error
}
TraceServerLogger is an interface that provides a way to log messages to the client taking into account the current trace configuration.
type TraceService ¶
type TraceService struct {
// contains filtered or unexported fields
}
TraceService provides a convenient way to store trace configuration and log trace messages to the client where the current shared trace configuration is taken into account.
func NewTraceService ¶
func NewTraceService(logger *zap.Logger) *TraceService
NewTraceService creates a new trace service.
func (*TraceService) CreateSetTraceHandler ¶
func (s *TraceService) CreateSetTraceHandler() SetTraceHandlerFunc
CreateSetTraceHandler creates a new set trace handler function that can be configured with a `Handler` instance to handle `$/setTrace` notifications from the client and store the trace level in the trace service.
func (*TraceService) GetTraceValue ¶
func (s *TraceService) GetTraceValue() TraceValue
GetTraceValue returns the current trace value shared between the client and the server.
func (*TraceService) Trace ¶
func (s *TraceService) Trace(serverLogger TraceServerLogger, mType MessageType, message string) error
Trace logs a message to the client if the provided message type is enabled in the current trace configuration.
type TraceValue ¶
type TraceValue string
A TraceValue represents the level of verbosity with which the server systematically reports its execution trace using `$/logTrace` notifications.
type TypeDefinitionClientCapabilities ¶
type TypeDefinitionClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `TypeDefinitionRegistrationOptions`
// return value for the corresponding server capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// The client supports additional metadata in the form of definition links.
//
// @since 3.14.0
LinkSupport *bool `json:"linkSupport,omitempty"`
}
TypeDefinitionClientCapabilities describes the capabilities of a client for goto type definition requests.
type TypeDefinitionOptions ¶
type TypeDefinitionOptions struct {
WorkDoneProgressOptions
}
TypeDefinitionOptions provides server capability options for goto type definition requests.
type TypeDefinitionParams ¶
type TypeDefinitionParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
PartialResultParams
}
TypeDefinitionParams contains the textDocument/typeDefinition request parameters.
type TypeDefinitionRegistrationOptions ¶
type TypeDefinitionRegistrationOptions struct {
TypeDefinitionOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
TypeDefinitionRegistrationOptions provides server capability registration options for goto type definition requests.
type TypeHierarchyClientCapabilities ¶
type TypeHierarchyClientCapabilities struct {
// Whether implementation supports dynamic registration. If this is set to
// `true` the client supports the new `(TextDocumentRegistrationOptions &
// StaticRegistrationOptions)` return value for the corresponding server
// capability as well.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
}
TypeHierarchyClientCapabilities describes the capabilities of a client for type hierarchy requests.
type TypeHierarchyItem ¶
type TypeHierarchyItem struct {
// The name of this item.
Name string `json:"name"`
// The kind of this item.
Kind SymbolKind `json:"kind"`
// Tags for this item.
Tags []SymbolTag `json:"tags,omitempty"`
// More detail for this item, e.g. the signature of a function.
Detail *string `json:"detail,omitempty"`
// The resource identifier of this item.
URI DocumentURI `json:"uri"`
// The range enclosing this symbol not including leading/trailing whitespace
// but everything else, e.g. comments and code.
Range Range `json:"range"`
// The range that should be selected and revealed when this symbol is being
// picked, e.g. the name of a function. Must be contained by the
// [`range`](#TypeHierarchyItem.range).
SelectionRange Range `json:"selectionRange"`
// A data entry field that is preserved between a type hierarchy prepare and
// supertypes or subtypes requests. It could also be used to identify the
// type hierarchy in the server, helping improve the performance on
// resolving supertypes and subtypes.
Data LSPAny `json:"data,omitempty"`
}
TypeHierarchyItem represents an item within the type hierarchy.
type TypeHierarchyOptions ¶
type TypeHierarchyOptions struct {
WorkDoneProgressOptions
}
TypeHierarchyOptions provides server capability options for type hierarchy requests.
type TypeHierarchyPrepareParams ¶
type TypeHierarchyPrepareParams struct {
TextDocumentPositionParams
WorkDoneProgressParams
}
TypeHierarchyPrepareParams contains the textDocument/prepareTypeHierarchy request parameters.
type TypeHierarchyRegistrationOptions ¶
type TypeHierarchyRegistrationOptions struct {
TypeHierarchyOptions
TextDocumentRegistrationOptions
StaticRegistrationOptions
}
TypeHierarchyRegistrationOptions provides server capability registration options for type hierarchy requests.
type TypeHierarchySubtypesHandlerFunc ¶
type TypeHierarchySubtypesHandlerFunc func( ctx *common.LSPContext, params *TypeHierarchySubtypesParams, ) ([]TypeHierarchyItem, error)
TypeHierarchySubtypesHandlerFunc is the function signature for the typeHierarchy/subtypes request handler that can be registered for a language server.
type TypeHierarchySubtypesParams ¶
type TypeHierarchySubtypesParams struct {
WorkDoneProgressParams
PartialResultParams
Item TypeHierarchyItem `json:"item"`
}
TypeHierarchySubtypesParams contains the typeHierarchy/subtypes request parameters.
type TypeHierarchySupertypesHandlerFunc ¶
type TypeHierarchySupertypesHandlerFunc func( ctx *common.LSPContext, params *TypeHierarchySupertypesParams, ) ([]TypeHierarchyItem, error)
TypeHierarchySupertypesHandlerFunc is the function signature for the typeHierarchy/supertypes request handler that can be registered for a language server.
type TypeHierarchySupertypesParams ¶
type TypeHierarchySupertypesParams struct {
WorkDoneProgressParams
PartialResultParams
Item TypeHierarchyItem `json:"item"`
}
TypeHierarchySupertypesParams contains the typeHierarchy/supertypes request parameters.
type UInteger ¶
type UInteger = uint32
UInteger defines an unsigned integer number in the range 0 to 2^32-1.
type UnchangedDocumentDiagnosticReport ¶
type UnchangedDocumentDiagnosticReport struct {
// A document diagnostic report indicating
// no changes to the last result. A server can
// only return `unchanged` if result ids are
// provided.
// Expected to be DocumentDiagnosticReportKindUnchanged.
Kind DocumentDiagnosticReportKind `json:"kind"`
// A result id which will be sent on the next
// diagnostic request for the same document.
ResultID string `json:"resultId"`
}
UnchangedDocumentDiagnosticReport is a diagnostic report indicating that the last returned report is still accurate.
@since 3.17.0
type UniquenessLevel ¶
type UniquenessLevel = string
UniquenessLevel defines in which scope the monikor is unique.
const ( // The moniker is only unique inside a document. UniquenessLevelDocument UniquenessLevel = "document" // The moniker is unique inside a project for which a dump was created. UniquenessLevelProject UniquenessLevel = "project" // The moniker is unique inside the group to which a project belongs. UniquenessLevelGroup UniquenessLevel = "group" // The moniker is unique inside the moniker scheme. UniquenessLevelScheme UniquenessLevel = "scheme" // The moniker is globally unique. UniquenessLevelGlobal UniquenessLevel = "global" )
type Unregistration ¶
type Unregistration struct {
// The id used to unregister the request or notification. Usually an id
// provided during the register request.
ID string `json:"id"`
// The method / capability to unregister for.
Method string `json:"method"`
}
Unregistration provides general parameters to unregister a capability.
type UnregistrationParams ¶
type UnregistrationParams struct {
// This should correctly be named `unregistrations`.
// However, changing this is a breaking change and needs to wait
// util 4.x version of the specification is delivered.
Unregistrations []Unregistration `json:"unregisterations"`
}
UnregistrationParams contains a list of unregistrations.
type VersionedNotebookDocumentIdentifier ¶
type VersionedNotebookDocumentIdentifier struct {
// The version number of this notebook document.
Version Integer `json:"version"`
// The notebook document's URI.
URI URI `json:"uri"`
}
VersionedNotebookDocumentIdentifier represents a versioned notebook document identifier.
@since 3.17.0
type VersionedTextDocumentIdentifier ¶
type VersionedTextDocumentIdentifier struct {
TextDocumentIdentifier
// The version number of this document.
// The version number of this document. If an optional versioned text document
// identifier is sent from the server to the client and the file is not
// open in the editor (the server has not received an open notification
// before) the server can send `null` to indicate that the version is
// known and the content on disk is the master (as specified with document
// content ownership).
//
// The version number of a document will increase after each change,
// including undo/redo. The number doesn't need to be consecutive.
Version Integer `json:"version"`
}
VersionedTextDocumentIdentifier is an identifier to denote a specific version of a text document.
type WillSaveTextDocumentParams ¶
type WillSaveTextDocumentParams struct {
// The document that will be saved.
TextDocument TextDocumentIdentifier `json:"textDocument"`
// The reason why the document is being saved.
Reason TextDocumentSaveReason `json:"reason"`
}
WillSaveTextDocumentParams are the parameters of a will save text document notification.
type WindowClientCapabilities ¶
type WindowClientCapabilities struct {
// Indicates whether the client supports server initiated
// progress using the `window/workDoneProgress/create` request.
//
// The capability also controls whether the client supports
// handling of progress notifications. If set, servers are allowed
// to report a `workDoneProgress` property in the request specific
// server capabilities.
WorkDoneProgress *bool `json:"workDoneProgress,omitempty"`
// Capabilities specific to the `window/showMessage` request.
//
// @since 3.16.0
ShowMessage *ShowMessageRequestClientCapabilities `json:"showMessage,omitempty"`
// Client capabilities for the show document request.
//
// @since 3.16.0
ShowDocument *ShowDocumentClientCapabilities `json:"showDocument,omitempty"`
}
WindowClientCapabilities represents the capabilities of the client related to the window.
type WindowWorkDoneProgressCancelHandler ¶
type WindowWorkDoneProgressCancelHandler func( context *common.LSPContext, params *WorkDoneProgressCancelParams, ) error
WindowWorkDoneProgressCancelHandler is the function signature for the `window/workDoneProgress/cancel` notification.
type WorkDoneProgressBegin ¶
type WorkDoneProgressBegin struct {
Kind string `json:"kind"` // == "begin"
// Mandatory title of the progress operation. Used to briefly inform about
// the kind of operation being performed.
//
// Examples: "Indexing" or "Linking dependencies".
Title string `json:"title"`
// Controls if a cancel button should show to allow the user to cancel the
// long running operation. Clients that don't support cancellation are allowed
// to ignore the setting.
Cancellable *bool `json:"cancellable,omitempty"`
// Optional, more detailed associated progress message. Contains
// complementary information to the `title`.
//
// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
// If unset, the previous progress message (if any) is still valid.
Message *string `json:"message,omitempty"`
// Optional progress percentage to display (value 100 is considered 100%).
// If not provided infinite progress is assumed and clients are allowed
// to ignore the `percentage` value in subsequent in report notifications.
//
// The value should be steadily rising. Clients are free to ignore values
// that are not following this rule. The value range is [0, 100].
Percentage *UInteger `json:"percentage,omitempty"`
}
WorkDoneProgressBegin is the payload sent with a `$/progress` notification that signals the begining of some background work.
type WorkDoneProgressCancelParams ¶
type WorkDoneProgressCancelParams struct {
// The token to be used to report progress.
Token *ProgressToken `json:"token"`
}
WorkDoneProgressCancelParams represents the parameters of a `window/workDoneProgress/cancel` notification.
type WorkDoneProgressCreateParams ¶
type WorkDoneProgressCreateParams struct {
// The token to be used to report progress.
Token *ProgressToken `json:"token"`
}
WorkDoneProgressCreateParams represents the parameters of a `window/workDoneProgress/create` notification.
type WorkDoneProgressEnd ¶
type WorkDoneProgressEnd struct {
Kind string `json:"kind"` // == "end"
// Optional, a final message indicating to for example indicate the outcome
// of the operation.
Message *string `json:"message,omitempty"`
}
WorkDoneProgressEnd is the payload sent signalling the end of of some work.
type WorkDoneProgressOptions ¶
type WorkDoneProgressOptions struct {
WorkDoneProgress *bool `json:"workDoneProgress,omitempty"`
}
WorkDoneProgressOptions is the type for server capabilities.
An example usage would be: ```json
{
"referencesProvider": {
"workDoneProgress": true
}
}
```
type WorkDoneProgressParams ¶
type WorkDoneProgressParams struct {
// An optional token that a server can use to report work done progress.
WorkDoneToken *ProgressToken `json:"workDoneToken,omitempty"`
}
WorkDoneProgressParams provides parameters that should be provided for client-initiated progress.
type WorkDoneProgressReport ¶
type WorkDoneProgressReport struct {
Kind string `json:"kind"` // == "report"
// Controls enablement state of a cancel button. This property is only valid
// if a cancel button got requested in the `WorkDoneProgressBegin` payload.
//
// Clients that don't support cancellation or don't support control the
// button's enablement state are allowed to ignore the setting.
Cancellable *bool `json:"cancellable,omitempty"`
// Optional, more detailed associated progress message. Contains
// complementary information to the `title`.
//
// Examples: "3/25 files", "project/src/module2", "node_modules/some_dep".
// If unset, the previous progress message (if any) is still valid.
Message *string `json:"message,omitempty"`
// Optional progress percentage to display (value 100 is considered 100%).
// If not provided infinite progress is assumed and clients are allowed
// to ignore the `percentage` value in subsequent in report notifications.
//
// The value should be steadily rising. Clients are free to ignore values
// that are not following this rule. The value range is [0, 100].
Percentage *UInteger `json:"percentage,omitempty"`
}
WorkDoneProgressReport is the payload that is used when reporting progress.
type WorkspaceDiagnosticHandlerFunc ¶
type WorkspaceDiagnosticHandlerFunc func( ctx *common.LSPContext, params *WorkspaceDiagnosticParams, ) (*WorkspaceDiagnosticReport, error)
WorkspaceDiagnosticHandlerFunc is the function signature for the workspace/diagnostic request handler that can be registered for a language server.
Structurally, `WorkspaceDiagnosticReportPartialResult` is exactly the same as `WorkspaceDiagnosticReport`, so you can use the same struct to return partial or full results in the response to the client.
Note: When returning a server cancellation error response (@since 3.17.0), an instance of the `ErrorWithData` error type should be returned containing the `ServerCancelled` code and the data of the `DiagnosticServerCancellationData` type.
For example:
serverCancelled := "ServerCancelled"
return nil, &ErrorWithData{
Code: &IntOrString{ StrVal: &serverCancelled },
Data: &DiagnosticServerCancellationData{
RetriggerRequest: false,
},
}
type WorkspaceDiagnosticParams ¶
type WorkspaceDiagnosticParams struct {
WorkDoneProgressParams
PartialResultParams
// The additional identifier provided during registration.
Identifier *string `json:"identifier,omitempty"`
// The currently known diagnostic reports with their
// previous result ids.
PreviousResultIDs []PreviousResultID `json:"previousResultIds"`
}
WorkspaceDiagnosticParams holds parameters of the workspace diagnostic request.
@since 3.17.0
type WorkspaceDiagnosticReport ¶
type WorkspaceDiagnosticReport struct {
// [](WorkspaceFullDocumentDiagnosticReport | WorkspaceUnchangedDocumentDiagnosticReport)
Items []any `json:"items"`
}
WorkspaceDiagnosticReport holds a workspace diagnostic report returned as the response to a workspace/diagnostic request.
@since 3.17.0
func (*WorkspaceDiagnosticReport) UnmarshalJSON ¶
func (r *WorkspaceDiagnosticReport) UnmarshalJSON(data []byte) error
Fulfils the json.Unmarshaler interface.
type WorkspaceDidChangeConfigurationHandlerFunc ¶
type WorkspaceDidChangeConfigurationHandlerFunc func( context *common.LSPContext, params *DidChangeConfigurationParams, ) error
WorkspaceDidChangeConfigurationHandlerFunc is the function signature for the `workspace/didChangeConfiguration` method.
type WorkspaceDidChangeFoldersHandlerFunc ¶
type WorkspaceDidChangeFoldersHandlerFunc func( context *common.LSPContext, params *DidChangeWorkspaceFoldersParams, ) error
WorkspaceDidChangeFoldersHandlerFunc is the function signature for the `workspace/didChangeWorkspaceFolders` method.
type WorkspaceDidChangeWatchedFilesHandlerFunc ¶
type WorkspaceDidChangeWatchedFilesHandlerFunc func( context *common.LSPContext, params *DidChangeWatchedFilesParams, ) error
WorkspaceDidChangeWatchedFilesHandlerFunc is the function signature for the `workspace/didChangeWatchedFiles` method.
type WorkspaceDidCreateFilesHandlerFunc ¶
type WorkspaceDidCreateFilesHandlerFunc func( context *common.LSPContext, params *CreateFilesParams, ) error
WorkspaceDidCreateFilesHandlerFunc is the function signature for the `workspace/didCreateFiles` method.
type WorkspaceDidDeleteFilesHandlerFunc ¶
type WorkspaceDidDeleteFilesHandlerFunc func( context *common.LSPContext, params *DeleteFilesParams, ) error
WorkspaceDidDeleteFilesHandlerFunc is the function signature for the `workspace/didDeleteFiles` method.
type WorkspaceDidRenameFilesHandlerFunc ¶
type WorkspaceDidRenameFilesHandlerFunc func( context *common.LSPContext, params *RenameFilesParams, ) error
WorkspaceDidRenameFilesHandlerFunc is the function signature for the `workspace/didRenameFiles` method.
type WorkspaceEdit ¶
type WorkspaceEdit struct {
// Holds changes to existing resources.
Changes map[DocumentURI][]TextEdit `json:"changes,omitempty"`
// Depending on the client capaiblity
// `workspace.workspaceEdit.resourceOperations` document changes are either
// an array of `TextDocumentEdit`s to express changes to n different text documents
// where each text document edit addresses a specific version of a text document.
// Or it can contain above `TextDocumentEdit`s mixed with create, rename and delete file / folder operations.
//
// Whether a client supports versioned document edits is expressed via
// `workspace.workspaceEdit.documentChanges` client capability.
//
// If a client neither supports `documentChanges` nor `workspace.workspaceEdit.resourceOperations`
// then only plain `TextEdit`s using the `changes` property are supported.
DocumentChanges []any `json:"documentChanges,omitempty"` // TextDocumentEdit | CreateFile | RenameFile | DeleteFile (checked at runtime)
// A map of change annotations that can be referenced in
// `AnnotatedTextEdit`s or create, rename and delete file / folder operations.
//
// Whether clients honour this property depends on the client capability
// `workspace.changeAnnotationSupport`.
//
// @since 3.16.0
ChangeAnnotations map[ChangeAnnotationIdentifier]ChangeAnnotation `json:"changeAnnotations,omitempty"`
}
A WorkspaceEdit represents changes to many resources managed in the workspace. The edit should either provide changes or documentChanges. If the client can handle versioned document edits and if documentChanges are present, the latter are preferred over changes.
type WorkspaceEditClientCapabilities ¶
type WorkspaceEditClientCapabilities struct {
// The client supports versioned document changes in `WorkspaceEdit`s
DocumentChanges *bool `json:"documentChanges,omitempty"`
// The resource operations the client supports. Clients should at least
// support 'create', 'rename' and 'delete' files and folders.
//
// @since 3.13.0
ResourceOperations []ResourceOperationKind `json:"resourceOperations,omitempty"`
// The failure handling strategy of a client if applying the workspace edit
// fails.
//
// @since 3.13.0
FailureHandling FailureHandlingKind `json:"failureHandling,omitempty"`
// Whether the client normalises line endings to the client specific
// setting.
// If set to `true` the client will normalize line ending characters
// in a workspace edit to the client specific new line character(s).
//
// @since 3.16.0
NormalizesLineEndings *bool `json:"normalizesLineEndings,omitempty"`
// Whether the client in general supports change annotations on text edits,
// create file, rename file and delete file changes.
//
// @since 3.16.0
ChangeAnnotationSupport *ChangeAnnotationSupport `json:"changeAnnotationSupport,omitempty"`
}
WorkspaceEditClientCapabilities defines the capabilities the client has for workspace edits.
type WorkspaceExecuteCommandHandlerFunc ¶
type WorkspaceExecuteCommandHandlerFunc func( context *common.LSPContext, params *ExecuteCommandParams, ) (LSPAny, error)
WorkspaceExecuteCommandHandlerFunc is the function signature for the `workspace/executeCommand` method.
type WorkspaceFileOperationServerCapabilities ¶
type WorkspaceFileOperationServerCapabilities struct {
// The server is interested in receiving didCreateFiles
// notifications.
DidCreate *FileOperationRegistrationOptions `json:"didCreate,omitempty"`
// The server is interested in receiving willCreateFiles requests.
WillCreate *FileOperationRegistrationOptions `json:"willCreate,omitempty"`
// The server is interested in receiving didRenameFiles
// notifications.
DidRename *FileOperationRegistrationOptions `json:"didRename,omitempty"`
// The server is interested in receiving willRenameFiles requests.
WillRename *FileOperationRegistrationOptions `json:"willRename,omitempty"`
// The server is interested in receiving didDeleteFiles file
// notifications.
DidDelete *FileOperationRegistrationOptions `json:"didDelete,omitempty"`
// The server is interested in receiving willDeleteFiles file
// requests.
WillDelete *FileOperationRegistrationOptions `json:"willDelete,omitempty"`
}
type WorkspaceFolder ¶
type WorkspaceFolder struct {
// The associated URI for this workspace folder.
URI URI `json:"uri"`
// The name of the workspace folder. Used to refer to this
// workspace folder in the user interface.
Name string `json:"name"`
}
WorkspaceFolder represents a location and name of a workspace folder.
type WorkspaceFoldersChangeEvent ¶
type WorkspaceFoldersChangeEvent struct {
// The array of added workspace folders.
Added []WorkspaceFolder `json:"added"`
// The array of removed workspace folders.
Removed []WorkspaceFolder `json:"removed"`
}
WorkspaceFoldersChangeEvent represents a change event for workspace folders.
type WorkspaceFoldersServerCapabilities ¶
type WorkspaceFoldersServerCapabilities struct {
// The server has support for workspace folders.
Supported *bool `json:"supported,omitempty"`
// Whether the server wants to receive workspace folder
// change notifications.
//
// If a string is provided, the string is treated as an ID
// under which the notification is registered on the client
// side. The ID can be used to unregister for these events
// using the `client/unregisterCapability` request.
ChangeNotifications *BoolOrString `json:"changeNotifications,omitempty"`
}
WorkspaceFoldersServerCapabilities describes the capabilities of a server for workspace folders.
type WorkspaceFullDocumentDiagnosticReport ¶
type WorkspaceFullDocumentDiagnosticReport struct {
FullDocumentDiagnosticReport
// The URI for which diagnostic information is reported.
URI DocumentURI `json:"uri"`
// The version number for which the diagnostics are reported.
// If the document is not marked as upen `null` can be provided.
Version *Integer `json:"version,omitempty"`
}
WorkspaceFullDocumentDiagnosticReport holds a full diagnostic report for a workspace diagnostic result.
@since 3.17.0
type WorkspaceSymbol ¶
type WorkspaceSymbol struct {
// The name of this symbol.
Name string `json:"name"`
// The kind of this symbol.
Kind SymbolKind `json:"kind"`
// Tags for this symbol.
Tags []SymbolTag `json:"tags,omitempty"`
// The name of the symbol containing this symbol. This information is for
// user interface purposes (e.g. to render a qualifier in the user interface
// if necessary). It can't be used to re-infer a hierarchy for the document
// symbols.
ContainerName *string `json:"containerName,omitempty"`
// The location of this symbol. Whether a server is allowed to
// return a location without a range depends on the client
// capability `workspace.symbol.resolveSupport`.
//
// See also `SymbolInformation.location`.
//
// Location | DocumentURIObject
Location any `json:"location"`
// A data entry field that is preserved on a workspace symbol between a
// workspace symbol request and a workspace symbol resolve request.
Data LSPAny `json:"data,omitempty"`
}
WorkspaceSymbol represents a special workspace symbol that supports locations without a range.
@since 3.17.0
func (*WorkspaceSymbol) UnmarshalJSON ¶
func (w *WorkspaceSymbol) UnmarshalJSON(data []byte) error
Fulfils the `json.Unmarshaler` interface.
type WorkspaceSymbolClientCapabilities ¶
type WorkspaceSymbolClientCapabilities struct {
// Symbol request supports dynamic registration.
DynamicRegistration *bool `json:"dynamicRegistration,omitempty"`
// Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
SymbolKind *SymbolKindCapabilities `json:"symbolKind,omitempty"`
// The client supports tags on `SymbolInformation` and `WorkspaceSymbol`.
// Clients supporting tags have to handle unknown tags gracefully.
//
// @since 3.16.0
TagSupport *SymbolTagSupport `json:"tagSupport,omitempty"`
// The client supports partial workspace symbols.
// The client will send the request `workspaceSymbol/resolve` to the server
// to resolve additional properties.
//
// @since 3.17.0 - proposedState
ResolveSupport *WorkspaceSymbolResolveSupport `json:"resolveSupport,omitempty"`
}
WorkspaceSymbolClientCapabilities describes the capabilities of a client for the `workspace/symbol` request.
type WorkspaceSymbolHandlerFunc ¶
type WorkspaceSymbolHandlerFunc func( context *common.LSPContext, params *WorkspaceSymbolParams, ) (any, error)
WorkspaceSymbolHandlerFunc is the function signature for the `workspace/symbol` method.
Returns: []SymbolInformation | []WorkspaceSymbol | nil
type WorkspaceSymbolOptions ¶
type WorkspaceSymbolOptions struct {
WorkDoneProgressOptions
// The server provides support to resolve additional
// information for a workspace symbol.
//
// @since 3.17.0
ResolveProvider *bool `json:"resolveProvider,omitempty"`
}
WorkspaceSymbolOptions provides server capability options for workspace symbol requests.
type WorkspaceSymbolParams ¶
type WorkspaceSymbolParams struct {
WorkDoneProgressParams
PartialResultParams
// A query string to filter symbols by. Clients may send an empty
// string here to request all symbols.
Query string `json:"query"`
}
WorkspaceSymbolParams contains the parameters for the `workspace/symbol` request.
type WorkspaceSymbolResolveHandlerFunc ¶
type WorkspaceSymbolResolveHandlerFunc func( context *common.LSPContext, params *WorkspaceSymbol, ) (*WorkspaceSymbol, error)
WorkspaceSymbolResolveHandlerFunc is the function signature for the `workspaceSymbol/resolve` method.
type WorkspaceSymbolResolveSupport ¶
type WorkspaceSymbolResolveSupport struct {
// The properties that a client can resolve lazily.
// Usually `location.range`.
Properties []string `json:"properties,omitempty"`
}
WorkspaceSymbolResolveSupport provides specific capabilities for resolving additional properties for workspace symbols.
type WorkspaceUnchangedDocumentDiagnosticReport ¶
type WorkspaceUnchangedDocumentDiagnosticReport struct {
UnchangedDocumentDiagnosticReport
// The URI for which diagnostic information is reported.
URI DocumentURI `json:"uri"`
// The version number for which the diagnostics are reported.
// If the document is not marked as upen `null` can be provided.
Version *Integer `json:"version,omitempty"`
}
WorkspaceUnchangedDocumentDiagnosticReport holds an unchanged diagnostic report for a workspace diagnostic result.
@since 3.17.0
type WorkspaceWillCreateFilesHandlerFunc ¶
type WorkspaceWillCreateFilesHandlerFunc func( context *common.LSPContext, params *CreateFilesParams, ) (*WorkspaceEdit, error)
WorkspaceWillCreateFilesHandlerFunc is the function signature for the `workspace/willCreateFiles` method.
type WorkspaceWillDeleteFilesHandlerFunc ¶
type WorkspaceWillDeleteFilesHandlerFunc func( context *common.LSPContext, params *DeleteFilesParams, ) (*WorkspaceEdit, error)
WorkspaceWillDeleteFilesHandlerFunc is the function signature for the `workspace/willDeleteFiles` method.
type WorkspaceWillRenameFilesHandlerFunc ¶
type WorkspaceWillRenameFilesHandlerFunc func( context *common.LSPContext, params *RenameFilesParams, ) (*WorkspaceEdit, error)
WorkspaceWillRenameFilesHandlerFunc is the function signature for the `workspace/willRenameFiles` method.
Source Files
¶
- base_protocol.go
- base_structures.go
- diagnostics.go
- dispatch.go
- errors.go
- handler.go
- handler_language_features.go
- handler_server_capabilities.go
- handler_workspace_features.go
- language_feature_capabilities.go
- language_features.go
- lifecycle_messages.go
- notebook_document_sync.go
- registration.go
- text_document_sync.go
- trace.go
- trace_service.go
- windows.go
- workspaces.go