Crate languageserver_types [] [src]

Language Server Protocol types for Rust.

Based on: https://github.com/Microsoft/language-server-protocol/blob/master/protocol.md

Last protocol update: 08/Dec/2016 at commit: https://github.com/Microsoft/language-server-protocol/commit/00520823bd4c8060bb1963964615aa005594381b

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.

Structs

CancelParams
CodeActionContext

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

CodeActionParams

Params for the CodeActionRequest

CodeLens

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.

CodeLensOptions

Code Lens options.

CodeLensParams
Command

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.

CompletionItem
CompletionList

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

CompletionOptions

Completion options.

Diagnostic

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

DidChangeConfigurationParams
DidChangeTextDocumentParams
DidChangeWatchedFilesParams
DidCloseTextDocumentParams
DidOpenTextDocumentParams
DidSaveTextDocumentParams
DocumentFormattingParams
DocumentHighlight

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.

DocumentLink

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.

DocumentLinkParams
DocumentOnTypeFormattingOptions

Format document on type options

DocumentOnTypeFormattingParams
DocumentRangeFormattingParams
DocumentSymbolParams
FileEvent

An event describing a file change.

FormattingOptions

Value-object describing what options formatting should use.

Hover

The result of a hover request.

InitializeError
InitializeParams
InitializeResult
LanguageString
Location

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

LogMessageParams
MessageActionItem
ParameterInformation

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

Position

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.

PublishDiagnosticsParams
Range

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.

ReferenceContext
ReferenceParams
RenameParams
ServerCapabilities
ShowMessageParams
ShowMessageRequestParams
SignatureHelp

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

SignatureHelpOptions

Signature help options.

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.

SymbolInformation

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

TextDocumentContentChangeEvent

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.

TextDocumentIdentifier

Text documents are identified using a URI. On the protocol level, URIs are passed as strings. The corresponding JSON structure looks like this:

TextDocumentItem

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

TextDocumentPositionParams

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

TextEdit

A textual edit applicable to a text document.

VersionedTextDocumentIdentifier

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

WorkspaceEdit

A workspace edit represents changes to many resources managed in the workspace.

WorkspaceSymbolParams

The parameters of a Workspace Symbol Request.

Enums

CompletionItemKind

The kind of a completion entry.

DiagnosticSeverity

The protocol currently supports the following diagnostic severities:

DocumentHighlightKind

A document highlight kind.

FileChangeType

The file event type.

MarkedString

The marked string is rendered: - as markdown if it is represented as a string - as code block of the given langauge if it is represented as a pair of a language and a value

MessageType
NumberOrString
SymbolKind
TextDocumentSyncKind

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

Constants

NOTIFICATION__Cancel

The base protocol now offers support for request cancellation. To cancel a request, a notification message with the following properties is sent:

NOTIFICATION__DidChangeTextDocument

The document change notification is sent from the client to the server to signal changes to a text document. In 2.0 the shape of the params has changed to include proper version numbers and language ids.

NOTIFICATION__DidChangeWatchedFiles

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

NOTIFICATION__DidCloseTextDocument

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).

NOTIFICATION__DidOpenTextDocument

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.

NOTIFICATION__DidSaveTextDocument

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

NOTIFICATION__Exit

A notification to ask the server to exit its process. The server should exit with success code 0 if the shutdown request has been received before; otherwise with error code 1.

NOTIFICATION__LogMessage

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

NOTIFICATION__PublishDiagnostics

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

NOTIFICATION__ShowMessage

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.

NOTIFICATION__TelemetryEvent

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

NOTIFICATION__WorkspaceChangeConfiguration

A notification sent from the client to the server to signal the change of configuration settings.

REQUEST__CodeAction

The code action request is sent from the client to the server to compute commands for a given text document and range. The request is triggered when the user moves the cursor into a problem marker in the editor or presses the lightbulb associated with a marker.

REQUEST__CodeLens

The code lens request is sent from the client to the server to compute code lenses for a given text document.

REQUEST__CodeLensResolve

The code lens resolve request is sent from the client to the server to resolve the command for a given code lens item.

REQUEST__Completion

The Completion request is sent from the client to the server to compute completion items at a given cursor position. Completion items are presented in the IntelliSense user interface. If computing full completion items is expensive, servers can additionally provide a handler for the completion item resolve request ('completionItem/resolve'). This request is sent when a completion item is selected in the user interface. A typically use case is for example: the 'textDocument/completion' request doesn't fill in the documentation property for returned completion items since it is expensive to compute. When the item is selected in the user interface then a 'completionItem/resolve' request is sent with the selected completion item as a param. The returned completion item should have the documentation property filled in.

REQUEST__DocumentHighlight

The document highlight request is sent from the client to the server to resolve a document highlights for a given text document position. For programming languages this usually highlights all references to the symbol scoped to this file. However we kept 'textDocument/documentHighlight' and 'textDocument/references' separate requests since the first one is allowed to be more fuzzy. Symbol matches usually have a DocumentHighlightKind of Read or Write whereas fuzzy or textual matches use Textas the kind.

REQUEST__DocumentLink

The document links request is sent from the client to the server to request the location of links in a document.

REQUEST__DocumentLinkResolve

The document link resolve request is sent from the client to the server to resolve the target of a given document link.

REQUEST__DocumentSymbols

The document symbol request is sent from the client to the server to list all symbols found in a given text document.

REQUEST__Formatting

The document formatting request is sent from the server to the client to format a whole document.

REQUEST__GotoDefinition

The goto definition request is sent from the client to the server to resolve the definition location of a symbol at a given text document position.

REQUEST__Hover

The hover request is sent from the client to the server to request hover information at a given text document position.

REQUEST__Initialize

The initialize request is sent as the first request from the client to the server. If the server receives request or notification before the initialize request it should act as follows:

REQUEST__OnTypeFormatting

The document on type formatting request is sent from the client to the server to format parts of the document during typing.

REQUEST__RangeFormatting

The document range formatting request is sent from the client to the server to format a given range in a document.

REQUEST__References

The references request is sent from the client to the server to resolve project-wide references for the symbol denoted by the given text document position.

REQUEST__Rename

The rename request is sent from the client to the server to perform a workspace-wide rename of a symbol.

REQUEST__ResolveCompletionItem

The request is sent from the client to the server to resolve additional information for a given completion item.

REQUEST__ShowMessageRequest

The show message request is sent from a server to a client to ask the client to display a particular message in the user interface. In addition to the show message notification the request allows to pass actions and to wait for an answer from the client.

REQUEST__Shutdown

The shutdown request is sent from the client to the server. It asks the server to shut down, but to not exit (otherwise the response might not be delivered correctly to the client). There is a separate exit notification that asks the server to exit.

REQUEST__SignatureHelp

The signature help request is sent from the client to the server to request signature information at a given cursor position.

REQUEST__WorkspaceSymbols

The workspace symbol request is sent from the client to the server to list project-wide symbols matching the query string.

Type Definitions

ClientCapabilities

Where ClientCapabilities are currently empty: