Documentation
¶
Overview ¶
Generated code. Do not edit
Index ¶
- func DetectLanguageID(uri string) protocol.LanguageKind
- func HandleApplyEdit(params json.RawMessage) (any, error)
- func HandleDiagnostics(client *Client, params json.RawMessage)
- func HandleRegisterCapability(params json.RawMessage) (any, error)
- func HandleServerMessage(params json.RawMessage)
- func HandleWorkspaceConfiguration(params json.RawMessage) (any, error)
- func RegisterFileWatchHandler(handler FileWatchRegistrationHandler)
- func WriteMessage(w io.Writer, msg *Message) error
- type Client
- func (c *Client) Call(ctx context.Context, method string, params any, result any) error
- func (c *Client) ClearDiagnosticsForURI(uri protocol.DocumentUri)
- func (c *Client) Close() error
- func (c *Client) CloseAllFiles(ctx context.Context)
- func (c *Client) CloseFile(ctx context.Context, filepath string) error
- func (c *Client) CodeAction(ctx context.Context, params protocol.CodeActionParams) ([]protocol.Or_Result_textDocument_codeAction_Item0_Elem, error)
- func (c *Client) CodeLens(ctx context.Context, params protocol.CodeLensParams) ([]protocol.CodeLens, error)
- func (c *Client) ColorPresentation(ctx context.Context, params protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
- func (c *Client) Completion(ctx context.Context, params protocol.CompletionParams) (protocol.Or_Result_textDocument_completion, error)
- func (c *Client) Declaration(ctx context.Context, params protocol.DeclarationParams) (protocol.Or_Result_textDocument_declaration, error)
- func (c *Client) Definition(ctx context.Context, params protocol.DefinitionParams) (protocol.Or_Result_textDocument_definition, error)
- func (c *Client) Diagnostic(ctx context.Context, params protocol.DocumentDiagnosticParams) (protocol.DocumentDiagnosticReport, error)
- func (c *Client) DiagnosticWorkspace(ctx context.Context, params protocol.WorkspaceDiagnosticParams) (protocol.WorkspaceDiagnosticReport, error)
- func (c *Client) DidChange(ctx context.Context, params protocol.DidChangeTextDocumentParams) error
- func (c *Client) DidChangeConfiguration(ctx context.Context, params protocol.DidChangeConfigurationParams) error
- func (c *Client) DidChangeNotebookDocument(ctx context.Context, params protocol.DidChangeNotebookDocumentParams) error
- func (c *Client) DidChangeWatchedFiles(ctx context.Context, params protocol.DidChangeWatchedFilesParams) error
- func (c *Client) DidChangeWorkspaceFolders(ctx context.Context, params protocol.DidChangeWorkspaceFoldersParams) error
- func (c *Client) DidClose(ctx context.Context, params protocol.DidCloseTextDocumentParams) error
- func (c *Client) DidCloseNotebookDocument(ctx context.Context, params protocol.DidCloseNotebookDocumentParams) error
- func (c *Client) DidCreateFiles(ctx context.Context, params protocol.CreateFilesParams) error
- func (c *Client) DidDeleteFiles(ctx context.Context, params protocol.DeleteFilesParams) error
- func (c *Client) DidOpen(ctx context.Context, params protocol.DidOpenTextDocumentParams) error
- func (c *Client) DidOpenNotebookDocument(ctx context.Context, params protocol.DidOpenNotebookDocumentParams) error
- func (c *Client) DidRenameFiles(ctx context.Context, params protocol.RenameFilesParams) error
- func (c *Client) DidSave(ctx context.Context, params protocol.DidSaveTextDocumentParams) error
- func (c *Client) DidSaveNotebookDocument(ctx context.Context, params protocol.DidSaveNotebookDocumentParams) error
- func (c *Client) DocumentColor(ctx context.Context, params protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
- func (c *Client) DocumentHighlight(ctx context.Context, params protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
- func (c *Client) DocumentLink(ctx context.Context, params protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
- func (c *Client) DocumentSymbol(ctx context.Context, params protocol.DocumentSymbolParams) (protocol.Or_Result_textDocument_documentSymbol, error)
- func (c *Client) ExecuteCommand(ctx context.Context, params protocol.ExecuteCommandParams) (any, error)
- func (c *Client) Exit(ctx context.Context) error
- func (c *Client) FoldingRange(ctx context.Context, params protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
- func (c *Client) Formatting(ctx context.Context, params protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
- func (c *Client) GetDiagnostics() map[protocol.DocumentUri][]protocol.Diagnostic
- func (c *Client) GetDiagnosticsForFile(ctx context.Context, filepath string) ([]protocol.Diagnostic, error)
- func (c *Client) GetFileDiagnostics(uri protocol.DocumentUri) []protocol.Diagnostic
- func (c *Client) GetServerState() ServerState
- func (c *Client) Hover(ctx context.Context, params protocol.HoverParams) (protocol.Hover, error)
- func (c *Client) Implementation(ctx context.Context, params protocol.ImplementationParams) (protocol.Or_Result_textDocument_implementation, error)
- func (c *Client) IncomingCalls(ctx context.Context, params protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
- func (c *Client) Initialize(ctx context.Context, params protocol.ParamInitialize) (protocol.InitializeResult, error)
- func (c *Client) InitializeLSPClient(ctx context.Context, workspaceDir string) (*protocol.InitializeResult, error)
- func (c *Client) Initialized(ctx context.Context, params protocol.InitializedParams) error
- func (c *Client) InlayHint(ctx context.Context, params protocol.InlayHintParams) ([]protocol.InlayHint, error)
- func (c *Client) InlineCompletion(ctx context.Context, params protocol.InlineCompletionParams) (protocol.Or_Result_textDocument_inlineCompletion, error)
- func (c *Client) InlineValue(ctx context.Context, params protocol.InlineValueParams) ([]protocol.InlineValue, error)
- func (c *Client) IsFileOpen(filepath string) bool
- func (c *Client) LinkedEditingRange(ctx context.Context, params protocol.LinkedEditingRangeParams) (protocol.LinkedEditingRanges, error)
- func (c *Client) Moniker(ctx context.Context, params protocol.MonikerParams) ([]protocol.Moniker, error)
- func (c *Client) Notify(ctx context.Context, method string, params any) error
- func (c *Client) NotifyChange(ctx context.Context, filepath string) error
- func (c *Client) OnTypeFormatting(ctx context.Context, params protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
- func (c *Client) OpenFile(ctx context.Context, filepath string) error
- func (c *Client) OpenFileOnDemand(ctx context.Context, filepath string) error
- func (c *Client) OutgoingCalls(ctx context.Context, params protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
- func (c *Client) PrepareCallHierarchy(ctx context.Context, params protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
- func (c *Client) PrepareRename(ctx context.Context, params protocol.PrepareRenameParams) (protocol.PrepareRenameResult, error)
- func (c *Client) PrepareTypeHierarchy(ctx context.Context, params protocol.TypeHierarchyPrepareParams) ([]protocol.TypeHierarchyItem, error)
- func (c *Client) Progress(ctx context.Context, params protocol.ProgressParams) error
- func (c *Client) RangeFormatting(ctx context.Context, params protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
- func (c *Client) RangesFormatting(ctx context.Context, params protocol.DocumentRangesFormattingParams) ([]protocol.TextEdit, error)
- func (c *Client) References(ctx context.Context, params protocol.ReferenceParams) ([]protocol.Location, error)
- func (c *Client) RegisterNotificationHandler(method string, handler NotificationHandler)
- func (c *Client) RegisterServerRequestHandler(method string, handler ServerRequestHandler)
- func (c *Client) Rename(ctx context.Context, params protocol.RenameParams) (protocol.WorkspaceEdit, error)
- func (c *Client) Resolve(ctx context.Context, params protocol.InlayHint) (protocol.InlayHint, error)
- func (c *Client) ResolveCodeAction(ctx context.Context, params protocol.CodeAction) (protocol.CodeAction, error)
- func (c *Client) ResolveCodeLens(ctx context.Context, params protocol.CodeLens) (protocol.CodeLens, error)
- func (c *Client) ResolveCompletionItem(ctx context.Context, params protocol.CompletionItem) (protocol.CompletionItem, error)
- func (c *Client) ResolveDocumentLink(ctx context.Context, params protocol.DocumentLink) (protocol.DocumentLink, error)
- func (c *Client) ResolveWorkspaceSymbol(ctx context.Context, params protocol.WorkspaceSymbol) (protocol.WorkspaceSymbol, error)
- func (c *Client) SelectionRange(ctx context.Context, params protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
- func (c *Client) SemanticTokensFull(ctx context.Context, params protocol.SemanticTokensParams) (protocol.SemanticTokens, error)
- func (c *Client) SemanticTokensFullDelta(ctx context.Context, params protocol.SemanticTokensDeltaParams) (protocol.Or_Result_textDocument_semanticTokens_full_delta, error)
- func (c *Client) SemanticTokensRange(ctx context.Context, params protocol.SemanticTokensRangeParams) (protocol.SemanticTokens, error)
- func (c *Client) SetServerState(state ServerState)
- func (c *Client) SetTrace(ctx context.Context, params protocol.SetTraceParams) error
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) SignatureHelp(ctx context.Context, params protocol.SignatureHelpParams) (protocol.SignatureHelp, error)
- func (c *Client) Subtypes(ctx context.Context, params protocol.TypeHierarchySubtypesParams) ([]protocol.TypeHierarchyItem, error)
- func (c *Client) Supertypes(ctx context.Context, params protocol.TypeHierarchySupertypesParams) ([]protocol.TypeHierarchyItem, error)
- func (c *Client) Symbol(ctx context.Context, params protocol.WorkspaceSymbolParams) (protocol.Or_Result_workspace_symbol, error)
- func (c *Client) TextDocumentContent(ctx context.Context, params protocol.TextDocumentContentParams) (string, error)
- func (c *Client) TypeDefinition(ctx context.Context, params protocol.TypeDefinitionParams) (protocol.Or_Result_textDocument_typeDefinition, error)
- func (c *Client) WaitForServerReady(ctx context.Context) error
- func (c *Client) WillCreateFiles(ctx context.Context, params protocol.CreateFilesParams) (protocol.WorkspaceEdit, error)
- func (c *Client) WillDeleteFiles(ctx context.Context, params protocol.DeleteFilesParams) (protocol.WorkspaceEdit, error)
- func (c *Client) WillRenameFiles(ctx context.Context, params protocol.RenameFilesParams) (protocol.WorkspaceEdit, error)
- func (c *Client) WillSave(ctx context.Context, params protocol.WillSaveTextDocumentParams) error
- func (c *Client) WillSaveWaitUntil(ctx context.Context, params protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
- func (c *Client) WorkDoneProgressCancel(ctx context.Context, params protocol.WorkDoneProgressCancelParams) error
- type FileWatchRegistrationHandler
- type Message
- type NotificationHandler
- type OpenFileInfo
- type ResponseError
- type ServerRequestHandler
- type ServerState
- type ServerType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectLanguageID ¶
func DetectLanguageID(uri string) protocol.LanguageKind
func HandleApplyEdit ¶
func HandleApplyEdit(params json.RawMessage) (any, error)
func HandleDiagnostics ¶
func HandleDiagnostics(client *Client, params json.RawMessage)
func HandleRegisterCapability ¶
func HandleRegisterCapability(params json.RawMessage) (any, error)
func HandleServerMessage ¶
func HandleServerMessage(params json.RawMessage)
func HandleWorkspaceConfiguration ¶
func HandleWorkspaceConfiguration(params json.RawMessage) (any, error)
func RegisterFileWatchHandler ¶
func RegisterFileWatchHandler(handler FileWatchRegistrationHandler)
RegisterFileWatchHandler sets the handler for file watch registrations
Types ¶
type Client ¶
func (*Client) ClearDiagnosticsForURI ¶ added in v0.0.36
func (c *Client) ClearDiagnosticsForURI(uri protocol.DocumentUri)
ClearDiagnosticsForURI removes diagnostics for a specific URI from the cache
func (*Client) CloseAllFiles ¶
CloseAllFiles closes all currently open files
func (*Client) CodeAction ¶
func (c *Client) CodeAction(ctx context.Context, params protocol.CodeActionParams) ([]protocol.Or_Result_textDocument_codeAction_Item0_Elem, error)
CodeAction sends a textDocument/codeAction request to the LSP server. A request to provide commands for the given text document and range.
func (*Client) CodeLens ¶
func (c *Client) CodeLens(ctx context.Context, params protocol.CodeLensParams) ([]protocol.CodeLens, error)
CodeLens sends a textDocument/codeLens request to the LSP server. A request to provide code lens for the given text document.
func (*Client) ColorPresentation ¶
func (c *Client) ColorPresentation(ctx context.Context, params protocol.ColorPresentationParams) ([]protocol.ColorPresentation, error)
ColorPresentation sends a textDocument/colorPresentation request to the LSP server. A request to list all presentation for a color. The request's parameter is of type ColorPresentationParams the response is of type ColorInformation ColorInformation[] or a Thenable that resolves to such.
func (*Client) Completion ¶
func (c *Client) Completion(ctx context.Context, params protocol.CompletionParams) (protocol.Or_Result_textDocument_completion, error)
Completion sends a textDocument/completion request to the LSP server. Request to request completion at a given text document position. The request's parameter is of type TextDocumentPosition the response is of type CompletionItem CompletionItem[] or CompletionList or a Thenable that resolves to such. The request can delay the computation of the CompletionItem.detail detail and CompletionItem.documentation documentation properties to the completionItem/resolve request. However, properties that are needed for the initial sorting and filtering, like sortText, filterText, insertText, and textEdit, must not be changed during resolve.
func (*Client) Declaration ¶
func (c *Client) Declaration(ctx context.Context, params protocol.DeclarationParams) (protocol.Or_Result_textDocument_declaration, error)
Declaration sends a textDocument/declaration request to the LSP server. A request to resolve the type definition locations of a symbol at a given text document position. The request's parameter is of type TextDocumentPositionParams the response is of type Declaration or a typed array of DeclarationLink or a Thenable that resolves to such.
func (*Client) Definition ¶
func (c *Client) Definition(ctx context.Context, params protocol.DefinitionParams) (protocol.Or_Result_textDocument_definition, error)
Definition sends a textDocument/definition request to the LSP server. A request to resolve the definition location of a symbol at a given text document position. The request's parameter is of type TextDocumentPosition the response is of either type Definition or a typed array of DefinitionLink or a Thenable that resolves to such.
func (*Client) Diagnostic ¶
func (c *Client) Diagnostic(ctx context.Context, params protocol.DocumentDiagnosticParams) (protocol.DocumentDiagnosticReport, error)
Diagnostic sends a textDocument/diagnostic request to the LSP server. The document diagnostic request definition. Since 3.17.0
func (*Client) DiagnosticWorkspace ¶
func (c *Client) DiagnosticWorkspace(ctx context.Context, params protocol.WorkspaceDiagnosticParams) (protocol.WorkspaceDiagnosticReport, error)
DiagnosticWorkspace sends a workspace/diagnostic request to the LSP server. The workspace diagnostic request definition. Since 3.17.0
func (*Client) DidChange ¶
DidChange sends a textDocument/didChange notification to the LSP server. The document change notification is sent from the client to the server to signal changes to a text document.
func (*Client) DidChangeConfiguration ¶
func (c *Client) DidChangeConfiguration(ctx context.Context, params protocol.DidChangeConfigurationParams) error
DidChangeConfiguration sends a workspace/didChangeConfiguration notification to the LSP server. The configuration change notification is sent from the client to the server when the client's configuration has changed. The notification contains the changed configuration as defined by the language client.
func (*Client) DidChangeNotebookDocument ¶
func (c *Client) DidChangeNotebookDocument(ctx context.Context, params protocol.DidChangeNotebookDocumentParams) error
DidChangeNotebookDocument sends a notebookDocument/didChange notification to the LSP server.
func (*Client) DidChangeWatchedFiles ¶
func (c *Client) DidChangeWatchedFiles(ctx context.Context, params protocol.DidChangeWatchedFilesParams) error
DidChangeWatchedFiles sends a workspace/didChangeWatchedFiles notification to the LSP server. The watched files notification is sent from the client to the server when the client detects changes to file watched by the language client.
func (*Client) DidChangeWorkspaceFolders ¶
func (c *Client) DidChangeWorkspaceFolders(ctx context.Context, params protocol.DidChangeWorkspaceFoldersParams) error
DidChangeWorkspaceFolders sends a workspace/didChangeWorkspaceFolders notification to the LSP server. The workspace/didChangeWorkspaceFolders notification is sent from the client to the server when the workspace folder configuration changes.
func (*Client) DidClose ¶
DidClose sends a textDocument/didClose notification to the LSP server. The document close notification is sent from the client to the server when the document got closed in the client. The document's truth now exists where the document's uri points to (e.g. if the document's uri is a file uri the truth now exists on disk). As with the open notification the close notification is about managing the document's content. Receiving a close notification doesn't mean that the document was open in an editor before. A close notification requires a previous open notification to be sent.
func (*Client) DidCloseNotebookDocument ¶
func (c *Client) DidCloseNotebookDocument(ctx context.Context, params protocol.DidCloseNotebookDocumentParams) error
DidCloseNotebookDocument sends a notebookDocument/didClose notification to the LSP server. A notification sent when a notebook closes. Since 3.17.0
func (*Client) DidCreateFiles ¶
DidCreateFiles sends a workspace/didCreateFiles notification to the LSP server. The did create files notification is sent from the client to the server when files were created from within the client. Since 3.16.0
func (*Client) DidDeleteFiles ¶
DidDeleteFiles sends a workspace/didDeleteFiles notification to the LSP server. The will delete files request is sent from the client to the server before files are actually deleted as long as the deletion is triggered from within the client. Since 3.16.0
func (*Client) DidOpen ¶
DidOpen sends a textDocument/didOpen notification to the LSP server. The document open notification is sent from the client to the server to signal newly opened text documents. The document's truth is now managed by the client and the server must not try to read the document's truth using the document's uri. Open in this sense means it is managed by the client. It doesn't necessarily mean that its content is presented in an editor. An open notification must not be sent more than once without a corresponding close notification send before. This means open and close notification must be balanced and the max open count is one.
func (*Client) DidOpenNotebookDocument ¶
func (c *Client) DidOpenNotebookDocument(ctx context.Context, params protocol.DidOpenNotebookDocumentParams) error
DidOpenNotebookDocument sends a notebookDocument/didOpen notification to the LSP server. A notification sent when a notebook opens. Since 3.17.0
func (*Client) DidRenameFiles ¶
DidRenameFiles sends a workspace/didRenameFiles notification to the LSP server. The did rename files notification is sent from the client to the server when files were renamed from within the client. Since 3.16.0
func (*Client) DidSave ¶
DidSave sends a textDocument/didSave notification to the LSP server. The document save notification is sent from the client to the server when the document got saved in the client.
func (*Client) DidSaveNotebookDocument ¶
func (c *Client) DidSaveNotebookDocument(ctx context.Context, params protocol.DidSaveNotebookDocumentParams) error
DidSaveNotebookDocument sends a notebookDocument/didSave notification to the LSP server. A notification sent when a notebook document is saved. Since 3.17.0
func (*Client) DocumentColor ¶
func (c *Client) DocumentColor(ctx context.Context, params protocol.DocumentColorParams) ([]protocol.ColorInformation, error)
DocumentColor sends a textDocument/documentColor request to the LSP server. A request to list all color symbols found in a given text document. The request's parameter is of type DocumentColorParams the response is of type ColorInformation ColorInformation[] or a Thenable that resolves to such.
func (*Client) DocumentHighlight ¶
func (c *Client) DocumentHighlight(ctx context.Context, params protocol.DocumentHighlightParams) ([]protocol.DocumentHighlight, error)
DocumentHighlight sends a textDocument/documentHighlight request to the LSP server. Request to resolve a DocumentHighlight for a given text document position. The request's parameter is of type TextDocumentPosition the request response is an array of type DocumentHighlight or a Thenable that resolves to such.
func (*Client) DocumentLink ¶
func (c *Client) DocumentLink(ctx context.Context, params protocol.DocumentLinkParams) ([]protocol.DocumentLink, error)
DocumentLink sends a textDocument/documentLink request to the LSP server. A request to provide document links
func (*Client) DocumentSymbol ¶
func (c *Client) DocumentSymbol(ctx context.Context, params protocol.DocumentSymbolParams) (protocol.Or_Result_textDocument_documentSymbol, error)
DocumentSymbol sends a textDocument/documentSymbol request to the LSP server. A request to list all symbols found in a given text document. The request's parameter is of type TextDocumentIdentifier the response is of type SymbolInformation SymbolInformation[] or a Thenable that resolves to such.
func (*Client) ExecuteCommand ¶
func (c *Client) ExecuteCommand(ctx context.Context, params protocol.ExecuteCommandParams) (any, error)
ExecuteCommand sends a workspace/executeCommand request to the LSP server. A request send from the client to the server to execute a command. The request might return a workspace edit which the client will apply to the workspace.
func (*Client) Exit ¶
Exit sends a exit notification to the LSP server. The exit event is sent from the client to the server to ask the server to exit its process.
func (*Client) FoldingRange ¶
func (c *Client) FoldingRange(ctx context.Context, params protocol.FoldingRangeParams) ([]protocol.FoldingRange, error)
FoldingRange sends a textDocument/foldingRange request to the LSP server. A request to provide folding ranges in a document. The request's parameter is of type FoldingRangeParams, the response is of type FoldingRangeList or a Thenable that resolves to such.
func (*Client) Formatting ¶
func (c *Client) Formatting(ctx context.Context, params protocol.DocumentFormattingParams) ([]protocol.TextEdit, error)
Formatting sends a textDocument/formatting request to the LSP server. A request to format a whole document.
func (*Client) GetDiagnostics ¶
func (c *Client) GetDiagnostics() map[protocol.DocumentUri][]protocol.Diagnostic
GetDiagnostics returns all diagnostics for all files
func (*Client) GetDiagnosticsForFile ¶
func (c *Client) GetDiagnosticsForFile(ctx context.Context, filepath string) ([]protocol.Diagnostic, error)
GetDiagnosticsForFile ensures a file is open and returns its diagnostics This is useful for on-demand diagnostics when using lazy loading
func (*Client) GetFileDiagnostics ¶
func (c *Client) GetFileDiagnostics(uri protocol.DocumentUri) []protocol.Diagnostic
func (*Client) GetServerState ¶
func (c *Client) GetServerState() ServerState
GetServerState returns the current state of the LSP server
func (*Client) Hover ¶
Hover sends a textDocument/hover request to the LSP server. Request to request hover information at a given text document position. The request's parameter is of type TextDocumentPosition the response is of type Hover or a Thenable that resolves to such.
func (*Client) Implementation ¶
func (c *Client) Implementation(ctx context.Context, params protocol.ImplementationParams) (protocol.Or_Result_textDocument_implementation, error)
Implementation sends a textDocument/implementation request to the LSP server. A request to resolve the implementation locations of a symbol at a given text document position. The request's parameter is of type TextDocumentPositionParams the response is of type Definition or a Thenable that resolves to such.
func (*Client) IncomingCalls ¶
func (c *Client) IncomingCalls(ctx context.Context, params protocol.CallHierarchyIncomingCallsParams) ([]protocol.CallHierarchyIncomingCall, error)
IncomingCalls sends a callHierarchy/incomingCalls request to the LSP server. A request to resolve the incoming calls for a given CallHierarchyItem. Since 3.16.0
func (*Client) Initialize ¶
func (c *Client) Initialize(ctx context.Context, params protocol.ParamInitialize) (protocol.InitializeResult, error)
Initialize sends a initialize request to the LSP server. The initialize request is sent from the client to the server. It is sent once as the request after starting up the server. The requests parameter is of type InitializeParams the response if of type InitializeResult of a Thenable that resolves to such.
func (*Client) InitializeLSPClient ¶
func (*Client) Initialized ¶
Initialized sends a initialized notification to the LSP server. The initialized notification is sent from the client to the server after the client is fully initialized and the server is allowed to send requests from the server to the client.
func (*Client) InlayHint ¶
func (c *Client) InlayHint(ctx context.Context, params protocol.InlayHintParams) ([]protocol.InlayHint, error)
InlayHint sends a textDocument/inlayHint request to the LSP server. A request to provide inlay hints in a document. The request's parameter is of type InlayHintsParams, the response is of type InlayHint InlayHint[] or a Thenable that resolves to such. Since 3.17.0
func (*Client) InlineCompletion ¶
func (c *Client) InlineCompletion(ctx context.Context, params protocol.InlineCompletionParams) (protocol.Or_Result_textDocument_inlineCompletion, error)
InlineCompletion sends a textDocument/inlineCompletion request to the LSP server. A request to provide inline completions in a document. The request's parameter is of type InlineCompletionParams, the response is of type InlineCompletion InlineCompletion[] or a Thenable that resolves to such. Since 3.18.0 PROPOSED
func (*Client) InlineValue ¶
func (c *Client) InlineValue(ctx context.Context, params protocol.InlineValueParams) ([]protocol.InlineValue, error)
InlineValue sends a textDocument/inlineValue request to the LSP server. A request to provide inline values in a document. The request's parameter is of type InlineValueParams, the response is of type InlineValue InlineValue[] or a Thenable that resolves to such. Since 3.17.0
func (*Client) IsFileOpen ¶
func (*Client) LinkedEditingRange ¶
func (c *Client) LinkedEditingRange(ctx context.Context, params protocol.LinkedEditingRangeParams) (protocol.LinkedEditingRanges, error)
LinkedEditingRange sends a textDocument/linkedEditingRange request to the LSP server. A request to provide ranges that can be edited together. Since 3.16.0
func (*Client) Moniker ¶
func (c *Client) Moniker(ctx context.Context, params protocol.MonikerParams) ([]protocol.Moniker, error)
Moniker sends a textDocument/moniker request to the LSP server. A request to get the moniker of a symbol at a given text document position. The request parameter is of type TextDocumentPositionParams. The response is of type Moniker Moniker[] or null.
func (*Client) Notify ¶
Notify sends a notification (a request without an ID that doesn't expect a response)
func (*Client) NotifyChange ¶
func (*Client) OnTypeFormatting ¶
func (c *Client) OnTypeFormatting(ctx context.Context, params protocol.DocumentOnTypeFormattingParams) ([]protocol.TextEdit, error)
OnTypeFormatting sends a textDocument/onTypeFormatting request to the LSP server. A request to format a document on type.
func (*Client) OpenFileOnDemand ¶
OpenFileOnDemand opens a file only if it's not already open This is used for lazy-loading files when they're actually needed
func (*Client) OutgoingCalls ¶
func (c *Client) OutgoingCalls(ctx context.Context, params protocol.CallHierarchyOutgoingCallsParams) ([]protocol.CallHierarchyOutgoingCall, error)
OutgoingCalls sends a callHierarchy/outgoingCalls request to the LSP server. A request to resolve the outgoing calls for a given CallHierarchyItem. Since 3.16.0
func (*Client) PrepareCallHierarchy ¶
func (c *Client) PrepareCallHierarchy(ctx context.Context, params protocol.CallHierarchyPrepareParams) ([]protocol.CallHierarchyItem, error)
PrepareCallHierarchy sends a textDocument/prepareCallHierarchy request to the LSP server. A request to result a CallHierarchyItem in a document at a given position. Can be used as an input to an incoming or outgoing call hierarchy. Since 3.16.0
func (*Client) PrepareRename ¶
func (c *Client) PrepareRename(ctx context.Context, params protocol.PrepareRenameParams) (protocol.PrepareRenameResult, error)
PrepareRename sends a textDocument/prepareRename request to the LSP server. A request to test and perform the setup necessary for a rename. Since 3.16 - support for default behavior
func (*Client) PrepareTypeHierarchy ¶
func (c *Client) PrepareTypeHierarchy(ctx context.Context, params protocol.TypeHierarchyPrepareParams) ([]protocol.TypeHierarchyItem, error)
PrepareTypeHierarchy sends a textDocument/prepareTypeHierarchy request to the LSP server. A request to result a TypeHierarchyItem in a document at a given position. Can be used as an input to a subtypes or supertypes type hierarchy. Since 3.17.0
func (*Client) RangeFormatting ¶
func (c *Client) RangeFormatting(ctx context.Context, params protocol.DocumentRangeFormattingParams) ([]protocol.TextEdit, error)
RangeFormatting sends a textDocument/rangeFormatting request to the LSP server. A request to format a range in a document.
func (*Client) RangesFormatting ¶
func (c *Client) RangesFormatting(ctx context.Context, params protocol.DocumentRangesFormattingParams) ([]protocol.TextEdit, error)
RangesFormatting sends a textDocument/rangesFormatting request to the LSP server. A request to format ranges in a document. Since 3.18.0 PROPOSED
func (*Client) References ¶
func (c *Client) References(ctx context.Context, params protocol.ReferenceParams) ([]protocol.Location, error)
References sends a textDocument/references request to the LSP server. A request to resolve project-wide references for the symbol denoted by the given text document position. The request's parameter is of type ReferenceParams the response is of type Location Location[] or a Thenable that resolves to such.
func (*Client) RegisterNotificationHandler ¶
func (c *Client) RegisterNotificationHandler(method string, handler NotificationHandler)
func (*Client) RegisterServerRequestHandler ¶
func (c *Client) RegisterServerRequestHandler(method string, handler ServerRequestHandler)
func (*Client) Rename ¶
func (c *Client) Rename(ctx context.Context, params protocol.RenameParams) (protocol.WorkspaceEdit, error)
Rename sends a textDocument/rename request to the LSP server. A request to rename a symbol.
func (*Client) Resolve ¶
func (c *Client) Resolve(ctx context.Context, params protocol.InlayHint) (protocol.InlayHint, error)
Resolve sends a inlayHint/resolve request to the LSP server. A request to resolve additional properties for an inlay hint. The request's parameter is of type InlayHint, the response is of type InlayHint or a Thenable that resolves to such. Since 3.17.0
func (*Client) ResolveCodeAction ¶
func (c *Client) ResolveCodeAction(ctx context.Context, params protocol.CodeAction) (protocol.CodeAction, error)
ResolveCodeAction sends a codeAction/resolve request to the LSP server. Request to resolve additional information for a given code action.The request's parameter is of type CodeAction the response is of type CodeAction or a Thenable that resolves to such.
func (*Client) ResolveCodeLens ¶
func (c *Client) ResolveCodeLens(ctx context.Context, params protocol.CodeLens) (protocol.CodeLens, error)
ResolveCodeLens sends a codeLens/resolve request to the LSP server. A request to resolve a command for a given code lens.
func (*Client) ResolveCompletionItem ¶
func (c *Client) ResolveCompletionItem(ctx context.Context, params protocol.CompletionItem) (protocol.CompletionItem, error)
ResolveCompletionItem sends a completionItem/resolve request to the LSP server. Request to resolve additional information for a given completion item.The request's parameter is of type CompletionItem the response is of type CompletionItem or a Thenable that resolves to such.
func (*Client) ResolveDocumentLink ¶
func (c *Client) ResolveDocumentLink(ctx context.Context, params protocol.DocumentLink) (protocol.DocumentLink, error)
ResolveDocumentLink sends a documentLink/resolve request to the LSP server. Request to resolve additional information for a given document link. The request's parameter is of type DocumentLink the response is of type DocumentLink or a Thenable that resolves to such.
func (*Client) ResolveWorkspaceSymbol ¶
func (c *Client) ResolveWorkspaceSymbol(ctx context.Context, params protocol.WorkspaceSymbol) (protocol.WorkspaceSymbol, error)
ResolveWorkspaceSymbol sends a workspaceSymbol/resolve request to the LSP server. A request to resolve the range inside the workspace symbol's location. Since 3.17.0
func (*Client) SelectionRange ¶
func (c *Client) SelectionRange(ctx context.Context, params protocol.SelectionRangeParams) ([]protocol.SelectionRange, error)
SelectionRange sends a textDocument/selectionRange request to the LSP server. A request to provide selection ranges in a document. The request's parameter is of type SelectionRangeParams, the response is of type SelectionRange SelectionRange[] or a Thenable that resolves to such.
func (*Client) SemanticTokensFull ¶
func (c *Client) SemanticTokensFull(ctx context.Context, params protocol.SemanticTokensParams) (protocol.SemanticTokens, error)
SemanticTokensFull sends a textDocument/semanticTokens/full request to the LSP server. Since 3.16.0
func (*Client) SemanticTokensFullDelta ¶
func (c *Client) SemanticTokensFullDelta(ctx context.Context, params protocol.SemanticTokensDeltaParams) (protocol.Or_Result_textDocument_semanticTokens_full_delta, error)
SemanticTokensFullDelta sends a textDocument/semanticTokens/full/delta request to the LSP server. Since 3.16.0
func (*Client) SemanticTokensRange ¶
func (c *Client) SemanticTokensRange(ctx context.Context, params protocol.SemanticTokensRangeParams) (protocol.SemanticTokens, error)
SemanticTokensRange sends a textDocument/semanticTokens/range request to the LSP server. Since 3.16.0
func (*Client) SetServerState ¶
func (c *Client) SetServerState(state ServerState)
SetServerState sets the current state of the LSP server
func (*Client) Shutdown ¶
Shutdown sends a shutdown request to the LSP server. A shutdown request is sent from the client to the server. It is sent once when the client decides to shutdown the server. The only notification that is sent after a shutdown request is the exit event.
func (*Client) SignatureHelp ¶
func (c *Client) SignatureHelp(ctx context.Context, params protocol.SignatureHelpParams) (protocol.SignatureHelp, error)
SignatureHelp sends a textDocument/signatureHelp request to the LSP server.
func (*Client) Subtypes ¶
func (c *Client) Subtypes(ctx context.Context, params protocol.TypeHierarchySubtypesParams) ([]protocol.TypeHierarchyItem, error)
Subtypes sends a typeHierarchy/subtypes request to the LSP server. A request to resolve the subtypes for a given TypeHierarchyItem. Since 3.17.0
func (*Client) Supertypes ¶
func (c *Client) Supertypes(ctx context.Context, params protocol.TypeHierarchySupertypesParams) ([]protocol.TypeHierarchyItem, error)
Supertypes sends a typeHierarchy/supertypes request to the LSP server. A request to resolve the supertypes for a given TypeHierarchyItem. Since 3.17.0
func (*Client) Symbol ¶
func (c *Client) Symbol(ctx context.Context, params protocol.WorkspaceSymbolParams) (protocol.Or_Result_workspace_symbol, error)
Symbol sends a workspace/symbol request to the LSP server. A request to list project-wide symbols matching the query string given by the WorkspaceSymbolParams. The response is of type SymbolInformation SymbolInformation[] or a Thenable that resolves to such. Since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients need to advertise support for WorkspaceSymbols via the client capability workspace.symbol.resolveSupport.
func (*Client) TextDocumentContent ¶
func (c *Client) TextDocumentContent(ctx context.Context, params protocol.TextDocumentContentParams) (string, error)
TextDocumentContent sends a workspace/textDocumentContent request to the LSP server. The workspace/textDocumentContent request is sent from the client to the server to request the content of a text document. Since 3.18.0 PROPOSED
func (*Client) TypeDefinition ¶
func (c *Client) TypeDefinition(ctx context.Context, params protocol.TypeDefinitionParams) (protocol.Or_Result_textDocument_typeDefinition, error)
TypeDefinition sends a textDocument/typeDefinition request to the LSP server. A request to resolve the type definition locations of a symbol at a given text document position. The request's parameter is of type TextDocumentPositionParams the response is of type Definition or a Thenable that resolves to such.
func (*Client) WaitForServerReady ¶
WaitForServerReady waits for the server to be ready by polling the server with a simple request until it responds successfully or times out
func (*Client) WillCreateFiles ¶
func (c *Client) WillCreateFiles(ctx context.Context, params protocol.CreateFilesParams) (protocol.WorkspaceEdit, error)
WillCreateFiles sends a workspace/willCreateFiles request to the LSP server. The will create files request is sent from the client to the server before files are actually created as long as the creation is triggered from within the client. The request can return a WorkspaceEdit which will be applied to workspace before the files are created. Hence the WorkspaceEdit can not manipulate the content of the file to be created. Since 3.16.0
func (*Client) WillDeleteFiles ¶
func (c *Client) WillDeleteFiles(ctx context.Context, params protocol.DeleteFilesParams) (protocol.WorkspaceEdit, error)
WillDeleteFiles sends a workspace/willDeleteFiles request to the LSP server. The did delete files notification is sent from the client to the server when files were deleted from within the client. Since 3.16.0
func (*Client) WillRenameFiles ¶
func (c *Client) WillRenameFiles(ctx context.Context, params protocol.RenameFilesParams) (protocol.WorkspaceEdit, error)
WillRenameFiles sends a workspace/willRenameFiles request to the LSP server. The will rename files request is sent from the client to the server before files are actually renamed as long as the rename is triggered from within the client. Since 3.16.0
func (*Client) WillSave ¶
WillSave sends a textDocument/willSave notification to the LSP server. A document will save notification is sent from the client to the server before the document is actually saved.
func (*Client) WillSaveWaitUntil ¶
func (c *Client) WillSaveWaitUntil(ctx context.Context, params protocol.WillSaveTextDocumentParams) ([]protocol.TextEdit, error)
WillSaveWaitUntil sends a textDocument/willSaveWaitUntil request to the LSP server. A document will save request is sent from the client to the server before the document is actually saved. The request can return an array of TextEdits which will be applied to the text document before it is saved. Please note that clients might drop results if computing the text edits took too long or if a server constantly fails on this request. This is done to keep the save fast and reliable.
func (*Client) WorkDoneProgressCancel ¶
func (c *Client) WorkDoneProgressCancel(ctx context.Context, params protocol.WorkDoneProgressCancelParams) error
WorkDoneProgressCancel sends a window/workDoneProgress/cancel notification to the LSP server. The window/workDoneProgress/cancel notification is sent from the client to the server to cancel a progress initiated on the server side.
type FileWatchRegistrationHandler ¶
type FileWatchRegistrationHandler func(id string, watchers []protocol.FileSystemWatcher)
FileWatchRegistrationHandler is a function that will be called when file watch registrations are received
type Message ¶
type Message struct { JSONRPC string `json:"jsonrpc"` ID int32 `json:"id,omitempty"` Method string `json:"method,omitempty"` Params json.RawMessage `json:"params,omitempty"` Result json.RawMessage `json:"result,omitempty"` Error *ResponseError `json:"error,omitempty"` }
Message represents a JSON-RPC 2.0 message
type NotificationHandler ¶
type NotificationHandler func(params json.RawMessage)
type OpenFileInfo ¶
type OpenFileInfo struct { Version int32 URI protocol.DocumentUri }
type ResponseError ¶
ResponseError represents a JSON-RPC 2.0 error
type ServerRequestHandler ¶
type ServerRequestHandler func(params json.RawMessage) (any, error)
type ServerState ¶
type ServerState int
const ( StateStarting ServerState = iota StateReady StateError )
type ServerType ¶
type ServerType int
ServerType represents the type of LSP server
const ( ServerTypeUnknown ServerType = iota ServerTypeGo ServerTypeTypeScript ServerTypeRust ServerTypePython ServerTypeGeneric )