Crate lsp_types[][src]

Expand description

Language Server Protocol types for Rust.

Based on: https://microsoft.github.io/language-server-protocol/specification

This library uses the URL crate for parsing URIs. Note that there is some confusion on the meaning of URLs vs URIs: http://stackoverflow.com/a/28865728/393898. According to that information, on the classical sense of “URLs”, “URLs” are a subset of URIs, But on the modern/new meaning of URLs, they are the same as URIs. The important take-away aspect is that the URL crate should be able to parse any URI, such as urn:isbn:0451450523.

Re-exports

pub use selection_range::*;

Modules

In this module we only define constants for lsp specific error codes. There are other error codes that are defined in the JSON RPC specification.

Types of Language Server Index Format (LSIF). LSIF is a standard format for language servers or other programming tools to dump their knowledge about a workspace.

Macros

Structs

A special text edit with an additional change annotation.

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

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

Additional information that describes document changes.

Where ClientCapabilities are currently empty:

Whether the client supports resolving additional code action properties via a separate codeAction/resolve request.

Contains additional diagnostic information about the context in which a code action is run.

Params for the CodeActionRequest

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

Code Lens options.

Represents a reference to a command. Provides a title which will be used to represent a command in the UI. Commands are identitifed using a string identifier and the protocol currently doesn’t specify a set of well known commands. So executing a command requires some tool extension code.

The kind of a completion entry.

Represents a collection of completion items to be presented in the editor.

Completion options.

How a completion was triggered.

Create file operation

Options to create a file.

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

Delete file operation

Delete file options

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.

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.

The protocol currently supports the following diagnostic severities:

The diagnostic tags.

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

A document filter denotes a document through properties like language, schema or pattern. Examples are a filter that applies to TypeScript files on disk or a filter the applies to JSON files with name package.json:

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.

A document highlight kind.

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.

Format document on type options

Extends TextDocumentRegistrationOptions

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.

Execute command options.

Execute command registration options.

The file event type.

Represents information on a file/folder create.

Represents information on a file/folder delete.

An event describing a file change.

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

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

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.

Value-object describing what options formatting should use.

The result of a hover request.

Hover options.

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

Defines how to interpret the insert text in a completion item

How whitespace and indentation is handled during completion item insertion.

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

Represents a link between a source and a target location.

A MarkupContent literal represents a string value which content can be represented in different formats. Currently plaintext and markdown are supported formats. A MarkupContent is usually used in documentation properties of result literals like CompletionItem or SignatureInformation. If the format is markdown the content should follow the GitHub Flavored Markdown Specification.

Moniker definition to match LSIF 0.5 moniker definition.

An identifier which optionally denotes a specific version of a text document. This information usually flows from the server to the client

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

A parameter literal used to pass a partial result token.

Position in a text document expressed as zero-based line and character offset. A position is between two characters like an ‘insert’ cursor in a editor.

The progress notification is sent from the server to the client to ask the client to indicate progress.

A range in a text document expressed as (zero-based) start and end positions. A range is comparable to a selection in an editor. Therefore the end position is exclusive.

General parameters to to register for a capability.

Rename file operation

Rename file options

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

Save options.

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

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

@since 3.16.0

Capabilities specific to the textDocument/semanticTokens/* requests.

@since 3.16.0

@since 3.16.0

@since 3.16.0

@since 3.16.0

Client capabilities for the show document request.

Params to show a document.

The result of an show document request.

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.

Signature help options.

Signature help options.

Signature help options.

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

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

A symbol kind.

Specific capabilities for the SymbolKind in the workspace/symbol request.

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

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

Text document specific client capabilities.

An event describing a change to a text document. If range and rangeLength are omitted the new text is considered to be the full content of the document.

Describes textual changes on a single text document. The text document is referred to as a OptionalVersionedTextDocumentIdentifier to allow clients to check the text document version before an edit is applied. A TextDocumentEdit describes all changes on a 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 or do any kind of ordering. However the edits must be non overlapping.

Text documents are identified using a URI. On the protocol level, URIs are passed as strings.

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.

Since most of the registration options require to specify a document selector there is a base interface that can be used.

Represents reasons why a text document is saved.

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

A textual edit applicable to a text document.

General parameters to unregister a capability.

A parsed URL record.

An identifier to denote a specific version of a text document. This information usually flows from the client to the server.

The parameters send in a will save text document notification.

Window specific client capabilities.

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

The window/workDoneProgress/create request is sent from the server to the clientto ask the client to create a work done progress.

An optional token that a server can use to report work done progress

Workspace specific client capabilities.

A workspace edit 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.

The workspace folder change event.

The parameters of a Workspace Symbol Request.

Enums

Type Definitions