API Reference gen_lsp v0.8.1

modules

Modules

GenLSP is an OTP behaviour for building processes that implement the Language Server Protocol.

The data buffer between the LSP process and the communication channel.

Behaviour for implementing communication adapters for the GenLSP.Buffer module to use.

The Standard IO adapter.

The TCP adapter.

A set of predefined code action kinds

The reason why code actions were requested.

The kind of a completion entry.

Completion item tags are extra annotations that tweak the rendering of a completion item.

How a completion was triggered

The diagnostic's severity.

The diagnostic tags.

The document diagnostic report kinds.

A document highlight kind.

Predefined error codes.

A pattern kind describing if a glob pattern matches a file a folder or both.

A set of predefined range kinds.

Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.

How whitespace and indentation is handled during completion item insertion.

Describes the content type that a client supports in various result literals like Hover, ParameterInfo or CompletionItem.

A notebook cell kind.

A set of predefined position encoding kinds.

A set of predefined token modifiers. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.

A set of predefined token types. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.

How a signature help was triggered.

Symbol tags are extra annotations that tweak the rendering of a symbol.

Represents reasons why a text document is saved.

Defines how the host (editor) should sync document changes to the language server.

Moniker uniqueness level to define scope of the moniker.

A Response Message sent as a result of a request.

The exit event is sent from the client to the server to ask the server to exit its process.

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.

A notification sent when a notebook closes.

A notification sent when a notebook opens.

A notification sent when a notebook document is saved.

The telemetry event notification is sent from the server to the client to ask the client to log telemetry data.

The document change notification is sent from the client to the server to signal changes to a text document.

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.

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.

The document save notification is sent from the client to the server when the document got saved in the client.

Diagnostics notification are sent from the server to the client to signal results of validation runs.

A document will save notification is sent from the client to the server before the document is actually saved.

The log message notification is sent from the server to the client to ask the client to log a particular message.

The show message notification is sent from a server to a client to ask the client to display a particular message in the user interface.

The window/workDoneProgress/cancel notification is sent from the client to the server to cancel a progress initiated on the server side.

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.

The watched files notification is sent from the client to the server when the client detects changes to file watched by the language client.

The workspace/didChangeWorkspaceFolders notification is sent from the client to the server when the workspace folder configuration changes.

The did create files notification is sent from the client to the server when files were created from within the client.

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.

The did rename files notification is sent from the client to the server when files were renamed from within the client.

A request to resolve the incoming calls for a given CallHierarchyItem.

A request to resolve the outgoing calls for a given CallHierarchyItem.

The client/registerCapability request is sent from the server to the client to register a new capability handler on the client side.

The client/unregisterCapability request is sent from the server to the client to unregister a previously registered capability handler on the client side.

Request to resolve additional information for a given code action.The request's parameter is of type {@link CodeAction} the response is of type {@link CodeAction} or a Thenable that resolves to such.

A request to resolve a command for a given code lens.

Request to resolve additional information for a given completion item.The request's parameter is of type {@link CompletionItem} the response is of type {@link CompletionItem} or a Thenable that resolves to such.

Request to resolve additional information for a given document link. The request's parameter is of type {@link DocumentLink} the response is of type {@link DocumentLink} or a Thenable that resolves to such.

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 {@link InitializeParams} the response if of type {@link InitializeResult} of a Thenable that resolves to such.

A request to resolve additional properties for an inlay hint. The request's parameter is of type {@link InlayHint}, the response is of type {@link InlayHint} or a Thenable that resolves to such.

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.

A request to provide commands for the given text document and range.

A request to provide code lens for the given text document.

A request to list all presentation for a color. The request's parameter is of type {@link ColorPresentationParams} the response is of type {@link ColorInformation ColorInformation[]} or a Thenable that resolves to such.

Request to request completion at a given text document position. The request's parameter is of type {@link TextDocumentPosition} the response is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList} or a Thenable that resolves to such.

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] (#TextDocumentPositionParams) the response is of type {@link Declaration} or a typed array of {@link DeclarationLink} or a Thenable that resolves to such.

A request to resolve the definition location of a symbol at a given text document position. The request's parameter is of type [TextDocumentPosition] (#TextDocumentPosition) the response is of either type {@link Definition} or a typed array of {@link DefinitionLink} or a Thenable that resolves to such.

The document diagnostic request definition.

A request to list all color symbols found in a given text document. The request's parameter is of type {@link DocumentColorParams} the response is of type {@link ColorInformation ColorInformation[]} or a Thenable that resolves to such.

Request to resolve a {@link DocumentHighlight} for a given text document position. The request's parameter is of type [TextDocumentPosition] (#TextDocumentPosition) the request response is of type [DocumentHighlight[]] (#DocumentHighlight) or a Thenable that resolves to such.

A request to provide document links

A request to list all symbols found in a given text document. The request's parameter is of type {@link TextDocumentIdentifier} the response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable that resolves to such.

A request to provide folding ranges in a document. The request's parameter is of type {@link FoldingRangeParams}, the response is of type {@link FoldingRangeList} or a Thenable that resolves to such.

A request to format a whole document.

Request to request hover information at a given text document position. The request's parameter is of type {@link TextDocumentPosition} the response is of type {@link Hover} or a Thenable that resolves to such.

A request to resolve the implementation locations of a symbol at a given text document position. The request's parameter is of type [TextDocumentPositionParams] (#TextDocumentPositionParams) the response is of type {@link Definition} or a Thenable that resolves to such.

A request to provide inlay hints in a document. The request's parameter is of type {@link InlayHintsParams}, the response is of type {@link InlayHint InlayHint[]} or a Thenable that resolves to such.

A request to provide inline values in a document. The request's parameter is of type {@link InlineValueParams}, the response is of type {@link InlineValue InlineValue[]} or a Thenable that resolves to such.

A request to provide ranges that can be edited together.

A request to get the moniker of a symbol at a given text document position. The request parameter is of type {@link TextDocumentPositionParams}. The response is of type {@link Moniker Moniker[]} or null.

A request to format a document on type.

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.

A request to test and perform the setup necessary for a rename.

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.

A request to format a range in a document.

A request to resolve project-wide references for the symbol denoted by the given text document position. The request's parameter is of type {@link ReferenceParams} the response is of type {@link Location Location[]} or a Thenable that resolves to such.

A request to rename a symbol.

A request to provide selection ranges in a document. The request's parameter is of type {@link SelectionRangeParams}, the response is of type {@link SelectionRange SelectionRange[]} or a Thenable that resolves to such.

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] (#TextDocumentPositionParams) the response is of type {@link Definition} or a Thenable that resolves to such.

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.

A request to resolve the subtypes for a given TypeHierarchyItem.

A request to resolve the supertypes for a given TypeHierarchyItem.

A request to show a document. This request might open an external program depending on the value of the URI to open. For example a request to open https://code.visualstudio.com/ will very likely open the URI in a WEB browser.

The show message request is sent from the server to the client to show a message and a set of options actions to the user.

The window/workDoneProgress/create request is sent from the server to the client to initiate progress reporting from the server.

A request sent from the server to the client to modified certain resources.

A request to refresh all code actions

The 'workspace/configuration' request is sent from the server to the client to fetch a certain configuration setting.

The workspace diagnostic request definition.

The diagnostic refresh request definition.

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.

A request to list project-wide symbols matching the query string given by the {@link WorkspaceSymbolParams}. The response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable that resolves to such.

A request to resolve the range inside the workspace symbol's location.

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 did delete files notification is sent from the client to the server when files were deleted from within the client.

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.

The workspace/workspaceFolders is sent from the server to the client to fetch the open workspace folders.

A special text edit with an additional change annotation.

The parameters passed via an apply workspace edit request.

The result returned from the apply workspace edit request.

A base for all symbol information.

Represents an incoming call, e.g. a caller of a method or constructor.

The parameter of a callHierarchy/incomingCalls request.

Represents programming constructs like functions or constructors in the context of call hierarchy.

Call hierarchy options used during static registration.

Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.

The parameter of a callHierarchy/outgoingCalls request.

The parameter of a textDocument/prepareCallHierarchy request.

Call hierarchy options used during static or dynamic registration.

Additional information that describes document changes.

Defines the capabilities provided by the client.

A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.

The Client Capabilities of a {@link CodeActionRequest}.

Contains additional diagnostic information about the context in which a {@link CodeActionProvider.provideCodeActions code action} is run.

Provider options for a {@link CodeActionRequest}.

The parameters of a {@link CodeActionRequest}.

Registration options for a {@link CodeActionRequest}.

Structure to capture a description for an error code.

A code lens represents a {@link Command command} that should be shown along with source text, like the number of references, a way to run tests, etc.

The client capabilities of a {@link CodeLensRequest}.

Code Lens provider options of a {@link CodeLensRequest}.

The parameters of a {@link CodeLensRequest}.

Registration options for a {@link CodeLensRequest}.

Represents a color in RGBA space.

Represents a color range from a document.

Parameters for a {@link ColorPresentationRequest}.

Represents a reference to a command. Provides a title which will be used to represent a command in the UI and, optionally, an array of arguments which will be passed to the command handler function when invoked.

Completion client capabilities

Contains additional information about the context in which a completion request is triggered.

A completion item represents a text snippet that is proposed to complete text that is being typed.

Additional details for a completion item label.

Represents a collection of {@link CompletionItem completion items} to be presented in the editor.

Completion parameters

Registration options for a {@link CompletionRequest}.

The parameters of a configuration request.

Create file operation.

Options to create a file.

The parameters sent in notifications/requests for user-initiated creation of files.

Client Capabilities for a {@link DefinitionRequest}.

Server Capabilities for a {@link DefinitionRequest}.

Parameters for a {@link DefinitionRequest}.

Registration options for a {@link DefinitionRequest}.

Delete file operation

The parameters sent in notifications/requests for user-initiated deletes of files.

Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.

Client capabilities specific to diagnostic pull requests.

Diagnostic registration options.

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.

Cancellation data returned from a diagnostic request.

Workspace client capabilities specific to diagnostic pull requests.

The parameters of a change configuration notification.

The params sent in a change notebook document notification.

The change text document notification's parameters.

The watched files change notification's parameters.

Describe options to be used when registered for text document change events.

The parameters of a workspace/didChangeWorkspaceFolders notification.

The params sent in a close notebook document notification.

The parameters sent in a close text document notification

The params sent in an open notebook document notification.

The parameters sent in an open text document notification

The params sent in a save notebook document notification.

The parameters sent in a save text document notification

Parameters for a {@link DocumentColorRequest}.

Parameters of the document diagnostic request.

A partial result for a document diagnostic report.

Client capabilities of a {@link DocumentFormattingRequest}.

Provider options for a {@link DocumentFormattingRequest}.

The parameters of a {@link DocumentFormattingRequest}.

Registration options for a {@link DocumentFormattingRequest}.

A document highlight is a range inside a text document which deserves special attention. Usually a document highlight is visualized by changing the background color of its range.

Client Capabilities for a {@link DocumentHighlightRequest}.

Provider options for a {@link DocumentHighlightRequest}.

Parameters for a {@link DocumentHighlightRequest}.

Registration options for a {@link DocumentHighlightRequest}.

A document link is a range in a text document that links to an internal or external resource, like another text document or a web site.

The client capabilities of a {@link DocumentLinkRequest}.

Provider options for a {@link DocumentLinkRequest}.

The parameters of a {@link DocumentLinkRequest}.

Registration options for a {@link DocumentLinkRequest}.

Client capabilities of a {@link DocumentOnTypeFormattingRequest}.

Provider options for a {@link DocumentOnTypeFormattingRequest}.

The parameters of a {@link DocumentOnTypeFormattingRequest}.

Registration options for a {@link DocumentOnTypeFormattingRequest}.

Client capabilities of a {@link DocumentRangeFormattingRequest}.

Provider options for a {@link DocumentRangeFormattingRequest}.

The parameters of a {@link DocumentRangeFormattingRequest}.

Registration options for a {@link DocumentRangeFormattingRequest}.

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.

Client Capabilities for a {@link DocumentSymbolRequest}.

Provider options for a {@link DocumentSymbolRequest}.

Parameters for a {@link DocumentSymbolRequest}.

Registration options for a {@link DocumentSymbolRequest}.

The client capabilities of a {@link ExecuteCommandRequest}.

The server capabilities of a {@link ExecuteCommandRequest}.

The parameters of a {@link ExecuteCommandRequest}.

Registration options for a {@link ExecuteCommandRequest}.

Represents information on a file/folder create.

Represents information on a file/folder delete.

An event describing a file change.

Capabilities relating to events from file operations by the user in the client.

A filter to describe in which file operation requests or notifications the server is interested in receiving.

Options for notifications/requests for user operations on files.

A pattern to describe in which file operation requests or notifications the server is interested in receiving.

Matching options for the file operation pattern.

The options to register for file operations.

Represents information on a file/folder rename.

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.

Parameters for a {@link FoldingRangeRequest}.

Value-object describing what options formatting should use.

A diagnostic report with a full set of problems.

General client capabilities.

The result of a hover request.

Parameters for a {@link HoverRequest}.

Registration options for a {@link HoverRequest}.

The data type of the ResponseError if the initialize request fails.

The result returned from an initialize request.

Inlay hint information.

Inlay hint client capabilities.

An inlay hint label part allows for interactive and composite labels of inlay hints.

Inlay hint options used during static registration.

A parameter literal used in inlay hint requests.

Inlay hint options used during static or dynamic registration.

Client workspace capabilities specific to inlay hints.

Client capabilities specific to inline values.

Provide an inline value through an expression evaluation. 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.

Inline value options used during static registration.

A parameter literal used in inline value requests.

Inline value options used during static or dynamic registration.

Provide inline value as text.

Provide inline value through 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.

Client workspace capabilities specific to inline values.

A special text edit to provide an insert and a replace operation.

Client capabilities for the linked editing range request.

The result of a linked editing range request.

Represents a location inside a resource, such as a line inside a text file.

Represents the connection of two locations. Provides additional metadata over normal {@link Location locations}, including an origin range.

The log message parameters.

Client capabilities specific to the used markdown parser.

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.

Moniker definition to match LSIF 0.5 moniker definition.

Client capabilities specific to the moniker request.

A change describing how to move a NotebookCell array from state S to S'.

A notebook cell text document filter denotes a cell text document by different properties.

A notebook document.

A change event for a notebook document.

Capabilities specific to the notebook document support.

A literal to identify a notebook document in the client.

Notebook specific client capabilities.

Options specific to a notebook plus its cells to be synced to the server.

Registration options specific to a notebook.

A text document identifier to optionally denote a specific version of a text document.

Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.

Position in a text document expressed as zero-based line and character offset. Prior to 3.17 the offsets were always based on a UTF-16 string representation. So a string of the form a𐐀b the character offset of the character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16. Since 3.17 clients and servers can agree on a different string encoding representation (e.g. UTF-8). The client announces it's supported encoding via the client capability general.positionEncodings. The value is an array of position encodings the client supports, with decreasing preference (e.g. the encoding at index 0 is the most preferred one). To stay backwards compatible the only mandatory encoding is UTF-16 represented via the string utf-16. The server can pick one of the encodings offered by the client and signals that encoding back to the client via the initialize result's property capabilities.positionEncoding. If the string value utf-16 is missing from the client's capability general.positionEncodings servers can safely assume that the client supports UTF-16. If the server omits the position encoding in its initialize result the encoding defaults to the string value 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.

A previous result id in a workspace pull request.

The initialize parameters

The publish diagnostic client capabilities.

The publish diagnostic notification's parameters.

A range in a text document expressed as (zero-based) start and end positions.

Client Capabilities for a {@link ReferencesRequest}.

Value-object that contains additional information when requesting references.

Parameters for a {@link ReferencesRequest}.

Registration options for a {@link ReferencesRequest}.

General parameters to register for a notification or to register a provider.

Client capabilities specific to regular expressions.

A full diagnostic report with a set of related documents.

An unchanged diagnostic report with a set of related documents.

A relative pattern is a helper to construct glob patterns that are matched relatively to a base URI. The common value for a baseUri is a workspace folder root, but it can be another absolute URI as well.

Rename file operation

The parameters sent in notifications/requests for user-initiated renames of files.

Provider options for a {@link RenameRequest}.

The parameters of a {@link RenameRequest}.

Registration options for a {@link RenameRequest}.

A generic resource operation.

A selection range represents a part of a selection hierarchy. A selection range may have a parent selection range that contains it.

A parameter literal used in selection range requests.

Defines the capabilities provided by a language server.

Client capabilities for the showDocument request.

Params to show a document.

The result of a showDocument request.

The parameters of a notification message.

Show message request client capabilities

Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.

Client Capabilities for a {@link SignatureHelpRequest}.

Additional information about the context in which a signature help request was triggered.

Server Capabilities for a {@link SignatureHelpRequest}.

Parameters for a {@link SignatureHelpRequest}.

Registration options for a {@link SignatureHelpRequest}.

Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.

Static registration options to be returned in the initialize request.

Represents information about programming constructs like variables, classes, interfaces etc.

Describe options to be used when registered for text document change events.

Text document specific client capabilities.

Describes textual changes on a text document. A TextDocumentEdit describes all changes on a document version Si and after they are applied move the document to version Si+1. So the creator of a TextDocumentEdit doesn't need to sort the array of edits or do any kind of ordering. However the edits must be non overlapping.

A literal to identify a text document in the client.

An item to transfer a text document from the client to the server.

A parameter literal used in requests to pass a text document and a position inside that document.

General text document registration options.

A text edit applicable to a text document.

Type hierarchy options used during static registration.

The parameter of a textDocument/prepareTypeHierarchy request.

Type hierarchy options used during static or dynamic registration.

The parameter of a typeHierarchy/subtypes request.

The parameter of a typeHierarchy/supertypes request.

A diagnostic report indicating that the last returned report is still accurate.

General parameters to unregister a request or notification.

A versioned notebook document identifier.

A text document identifier to denote a specific version of a text document.

The parameters sent in a will save text document notification.

Workspace specific client capabilities.

Parameters of the workspace diagnostic request.

A workspace diagnostic report.

A partial result for a workspace diagnostic report.

A workspace edit represents changes to many resources managed in the workspace. The edit should either provide changes or documentChanges. If documentChanges are present they are preferred over changes if the client can handle versioned document edits.

A workspace folder inside a client.

The workspace folder change event.

A full document diagnostic report for a workspace diagnostic result.

A special workspace symbol that supports locations without a range.

Client capabilities for a {@link WorkspaceSymbolRequest}.

Server capabilities for a {@link WorkspaceSymbolRequest}.

The parameters of a {@link WorkspaceSymbolRequest}.

Registration options for a {@link WorkspaceSymbolRequest}.

An unchanged document diagnostic report for a workspace diagnostic result.

Conveniences for testing GenLSP processes.

An identifier to refer to a change annotation stored with a workspace edit.

The declaration of a symbol representation as one or many {@link Location locations}.

Information about where a symbol is declared.

The definition of a symbol represented as one or many {@link Location locations}. For most programming languages there is only one location at which a symbol is defined.

Information about where a symbol is defined.

The result of a document diagnostic pull request. A report can either be a full report containing all diagnostics for the requested document or an unchanged report indicating that nothing has changed in terms of diagnostics in comparison to the last pull request.

A document filter describes a top level text document or a notebook cell document.

A document selector is the combination of one or many document filters.

The glob pattern. Either a string pattern or a relative pattern.

Inline value information can be provided by different means

The LSP any type. Please note that strictly speaking a property with the value undefined can't be converted into JSON preserving the property name. However for convenience it is allowed and assumed that all these properties are optional as well. @since 3.17.0

LSP arrays. @since 3.17.0

LSP object definition. @since 3.17.0

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. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting

A notebook document filter denotes a notebook document by different properties. The properties will be match against the notebook's URI (same as with documents)

The glob pattern to watch relative to the base path. Glob patterns can have the following syntax

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.

A document filter denotes a document by different properties like the {@link TextDocument.languageId language}, the {@link Uri.scheme scheme} of its resource, or a glob-pattern that is applied to the {@link TextDocument.fileName path}.

A workspace diagnostic document report.