Crate lsp_types

Source
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§

error_codes
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.
lsif
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.
notification
request
selection_range

Macros§

lsp_notification
lsp_request

Structs§

AnnotatedTextEdit
A special text edit with an additional change annotation.
ApplyWorkspaceEditParams
ApplyWorkspaceEditResponse
CallHierarchyIncomingCall
Represents an incoming call, e.g. a caller of a method or constructor.
CallHierarchyIncomingCallsParams
CallHierarchyItem
CallHierarchyOptions
CallHierarchyOutgoingCall
Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.
CallHierarchyOutgoingCallsParams
CallHierarchyPrepareParams
CancelParams
ChangeAnnotation
Additional information that describes document changes.
ChangeAnnotationWorkspaceEditClientCapabilities
ClientCapabilities
Where ClientCapabilities are currently empty:
ClientInfo
CodeAction
CodeActionCapabilityResolveSupport
Whether the client supports resolving additional code action properties via a separate codeAction/resolve request.
CodeActionClientCapabilities
CodeActionContext
Contains additional diagnostic information about the context in which a code action is run.
CodeActionDisabled
CodeActionKind
CodeActionKindLiteralSupport
CodeActionLiteralSupport
CodeActionOptions
CodeActionParams
Params for the CodeActionRequest
CodeActionTriggerKind
The reason why code actions were requested.
CodeDescription
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
CodeLensWorkspaceClientCapabilities
Color
ColorInformation
ColorPresentation
ColorPresentationParams
ColorProviderOptions
Command
Represents a reference to a command. Provides a title which will be used to represent a command in the UI. Commands are identified by a string identifier. The recommended way to handle commands is to implement their execution on the server side if the client and server provides the corresponding capabilities. Alternatively the tool extension code could handle the command. The protocol currently doesn’t specify a set of well-known commands.
CompletionClientCapabilities
CompletionContext
CompletionItem
CompletionItemCapability
CompletionItemCapabilityResolveSupport
CompletionItemKind
The kind of a completion entry.
CompletionItemKindCapability
CompletionItemLabelDetails
Additional details for a completion item label.
CompletionItemTag
CompletionList
Represents a collection of completion items to be presented in the editor.
CompletionListCapability
CompletionOptions
Completion options.
CompletionOptionsCompletionItem
CompletionParams
CompletionRegistrationOptions
CompletionTriggerKind
How a completion was triggered.
ConfigurationItem
ConfigurationParams
CreateFile
Create file operation
CreateFileOptions
Options to create a file.
CreateFilesParams
The parameters sent in notifications/requests for user-initiated creation of files.
DeclarationOptions
DeclarationRegistrationOptions
DefinitionOptions
DeleteFile
Delete file operation
DeleteFileOptions
Delete file options
DeleteFilesParams
The parameters sent in notifications/requests for user-initiated deletes of files.
Diagnostic
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
DiagnosticClientCapabilities
Client capabilities specific to diagnostic pull requests.
DiagnosticOptions
Diagnostic options.
DiagnosticRegistrationOptions
Diagnostic registration options.
DiagnosticRelatedInformation
Represents a related message and source code location for a diagnostic. This should be used to point to code locations that cause or related to a diagnostics, e.g when duplicating a symbol in a scope.
DiagnosticServerCancellationData
Cancellation data returned from a diagnostic request.
DiagnosticSeverity
The protocol currently supports the following diagnostic severities:
DiagnosticTag
The diagnostic tags.
DiagnosticWorkspaceClientCapabilities
Workspace client capabilities specific to diagnostic pull requests.
DidChangeConfigurationParams
DidChangeTextDocumentParams
DidChangeWatchedFilesClientCapabilities
DidChangeWatchedFilesParams
DidChangeWatchedFilesRegistrationOptions
Describe options to be used when registered for text document change events.
DidChangeWorkspaceFoldersParams
DidCloseTextDocumentParams
DidOpenTextDocumentParams
DidSaveTextDocumentParams
DocumentColorParams
DocumentDiagnosticParams
Parameters of the document diagnostic request.
DocumentDiagnosticReportPartialResult
A partial result for a document diagnostic report.
DocumentFilter
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:
DocumentFormattingOptions
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.
DocumentHighlightKind
A document highlight kind.
DocumentHighlightOptions
DocumentHighlightParams
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.
DocumentLinkClientCapabilities
DocumentLinkOptions
DocumentLinkParams
DocumentOnTypeFormattingOptions
Format document on type options
DocumentOnTypeFormattingParams
DocumentOnTypeFormattingRegistrationOptions
Extends TextDocumentRegistrationOptions
DocumentRangeFormattingOptions
DocumentRangeFormattingParams
DocumentSymbol
Represents programming constructs like variables, classes, interfaces etc. that appear in a document. Document symbols can be hierarchical and they have two ranges: one that encloses its definition and one that points to its most interesting range, e.g. the range of an identifier.
DocumentSymbolClientCapabilities
DocumentSymbolOptions
DocumentSymbolParams
DynamicRegistrationClientCapabilities
ExecuteCommandOptions
Execute command options.
ExecuteCommandParams
ExecuteCommandRegistrationOptions
Execute command registration options.
FileChangeType
The file event type.
FileCreate
Represents information on a file/folder create.
FileDelete
Represents information on a file/folder delete.
FileEvent
An event describing a file change.
FileOperationFilter
A filter to describe in which file operation requests or notifications the server is interested in.
FileOperationPattern
A pattern to describe in which file operation requests or notifications the server is interested in.
FileOperationPatternOptions
Matching options for the file operation pattern.
FileOperationRegistrationOptions
The options to register for file operations.
FileRename
Represents information on a file/folder rename.
FileSystemWatcher
FoldingProviderOptions
FoldingRange
Represents a folding range.
FoldingRangeCapability
FoldingRangeClientCapabilities
FoldingRangeKindCapability
FoldingRangeParams
FormattingOptions
Value-object describing what options formatting should use.
FullDocumentDiagnosticReport
A diagnostic report with a full set of problems.
GeneralClientCapabilities
GenericOptions
GenericParams
GenericRegistrationOptions
GotoCapability
GotoDefinitionParams
Hover
The result of a hover request.
HoverClientCapabilities
HoverOptions
Hover options.
HoverParams
HoverRegistrationOptions
InitializeError
InitializeParams
InitializeResult
InitializedParams
InlayHint
Inlay hint information.
InlayHintClientCapabilities
Inlay hint client capabilities.
InlayHintKind
Inlay hint kinds.
InlayHintLabelPart
An inlay hint label part allows for interactive and composite labels of inlay hints.
InlayHintOptions
Inlay hint options used during static registration.
InlayHintParams
A parameter literal used in inlay hint requests.
InlayHintRegistrationOptions
Inlay hint options used during static or dynamic registration.
InlayHintResolveClientCapabilities
Inlay hint client capabilities.
InlayHintWorkspaceClientCapabilities
Client workspace capabilities specific to inlay hints.
InlineValueContext
@since 3.17.0
InlineValueEvaluatableExpression
Provide an inline value through an expression evaluation.
InlineValueOptions
Inline value options used during static registration.
InlineValueParams
A parameter literal used in inline value requests.
InlineValueRegistrationOptions
Inline value options used during static or dynamic registration.
InlineValueText
Provide inline value as text.
InlineValueVariableLookup
Provide inline value through a variable lookup.
InlineValueWorkspaceClientCapabilities
Client workspace capabilities specific to inline values.
InsertReplaceEdit
A special text edit to provide an insert and a replace operation.
InsertTextFormat
Defines how to interpret the insert text in a completion item
InsertTextMode
How whitespace and indentation is handled during completion item insertion.
InsertTextModeSupport
LanguageString
LinkedEditingRangeOptions
LinkedEditingRangeParams
LinkedEditingRangeRegistrationOptions
LinkedEditingRanges
Location
Represents a location inside a resource, such as a line inside a text file.
LocationLink
Represents a link between a source and a target location.
LogMessageParams
LogTraceParams
MarkdownClientCapabilities
MarkupContent
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.
MessageActionItem
MessageActionItemCapabilities
MessageType
Moniker
Moniker definition to match LSIF 0.5 moniker definition.
MonikerOptions
MonikerParams
MonikerRegistrationOptions
OptionalVersionedTextDocumentIdentifier
An identifier which optionally denotes a specific version of a text document. This information usually flows from the server to the client
ParameterInformation
Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.
ParameterInformationSettings
PartialResultParams
A parameter literal used to pass a partial result token.
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.
PositionEncodingKind
A type indicating how positions are encoded, specifically what column offsets mean.
PrepareSupportDefaultBehavior
PreviousResultId
A previous result ID in a workspace pull request.
ProgressParams
The progress notification is sent from the server to the client to ask the client to indicate progress.
PublishDiagnosticsClientCapabilities
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
ReferencesOptions
Registration
General parameters to to register for a capability.
RegistrationParams
RegularExpressionsClientCapabilities
RelatedFullDocumentDiagnosticReport
A full diagnostic report with a set of related documents.
RelatedUnchangedDocumentDiagnosticReport
An unchanged diagnostic report with a set of related documents.
RelativePattern
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.
RenameClientCapabilities
RenameFile
Rename file operation
RenameFileOptions
Rename file options
RenameFilesParams
The parameters sent in notifications/requests for user-initiated renames of files.
RenameOptions
RenameParams
SaveOptions
Save options.
SemanticToken
The actual tokens.
SemanticTokenModifier
A set of predefined token modifiers. This set is not fixed and clients can specify additional token types via the corresponding client capabilities.
SemanticTokenType
A set of predefined token types. This set is not fixed and clients can specify additional token types via the corresponding client capabilities.
SemanticTokens
@since 3.16.0
SemanticTokensClientCapabilities
Capabilities specific to the textDocument/semanticTokens/* requests.
SemanticTokensClientCapabilitiesRequests
SemanticTokensDelta
@since 3.16.0
SemanticTokensDeltaParams
SemanticTokensEdit
@since 3.16.0
SemanticTokensLegend
@since 3.16.0
SemanticTokensOptions
@since 3.16.0
SemanticTokensParams
SemanticTokensPartialResult
@since 3.16.0
SemanticTokensRangeParams
SemanticTokensRegistrationOptions
SemanticTokensWorkspaceClientCapabilities
ServerCapabilities
ServerInfo
SetTraceParams
ShowDocumentClientCapabilities
Client capabilities for the show document request.
ShowDocumentParams
Params to show a document.
ShowDocumentResult
The result of an show document request.
ShowMessageParams
ShowMessageRequestClientCapabilities
Show message request client capabilities
ShowMessageRequestParams
SignatureHelp
Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.
SignatureHelpClientCapabilities
SignatureHelpContext
SignatureHelpOptions
Signature help options.
SignatureHelpParams
SignatureHelpRegistrationOptions
Signature help options.
SignatureHelpTriggerKind
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.
SignatureInformationSettings
StaleRequestSupportClientCapabilities
Client capability that signals how the client handles stale requests (e.g. a request for which the client will not process the response anymore since the information is outdated).
StaticRegistrationOptions
StaticTextDocumentColorProviderOptions
StaticTextDocumentRegistrationOptions
SymbolInformation
Represents information about programming constructs like variables, classes, interfaces etc.
SymbolKind
A symbol kind.
SymbolKindCapability
Specific capabilities for the SymbolKind in the workspace/symbol request.
SymbolTag
Symbol tags are extra annotations that tweak the rendering of a symbol.
TagSupport
TextDocumentChangeRegistrationOptions
Describe options to be used when registering for text document change events.
TextDocumentClientCapabilities
Text document specific client capabilities.
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.
TextDocumentEdit
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.
TextDocumentIdentifier
Text documents are identified using a URI. On the protocol level, URIs are passed as strings.
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.
TextDocumentRegistrationOptions
Since most of the registration options require to specify a document selector there is a base interface that can be used.
TextDocumentSaveReason
Represents reasons why a text document is saved.
TextDocumentSaveRegistrationOptions
TextDocumentSyncClientCapabilities
TextDocumentSyncKind
Defines how the host (editor) should sync document changes to the language server.
TextDocumentSyncOptions
TextEdit
A textual edit applicable to a text document.
TokenFormat
TypeHierarchyItem
TypeHierarchyOptions
TypeHierarchyPrepareParams
TypeHierarchyRegistrationOptions
TypeHierarchySubtypesParams
TypeHierarchySupertypesParams
UnchangedDocumentDiagnosticReport
A diagnostic report indicating that the last returned report is still accurate.
Unregistration
General parameters to unregister a capability.
UnregistrationParams
Url
A parsed URL record.
VersionedTextDocumentIdentifier
An identifier to denote a specific version of a text document. This information usually flows from the client to the server.
WatchKind
WillSaveTextDocumentParams
The parameters send in a will save text document notification.
WindowClientCapabilities
Window specific client capabilities.
WorkDoneProgressBegin
WorkDoneProgressCancelParams
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.
WorkDoneProgressCreateParams
The window/workDoneProgress/create request is sent from the server to the client to ask the client to create a work done progress.
WorkDoneProgressEnd
WorkDoneProgressOptions
WorkDoneProgressParams
An optional token that a server can use to report work done progress
WorkDoneProgressReport
WorkspaceClientCapabilities
Workspace specific client capabilities.
WorkspaceDiagnosticParams
Parameters of the workspace diagnostic request.
WorkspaceDiagnosticReport
A workspace diagnostic report.
WorkspaceDiagnosticReportPartialResult
A partial result for a workspace diagnostic report.
WorkspaceEdit
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.
WorkspaceEditClientCapabilities
WorkspaceFileOperationsClientCapabilities
WorkspaceFileOperationsServerCapabilities
WorkspaceFolder
WorkspaceFoldersChangeEvent
The workspace folder change event.
WorkspaceFoldersServerCapabilities
WorkspaceFullDocumentDiagnosticReport
A full document diagnostic report for a workspace diagnostic result.
WorkspaceLocation
WorkspaceServerCapabilities
WorkspaceSymbol
A special workspace symbol that supports locations without a range
WorkspaceSymbolClientCapabilities
WorkspaceSymbolOptions
WorkspaceSymbolParams
The parameters of a Workspace Symbol Request.
WorkspaceSymbolResolveSupportCapability
WorkspaceUnchangedDocumentDiagnosticReport
An unchanged document diagnostic report for a workspace diagnostic result.

Enums§

CallHierarchyServerCapability
CodeActionOrCommand
CodeActionProviderCapability
ColorProviderCapability
CompletionResponse
CompletionTextEdit
DeclarationCapability
DiagnosticServerCapabilities
DocumentChangeOperation
DocumentChanges
DocumentDiagnosticReport
The result of a document diagnostic pull request.
DocumentDiagnosticReportKind
The document diagnostic report kinds.
DocumentDiagnosticReportResult
DocumentSymbolResponse
Documentation
FailureHandlingKind
FileOperationPatternKind
A pattern kind describing if a glob pattern matches a file a folder or both.
FoldingRangeKind
Enum of known range kinds
FoldingRangeProviderCapability
FormattingProperty
GlobPattern
The glob pattern. Either a string pattern or a relative pattern.
GotoDefinitionResponse
GotoDefinition response can be single location, or multiple Locations or a link.
HoverContents
Hover contents could be single entry or multiple entries.
HoverProviderCapability
ImplementationProviderCapability
InlayHintLabel
InlayHintLabelPartTooltip
InlayHintServerCapabilities
InlayHintTooltip
InlineValue
Inline value information can be provided by different means:
InlineValueServerCapabilities
LinkedEditingRangeServerCapabilities
MarkedString
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.
MarkupKind
Describes the content type that a client supports in various result literals like Hover, ParameterInfo or CompletionItem.
MessageActionItemProperty
MonikerKind
The moniker kind.
MonikerServerCapabilities
NumberOrString
OneOf
ParameterLabel
PrepareRenameResponse
ProgressParamsValue
ResourceOp
ResourceOperationKind
SemanticTokensFullDeltaResult
SemanticTokensFullOptions
SemanticTokensRangeResult
SemanticTokensResult
SemanticTokensServerCapabilities
TextDocumentSyncCapability
TextDocumentSyncSaveOptions
TraceValue
A TraceValue represents the level of verbosity with which the server systematically reports its execution trace using LogTrace notifications.
TypeDefinitionProviderCapability
UniquenessLevel
Moniker uniqueness level to define scope of the moniker.
WorkDoneProgress
WorkspaceDiagnosticReportResult
WorkspaceDocumentDiagnosticReport
A workspace diagnostic document report.
WorkspaceSymbolResponse

Type Aliases§

CallHierarchyClientCapabilities
ChangeAnnotationIdentifier
An identifier referring to a change annotation managed by a workspace edit.
CodeActionResponse
response for CodeActionRequest
CodeLensClientCapabilities
DidChangeConfigurationClientCapabilities
DocumentColorClientCapabilities
DocumentFormattingClientCapabilities
DocumentHighlightClientCapabilities
DocumentOnTypeFormattingClientCapabilities
DocumentRangeFormattingClientCapabilities
DocumentSelector
A document selector is the combination of one or many document filters.
ExecuteCommandClientCapabilities
InlineValueClientCapabilities
LSPAny
The LSP any type
LSPArray
LSP arrays.
LSPObject
LSP object definition.
LinkedEditingRangeClientCapabilities
MonikerClientCapabilities
Pattern
The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
ProgressToken
ReferenceClientCapabilities
TypeHierarchyClientCapabilities