Types
LSP type definitions in pygls
are provided by the lsprotocol library
- class lsprotocol.types.AnnotatedTextEdit(annotation_id, range, new_text)
A special text edit with an additional change annotation.
LSP v3.16.0.
- class lsprotocol.types.ApplyWorkspaceEditParams(edit, label=None)
The parameters passed via an apply workspace edit request.
- Parameters:
edit (WorkspaceEdit) –
- edit: WorkspaceEdit
The edits to apply.
- class lsprotocol.types.ApplyWorkspaceEditResult(applied, failure_reason=None, failed_change=None)
The result returned from the apply workspace edit request.
LSP v3.17 renamed from ApplyWorkspaceEditResponse
- class lsprotocol.types.BaseSymbolInformation(name, kind, tags=None, container_name=None)
A base for all symbol information.
- Parameters:
- container_name: Optional[str]
The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can’t be used to re-infer a hierarchy for the document symbols.
- kind: SymbolKind
The kind of this symbol.
- class lsprotocol.types.CallHierarchyClientCapabilities(dynamic_registration=None)
LSP v3.16.0
- class lsprotocol.types.CallHierarchyIncomingCall(from_, from_ranges)
Represents an incoming call, e.g. a caller of a method or constructor.
LSP v3.16.0
- Parameters:
from_ (CallHierarchyItem) –
- from_: CallHierarchyItem
The item that makes the call.
- class lsprotocol.types.CallHierarchyIncomingCallsParams(item, work_done_token=None, partial_result_token=None)
The parameter of a
callHierarchy/incomingCalls
request.LSP v3.16.0
- Parameters:
- item: CallHierarchyItem
- class lsprotocol.types.CallHierarchyIncomingCallsRequest(id, params, method='callHierarchy/incomingCalls', jsonrpc='2.0')
A request to resolve the incoming calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
- class lsprotocol.types.CallHierarchyIncomingCallsResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[CallHierarchyIncomingCall]]
- class lsprotocol.types.CallHierarchyItem(name, kind, uri, range, selection_range, tags=None, detail=None, data=None)
Represents programming constructs like functions or constructors in the context of call hierarchy.
LSP v3.16.0
- Parameters:
- data: Optional[Any]
A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.
- kind: SymbolKind
The kind of this item.
- range: Range
The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
- class lsprotocol.types.CallHierarchyOptions(work_done_progress=None)
Call hierarchy options used during static registration.
LSP v3.16.0
- class lsprotocol.types.CallHierarchyOutgoingCall(to, from_ranges)
Represents an outgoing call, e.g. calling a getter from a method or a method from a constructor etc.
LSP v3.16.0
- Parameters:
to (CallHierarchyItem) –
- from_ranges: List[Range]
The range at which this item is called. This is the range relative to the caller, e.g the item passed to {@link CallHierarchyItemProvider.provideCallHierarchyOutgoingCalls
provideCallHierarchyOutgoingCalls
} and not {@link CallHierarchyOutgoingCall.tothis.to
}.
- to: CallHierarchyItem
The item that is called.
- class lsprotocol.types.CallHierarchyOutgoingCallsParams(item, work_done_token=None, partial_result_token=None)
The parameter of a
callHierarchy/outgoingCalls
request.LSP v3.16.0
- Parameters:
- item: CallHierarchyItem
- class lsprotocol.types.CallHierarchyOutgoingCallsRequest(id, params, method='callHierarchy/outgoingCalls', jsonrpc='2.0')
A request to resolve the outgoing calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
- class lsprotocol.types.CallHierarchyOutgoingCallsResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[CallHierarchyOutgoingCall]]
- class lsprotocol.types.CallHierarchyPrepareParams(text_document, position, work_done_token=None)
The parameter of a
textDocument/prepareCallHierarchy
request.LSP v3.16.0
- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.CallHierarchyRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
Call hierarchy options used during static or dynamic registration.
LSP v3.16.0
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.CancelParams(id)
- class lsprotocol.types.CancelRequestNotification(params, method='$/cancelRequest', jsonrpc='2.0')
- Parameters:
params (CancelParams) –
method (str) –
jsonrpc (str) –
- params: CancelParams
- class lsprotocol.types.ChangeAnnotation(label, needs_confirmation=None, description=None)
Additional information that describes document changes.
LSP v3.16.0
- description: Optional[str]
A human-readable string which is rendered less prominent in the user interface.
- lsprotocol.types.ChangeAnnotationIdentifier
An identifier to refer to a change annotation stored with a workspace edit.
- class lsprotocol.types.ClientCapabilities(workspace=None, text_document=None, notebook_document=None, window=None, general=None, experimental=None)
Defines the capabilities provided by the client.
- Parameters:
workspace (Optional[WorkspaceClientCapabilities]) –
text_document (Optional[TextDocumentClientCapabilities]) –
notebook_document (Optional[NotebookDocumentClientCapabilities]) –
window (Optional[WindowClientCapabilities]) –
general (Optional[GeneralClientCapabilities]) –
- general: Optional[GeneralClientCapabilities]
General client capabilities.
LSP v3.16.0
- notebook_document: Optional[NotebookDocumentClientCapabilities]
Capabilities specific to the notebook document support.
LSP v3.17.0
- text_document: Optional[TextDocumentClientCapabilities]
Text document specific client capabilities.
- window: Optional[WindowClientCapabilities]
Window specific client capabilities.
- workspace: Optional[WorkspaceClientCapabilities]
Workspace specific client capabilities.
- class lsprotocol.types.ClientRegisterCapabilityRequest(id, params, method='client/registerCapability', jsonrpc='2.0')
The
client/registerCapability
request is sent from the server to the client to register a new capability handler on the client side.- params: RegistrationParams
- class lsprotocol.types.ClientRegisterCapabilityResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.ClientUnregisterCapabilityRequest(id, params, method='client/unregisterCapability', jsonrpc='2.0')
The
client/unregisterCapability
request is sent from the server to the client to unregister a previously registered capability handler on the client side.- params: UnregistrationParams
- class lsprotocol.types.ClientUnregisterCapabilityResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.CodeAction(title, kind=None, diagnostics=None, is_preferred=None, disabled=None, edit=None, command=None, data=None)
A code action represents a change that can be performed in code, e.g. to fix a problem or to refactor code.
A CodeAction must set either
edit
and/or a command. If both are supplied, the edit is applied first, then the command is executed.- Parameters:
title (str) –
kind (Optional[Union[CodeActionKind, str]]) –
diagnostics (Optional[List[Diagnostic]]) –
disabled (Optional[CodeActionDisabledType]) –
edit (Optional[WorkspaceEdit]) –
- command: Optional[Command]
A command this code action executes. If a code action provides an edit and a command, first the edit is executed and then the command.
- data: Optional[Any]
A data entry field that is preserved on a code action between a
textDocument/codeAction
and a codeAction/resolve request.LSP v3.16.0
- diagnostics: Optional[List[Diagnostic]]
The diagnostics that this code action resolves.
- disabled: Optional[CodeActionDisabledType]
Marks that the code action cannot currently be applied.
Clients should follow the following guidelines regarding disabled code actions:
Disabled code actions are not shown in automatic lightbulbs code action menus.
Disabled actions are shown as faded out in the code action menu when the user requests a more specific type of code action, such as refactorings.
If the user has a keybinding that auto applies a code action and only disabled code actions are returned, the client should show the user an error message with
reason
in the editor.
LSP v3.16.0
- edit: Optional[WorkspaceEdit]
The workspace edit this code action performs.
- is_preferred: Optional[bool]
Marks this as a preferred action. Preferred actions are used by the
auto fix
command and can be targeted by keybindings.A quick fix should be marked preferred if it properly addresses the underlying error. A refactoring should be marked preferred if it is the most reasonable choice of actions to take.
LSP v3.15.0
- kind: Optional[Union[CodeActionKind, str]]
The kind of the code action.
Used to filter code actions.
- class lsprotocol.types.CodeActionClientCapabilities(dynamic_registration=None, code_action_literal_support=None, is_preferred_support=None, disabled_support=None, data_support=None, resolve_support=None, honors_change_annotations=None)
The Client Capabilities of a
CodeActionRequest
.- Parameters:
code_action_literal_support (Optional[CodeActionClientCapabilitiesCodeActionLiteralSupportType]) –
resolve_support (Optional[CodeActionClientCapabilitiesResolveSupportType]) –
- code_action_literal_support: Optional[CodeActionClientCapabilitiesCodeActionLiteralSupportType]
The client support code action literals of type
CodeAction
as a valid response of thetextDocument/codeAction
request. If the property is not set the request can only returnCommand
literals.LSP v3.8.0
- data_support: Optional[bool]
Whether code action supports the
data
property which is preserved between atextDocument/codeAction
and acodeAction/resolve
request.LSP v3.16.0
- honors_change_annotations: Optional[bool]
Whether the client honors the change annotations in text edits and resource operations returned via the
CodeAction#edit
property by for example presenting the workspace edit in the user interface and asking for confirmation.LSP v3.16.0
- is_preferred_support: Optional[bool]
Whether code action supports the
isPreferred
property.LSP v3.15.0
- resolve_support: Optional[CodeActionClientCapabilitiesResolveSupportType]
Whether the client supports resolving additional code action properties via a separate
codeAction/resolve
request.LSP v3.16.0
- class lsprotocol.types.CodeActionClientCapabilitiesCodeActionLiteralSupportType(code_action_kind)
- Parameters:
code_action_kind (CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType) –
- code_action_kind: CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType
The code action kind is support with the following value set.
- class lsprotocol.types.CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType(value_set)
- Parameters:
value_set (List[Union[CodeActionKind, str]]) –
- value_set: List[Union[CodeActionKind, str]]
The code action kind values the client supports. When this property exists the client also guarantees that it will handle values outside its set gracefully and falls back to a default value when unknown.
- class lsprotocol.types.CodeActionClientCapabilitiesResolveSupportType(properties)
- class lsprotocol.types.CodeActionContext(diagnostics, only=None, trigger_kind=None)
Contains additional diagnostic information about the context in which a
provideCodeActions code action
is run.- Parameters:
diagnostics (List[Diagnostic]) –
only (Optional[List[Union[CodeActionKind, str]]]) –
trigger_kind (Optional[CodeActionTriggerKind]) –
- diagnostics: List[Diagnostic]
An array of diagnostics known on the client side overlapping the range provided to the
textDocument/codeAction
request. They are provided so that the server knows which errors are currently presented to the user for the given range. There is no guarantee that these accurately reflect the error state of the resource. The primary parameter to compute code actions is the provided range.
- only: Optional[List[Union[CodeActionKind, str]]]
Requested kind of actions to return.
Actions not of this kind are filtered out by the client before being shown. So servers can omit computing them.
- trigger_kind: Optional[CodeActionTriggerKind]
The reason why code actions were requested.
LSP v3.17.0
- class lsprotocol.types.CodeActionKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A set of predefined code action kinds
- Empty = ''
Empty kind.
- QuickFix = 'quickfix'
‘quickfix’
- Type:
Base kind for quickfix actions
- Refactor = 'refactor'
‘refactor’
- Type:
Base kind for refactoring actions
- RefactorExtract = 'refactor.extract'
‘refactor.extract’
Example extract actions:
Extract method
Extract function
Extract variable
Extract interface from class
…
- Type:
Base kind for refactoring extraction actions
- RefactorInline = 'refactor.inline'
‘refactor.inline’
Example inline actions:
Inline function
Inline variable
Inline constant
…
- Type:
Base kind for refactoring inline actions
- RefactorRewrite = 'refactor.rewrite'
‘refactor.rewrite’
Example rewrite actions:
Convert JavaScript function to class
Add or remove parameter
Encapsulate field
Make method static
Move method to base class
…
- Type:
Base kind for refactoring rewrite actions
- Source = 'source'
source
Source code actions apply to the entire file.
- Type:
Base kind for source actions
- SourceFixAll = 'source.fixAll'
source.fixAll
.Fix all actions automatically fix errors that have a clear fix that do not require user input. They should not suppress errors or perform unsafe fixes such as generating new types or classes.
LSP v3.15.0
- Type:
Base kind for auto-fix source actions
- SourceOrganizeImports = 'source.organizeImports'
source.organizeImports
- Type:
Base kind for an organize imports source action
- class lsprotocol.types.CodeActionOptions(code_action_kinds=None, resolve_provider=None, work_done_progress=None)
Provider options for a
CodeActionRequest
.- Parameters:
- code_action_kinds: Optional[List[Union[CodeActionKind, str]]]
CodeActionKinds that this server may return.
The list of kinds may be generic, such as
CodeActionKind.Refactor
, or the server may list out every specific kind they provide.
- class lsprotocol.types.CodeActionParams(text_document, range, context, work_done_token=None, partial_result_token=None)
The parameters of a
CodeActionRequest
.- Parameters:
- context: CodeActionContext
Context carrying additional information.
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The document in which the command was invoked.
- class lsprotocol.types.CodeActionRegistrationOptions(document_selector=None, code_action_kinds=None, resolve_provider=None, work_done_progress=None)
Registration options for a
CodeActionRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
code_action_kinds (Optional[List[Union[CodeActionKind, str]]]) –
- code_action_kinds: Optional[List[Union[CodeActionKind, str]]]
CodeActionKinds that this server may return.
The list of kinds may be generic, such as
CodeActionKind.Refactor
, or the server may list out every specific kind they provide.
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.CodeActionResolveRequest(id, params, method='codeAction/resolve', jsonrpc='2.0')
Request to resolve additional information for a given code action.The request’s parameter is of type
CodeAction
the response is of typeCodeAction
or a Thenable that resolves to such.- params: CodeAction
- class lsprotocol.types.CodeActionResolveResponse(id, result=None, jsonrpc='2.0')
-
- result: CodeAction
- class lsprotocol.types.CodeActionTriggerKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The reason why code actions were requested.
LSP v3.17.0
- Automatic = 2
Code actions were requested automatically.
This typically happens when current selection in a file changes, but can also be triggered when file content changes.
- Invoked = 1
Code actions were explicitly requested by the user or by an extension.
- class lsprotocol.types.CodeDescription(href)
Structure to capture a description for an error code.
LSP v3.16.0
- Parameters:
href (str) –
- class lsprotocol.types.CodeLens(range, command=None, data=None)
A code lens represents a
Command command
that should be shown along with source text, like the number of references, a way to run tests, etc.A code lens is _unresolved_ when no command is associated to it. For performance reasons the creation of a code lens and resolving should be done in two stages.
- class lsprotocol.types.CodeLensClientCapabilities(dynamic_registration=None)
The client capabilities of a
CodeLensRequest
.
- class lsprotocol.types.CodeLensOptions(resolve_provider=None, work_done_progress=None)
Code Lens provider options of a
CodeLensRequest
.
- class lsprotocol.types.CodeLensParams(text_document, work_done_token=None, partial_result_token=None)
The parameters of a
CodeLensRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The document to request code lens for.
- class lsprotocol.types.CodeLensRegistrationOptions(document_selector=None, resolve_provider=None, work_done_progress=None)
Registration options for a
CodeLensRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.CodeLensResolveRequest(id, params, method='codeLens/resolve', jsonrpc='2.0')
A request to resolve a command for a given code lens.
- class lsprotocol.types.CodeLensResolveResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.CodeLensWorkspaceClientCapabilities(refresh_support=None)
LSP v3.16.0
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all code lenses currently shown. It should be used with absolute care and is useful for situation where a server for example detect a project wide change that requires such a calculation.
- class lsprotocol.types.Color(red, green, blue, alpha)
Represents a color in RGBA space.
- class lsprotocol.types.ColorInformation(range, color)
Represents a color range from a document.
- class lsprotocol.types.ColorPresentation(label, text_edit=None, additional_text_edits=None)
- Parameters:
- additional_text_edits: Optional[List[TextEdit]]
An optional array of additional
TextEdit text edits
that are applied when selecting this color presentation. Edits must not overlap with the maintextEdit edit
nor with themselves.
- class lsprotocol.types.ColorPresentationParams(text_document, color, range, work_done_token=None, partial_result_token=None)
Parameters for a
ColorPresentationRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.Command(title, command, arguments=None)
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.
- class lsprotocol.types.CompletionClientCapabilities(dynamic_registration=None, completion_item=None, completion_item_kind=None, insert_text_mode=None, context_support=None, completion_list=None)
Completion client capabilities
- Parameters:
completion_item (Optional[CompletionClientCapabilitiesCompletionItemType]) –
completion_item_kind (Optional[CompletionClientCapabilitiesCompletionItemKindType]) –
insert_text_mode (Optional[InsertTextMode]) –
completion_list (Optional[CompletionClientCapabilitiesCompletionListType]) –
- completion_item: Optional[CompletionClientCapabilitiesCompletionItemType]
The client supports the following
CompletionItem
specific capabilities.
- completion_item_kind: Optional[CompletionClientCapabilitiesCompletionItemKindType]
- completion_list: Optional[CompletionClientCapabilitiesCompletionListType]
The client supports the following
CompletionList
specific capabilities.LSP v3.17.0
- context_support: Optional[bool]
The client supports to send additional context information for a
textDocument/completion
request.
- insert_text_mode: Optional[InsertTextMode]
Defines how the client handles whitespace and indentation when accepting a completion item that uses multi line text in either
insertText
or textEdit.LSP v3.17.0
- class lsprotocol.types.CompletionClientCapabilitiesCompletionItemKindType(value_set=None)
- Parameters:
value_set (Optional[List[CompletionItemKind]]) –
- value_set: Optional[List[CompletionItemKind]]
The completion item kind values the client supports. When this property exists the client also guarantees that it will handle values outside its set gracefully and falls back to a default value when unknown.
If this property is not present the client only supports the completion items kinds from
Text
to Reference as defined in the initial version of the protocol.
- class lsprotocol.types.CompletionClientCapabilitiesCompletionItemType(snippet_support=None, commit_characters_support=None, documentation_format=None, deprecated_support=None, preselect_support=None, tag_support=None, insert_replace_support=None, resolve_support=None, insert_text_mode_support=None, label_details_support=None)
- Parameters:
documentation_format (Optional[List[MarkupKind]]) –
tag_support (Optional[CompletionClientCapabilitiesCompletionItemTypeTagSupportType]) –
resolve_support (Optional[CompletionClientCapabilitiesCompletionItemTypeResolveSupportType]) –
insert_text_mode_support (Optional[CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType]) –
- documentation_format: Optional[List[MarkupKind]]
Client supports the following content formats for the documentation property. The order describes the preferred format of the client.
- insert_replace_support: Optional[bool]
Client support insert replace edit to control different behavior if a completion item is inserted in the text or should replace text.
LSP v3.16.0
- insert_text_mode_support: Optional[CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType]
The client supports the
insertTextMode
property on a completion item to override the whitespace handling mode as defined by the client (seeinsertTextMode
).LSP v3.16.0
- label_details_support: Optional[bool]
The client has support for completion item label details (see also
CompletionItemLabelDetails
).LSP v3.17.0
- resolve_support: Optional[CompletionClientCapabilitiesCompletionItemTypeResolveSupportType]
Indicates which properties a client can resolve lazily on a completion item. Before version 3.16.0 only the predefined properties
documentation
anddetails
could be resolved lazily.LSP v3.16.0
- snippet_support: Optional[bool]
Client supports snippets as insert text.
A snippet can define tab stops and placeholders with
$1
, $2 and${3:foo}
. $0 defines the final tab stop, it defaults to the end of the snippet. Placeholders with equal identifiers are linked, that is typing in one will update others too.
- tag_support: Optional[CompletionClientCapabilitiesCompletionItemTypeTagSupportType]
Client supports the tag property on a completion item. Clients supporting tags have to handle unknown tags gracefully. Clients especially need to preserve unknown tags when sending a completion item back to the server in a resolve call.
LSP v3.15.0
- class lsprotocol.types.CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType(value_set)
- Parameters:
value_set (List[InsertTextMode]) –
- value_set: List[InsertTextMode]
- class lsprotocol.types.CompletionClientCapabilitiesCompletionItemTypeResolveSupportType(properties)
- class lsprotocol.types.CompletionClientCapabilitiesCompletionItemTypeTagSupportType(value_set)
- Parameters:
value_set (List[CompletionItemTag]) –
- value_set: List[CompletionItemTag]
The tags supported by the client.
- class lsprotocol.types.CompletionClientCapabilitiesCompletionListType(item_defaults=None)
- class lsprotocol.types.CompletionContext(trigger_kind, trigger_character=None)
Contains additional information about the context in which a completion request is triggered.
- Parameters:
trigger_kind (CompletionTriggerKind) –
- trigger_character: Optional[str]
The trigger character (a single character) that has trigger code complete. Is undefined if
triggerKind !== CompletionTriggerKind.TriggerCharacter
- trigger_kind: CompletionTriggerKind
How the completion was triggered.
- class lsprotocol.types.CompletionItem(label, label_details=None, kind=None, tags=None, detail=None, documentation=None, deprecated=None, preselect=None, sort_text=None, filter_text=None, insert_text=None, insert_text_format=None, insert_text_mode=None, text_edit=None, text_edit_text=None, additional_text_edits=None, commit_characters=None, command=None, data=None)
A completion item represents a text snippet that is proposed to complete text that is being typed.
- Parameters:
label (str) –
label_details (Optional[CompletionItemLabelDetails]) –
kind (Optional[CompletionItemKind]) –
tags (Optional[List[CompletionItemTag]]) –
documentation (Optional[Union[str, MarkupContent]]) –
insert_text_format (Optional[InsertTextFormat]) –
insert_text_mode (Optional[InsertTextMode]) –
text_edit (Optional[Union[TextEdit, InsertReplaceEdit]]) –
- additional_text_edits: Optional[List[TextEdit]]
An optional array of additional
TextEdit text edits
that are applied when selecting this completion. Edits must not overlap (including the same insert position) with the maintextEdit edit
nor with themselves.Additional text edits should be used to change text unrelated to the current cursor position (for example adding an import statement at the top of the file if the completion item will insert an unqualified type).
- command: Optional[Command]
An optional
Command command
that is executed after inserting this completion. Note that additional modifications to the current document should be described with theadditionalTextEdits additionalTextEdits
-property.
- commit_characters: Optional[List[str]]
An optional set of characters that when pressed while this completion is active will accept it first and then type that character. Note that all commit characters should have
length=1
and that superfluous characters will be ignored.
- data: Optional[Any]
A data entry field that is preserved on a completion item between a
CompletionRequest
and a {@link CompletionResolveRequest}.
- detail: Optional[str]
A human-readable string with additional information about this item, like type or symbol information.
- documentation: Optional[Union[str, MarkupContent]]
A human-readable string that represents a doc-comment.
- filter_text: Optional[str]
A string that should be used when filtering a set of completion items. When
falsy
the {@link CompletionItem.label label} is used.
- insert_text: Optional[str]
A string that should be inserted into a document when selecting this completion. When
falsy
the {@link CompletionItem.label label} is used.The
insertText
is subject to interpretation by the client side. Some tools might not take the string literally. For example VS Code when code complete is requested in this examplecon<cursor position>
and a completion item with an insertText ofconsole
is provided it will only insert sole. Therefore it is recommended to usetextEdit
instead since it avoids additional client side interpretation.
- insert_text_format: Optional[InsertTextFormat]
The format of the insert text. The format applies to both the
insertText
property and the newText property of a providedtextEdit
. If omitted defaults to InsertTextFormat.PlainText.Please note that the insertTextFormat doesn’t apply to
additionalTextEdits
.
- insert_text_mode: Optional[InsertTextMode]
How whitespace and indentation is handled during completion item insertion. If not provided the clients default value depends on the
textDocument.completion.insertTextMode
client capability.LSP v3.16.0
- kind: Optional[CompletionItemKind]
The kind of this completion item. Based of the kind an icon is chosen by the editor.
- label: str
The label of this completion item.
The label property is also by default the text that is inserted when selecting this completion.
If label details are provided the label itself should be an unqualified name of the completion item.
- label_details: Optional[CompletionItemLabelDetails]
Additional details for the label
LSP v3.17.0
- preselect: Optional[bool]
Select this item when showing.
Note that only one completion item can be selected and that the tool / client decides which item that is. The rule is that the first item of those that match best is selected.
- sort_text: Optional[str]
A string that should be used when comparing this item with other items. When
falsy
the {@link CompletionItem.label label} is used.
- tags: Optional[List[CompletionItemTag]]
Tags for this completion item.
LSP v3.15.0
- text_edit: Optional[Union[TextEdit, InsertReplaceEdit]]
An
TextEdit edit
which is applied to a document when selecting this completion. When an edit is provided the value ofinsertText insertText
is ignored.Most editors support two different operations when accepting a completion item. One is to insert a completion text and the other is to replace an existing text with a completion text. Since this can usually not be predetermined by a server it can report both ranges. Clients need to signal support for
InsertReplaceEdits
via thetextDocument.completion.insertReplaceSupport
client capability property.Note 1: The text edit’s range as well as both ranges from an insert replace edit must be a [single line] and they must contain the position at which completion has been requested. Note 2: If an
InsertReplaceEdit
is returned the edit’s insert range must be a prefix of the edit’s replace range, that means it must be contained and starting at the same position.@since 3.16.0 additional type
InsertReplaceEdit
- text_edit_text: Optional[str]
The edit text used if the completion item is part of a CompletionList and CompletionList defines an item default for the text edit range.
Clients will only honor this property if they opt into completion list item defaults using the capability
completionList.itemDefaults
.If not provided and a list’s default range is provided the label property is used as a text.
LSP v3.17.0
- class lsprotocol.types.CompletionItemKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The kind of a completion entry.
- Class = 7
- Color = 16
- Constant = 21
- Constructor = 4
- Enum = 13
- EnumMember = 20
- Event = 23
- Field = 5
- File = 17
- Folder = 19
- Function = 3
- Interface = 8
- Keyword = 14
- Method = 2
- Module = 9
- Operator = 24
- Property = 10
- Reference = 18
- Snippet = 15
- Struct = 22
- Text = 1
- TypeParameter = 25
- Unit = 11
- Value = 12
- Variable = 6
- class lsprotocol.types.CompletionItemLabelDetails(detail=None, description=None)
Additional details for a completion item label.
LSP v3.17.0
- class lsprotocol.types.CompletionItemResolveRequest(id, params, method='completionItem/resolve', jsonrpc='2.0')
Request to resolve additional information for a given completion item.The request’s parameter is of type
CompletionItem
the response is of typeCompletionItem
or a Thenable that resolves to such.- params: CompletionItem
- class lsprotocol.types.CompletionItemResolveResponse(id, result=None, jsonrpc='2.0')
-
- result: CompletionItem
- class lsprotocol.types.CompletionItemTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Completion item tags are extra annotations that tweak the rendering of a completion item.
LSP v3.15.0
- Deprecated = 1
Render a completion as obsolete, usually using a strike-out.
- class lsprotocol.types.CompletionList(is_incomplete, items, item_defaults=None)
Represents a collection of
CompletionItem completion items
to be presented in the editor.- Parameters:
is_incomplete (bool) –
items (List[CompletionItem]) –
item_defaults (Optional[CompletionListItemDefaultsType]) –
- is_incomplete: bool
This list it not complete. Further typing results in recomputing this list.
Recomputed lists have all their items replaced (not appended) in the incomplete completion sessions.
- item_defaults: Optional[CompletionListItemDefaultsType]
In many cases the items of an actual completion result share the same value for properties like
commitCharacters
or the range of a text edit. A completion list can therefore define item defaults which will be used if a completion item itself doesn’t specify the value.If a completion list specifies a default value and a completion item also specifies a corresponding value the one from the item is used.
Servers are only allowed to return default values if the client signals support for this via the
completionList.itemDefaults
capability.LSP v3.17.0
- items: List[CompletionItem]
The completion items.
- class lsprotocol.types.CompletionListItemDefaultsType(commit_characters=None, edit_range=None, insert_text_format=None, insert_text_mode=None, data=None)
- Parameters:
edit_range (Optional[Union[Range, CompletionListItemDefaultsTypeEditRangeType1]]) –
insert_text_format (Optional[InsertTextFormat]) –
insert_text_mode (Optional[InsertTextMode]) –
- edit_range: Optional[Union[Range, CompletionListItemDefaultsTypeEditRangeType1]]
A default edit range.
LSP v3.17.0
- insert_text_format: Optional[InsertTextFormat]
A default insert text format.
LSP v3.17.0
- insert_text_mode: Optional[InsertTextMode]
A default insert text mode.
LSP v3.17.0
- class lsprotocol.types.CompletionListItemDefaultsTypeEditRangeType1(insert, replace)
- class lsprotocol.types.CompletionOptions(trigger_characters=None, all_commit_characters=None, resolve_provider=None, completion_item=None, work_done_progress=None)
Completion options.
- Parameters:
- all_commit_characters: Optional[List[str]]
The list of all possible characters that commit a completion. This field can be used if clients don’t support individual commit characters per completion item. See
ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport
If a server provides both
allCommitCharacters
and commit characters on an individual completion item the ones on the completion item win.LSP v3.2.0
- completion_item: Optional[CompletionOptionsCompletionItemType]
The server supports the following
CompletionItem
specific capabilities.LSP v3.17.0
- resolve_provider: Optional[bool]
The server provides support to resolve additional information for a completion item.
- trigger_characters: Optional[List[str]]
Most tools trigger completion request automatically without explicitly requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user starts to type an identifier. For example if the user types
c
in a JavaScript file code complete will automatically pop up presentconsole
besides others as a completion item. Characters that make up identifiers don’t need to be listed here.If code complete should automatically be trigger on characters not being valid inside an identifier (for example
.
in JavaScript) list them in triggerCharacters.
- class lsprotocol.types.CompletionOptionsCompletionItemType(label_details_support=None)
- class lsprotocol.types.CompletionParams(text_document, position, context=None, work_done_token=None, partial_result_token=None)
Completion parameters
- Parameters:
- context: Optional[CompletionContext]
The completion context. This is only available it the client specifies to send this using the client capability
textDocument.completion.contextSupport === true
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.CompletionRegistrationOptions(document_selector=None, trigger_characters=None, all_commit_characters=None, resolve_provider=None, completion_item=None, work_done_progress=None)
Registration options for a
CompletionRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
completion_item (Optional[CompletionRegistrationOptionsCompletionItemType]) –
- all_commit_characters: Optional[List[str]]
The list of all possible characters that commit a completion. This field can be used if clients don’t support individual commit characters per completion item. See
ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport
If a server provides both
allCommitCharacters
and commit characters on an individual completion item the ones on the completion item win.LSP v3.2.0
- completion_item: Optional[CompletionRegistrationOptionsCompletionItemType]
The server supports the following
CompletionItem
specific capabilities.LSP v3.17.0
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- resolve_provider: Optional[bool]
The server provides support to resolve additional information for a completion item.
- trigger_characters: Optional[List[str]]
Most tools trigger completion request automatically without explicitly requesting it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user starts to type an identifier. For example if the user types
c
in a JavaScript file code complete will automatically pop up presentconsole
besides others as a completion item. Characters that make up identifiers don’t need to be listed here.If code complete should automatically be trigger on characters not being valid inside an identifier (for example
.
in JavaScript) list them in triggerCharacters.
- class lsprotocol.types.CompletionRegistrationOptionsCompletionItemType(label_details_support=None)
- class lsprotocol.types.CompletionTriggerKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
How a completion was triggered
- Invoked = 1
Completion was triggered by typing an identifier (24x7 code complete), manual invocation (e.g Ctrl+Space) or via API.
- TriggerCharacter = 2
Completion was triggered by a trigger character specified by the
triggerCharacters
properties of the CompletionRegistrationOptions.
- TriggerForIncompleteCompletions = 3
Completion was re-triggered as current completion list is incomplete
- class lsprotocol.types.ConfigurationItem(scope_uri=None, section=None)
- class lsprotocol.types.ConfigurationParams(items)
The parameters of a configuration request.
- Parameters:
items (List[ConfigurationItem]) –
- items: List[ConfigurationItem]
- class lsprotocol.types.CreateFile(uri, kind='create', options=None, annotation_id=None)
Create file operation.
- Parameters:
- annotation_id: Optional[str]
An optional annotation identifier describing the operation.
LSP v3.16.0
- options: Optional[CreateFileOptions]
Additional options
- class lsprotocol.types.CreateFileOptions(overwrite=None, ignore_if_exists=None)
Options to create a file.
- class lsprotocol.types.CreateFilesParams(files)
The parameters sent in notifications/requests for user-initiated creation of files.
LSP v3.16.0
- Parameters:
files (List[FileCreate]) –
- files: List[FileCreate]
An array of all files/folders created in this operation.
- class lsprotocol.types.DeclarationClientCapabilities(dynamic_registration=None, link_support=None)
LSP v3.14.0
- class lsprotocol.types.DeclarationOptions(work_done_progress=None)
- class lsprotocol.types.DeclarationParams(text_document, position, work_done_token=None, partial_result_token=None)
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DeclarationRegistrationOptions(work_done_progress=None, document_selector=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DefinitionClientCapabilities(dynamic_registration=None, link_support=None)
Client Capabilities for a
DefinitionRequest
.
- class lsprotocol.types.DefinitionOptions(work_done_progress=None)
Server Capabilities for a
DefinitionRequest
.
- class lsprotocol.types.DefinitionParams(text_document, position, work_done_token=None, partial_result_token=None)
Parameters for a
DefinitionRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DefinitionRegistrationOptions(document_selector=None, work_done_progress=None)
Registration options for a
DefinitionRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DeleteFile(uri, kind='delete', options=None, annotation_id=None)
Delete file operation
- Parameters:
- annotation_id: Optional[str]
An optional annotation identifier describing the operation.
LSP v3.16.0
- options: Optional[DeleteFileOptions]
Delete options.
- class lsprotocol.types.DeleteFileOptions(recursive=None, ignore_if_not_exists=None)
Delete file options
- class lsprotocol.types.DeleteFilesParams(files)
The parameters sent in notifications/requests for user-initiated deletes of files.
LSP v3.16.0
- Parameters:
files (List[FileDelete]) –
- files: List[FileDelete]
An array of all files/folders deleted in this operation.
- class lsprotocol.types.Diagnostic(range, message, severity=None, code=None, code_description=None, source=None, tags=None, related_information=None, data=None)
Represents a diagnostic, such as a compiler error or warning. Diagnostic objects are only valid in the scope of a resource.
- Parameters:
range (Range) –
message (str) –
severity (Optional[DiagnosticSeverity]) –
code_description (Optional[CodeDescription]) –
tags (Optional[List[DiagnosticTag]]) –
related_information (Optional[List[DiagnosticRelatedInformation]]) –
- code_description: Optional[CodeDescription]
An optional property to describe the error code. Requires the code field (above) to be present/not null.
LSP v3.16.0
- data: Optional[Any]
A data entry field that is preserved between a
textDocument/publishDiagnostics
notification andtextDocument/codeAction
request.LSP v3.16.0
An array of related diagnostic information, e.g. when symbol-names within a scope collide all definitions can be marked via this property.
- severity: Optional[DiagnosticSeverity]
The diagnostic’s severity. Can be omitted. If omitted it is up to the client to interpret diagnostics as error, warning, info or hint.
- source: Optional[str]
A human-readable string describing the source of this diagnostic, e.g. ‘typescript’ or ‘super lint’. It usually appears in the user interface.
- tags: Optional[List[DiagnosticTag]]
Additional metadata about the diagnostic.
LSP v3.15.0
- class lsprotocol.types.DiagnosticClientCapabilities(dynamic_registration=None, related_document_support=None)
Client capabilities specific to diagnostic pull requests.
LSP v3.17.0
- dynamic_registration: Optional[bool]
Whether implementation supports dynamic registration. If this is set to
true
the client supports the new(TextDocumentRegistrationOptions & StaticRegistrationOptions)
return value for the corresponding server capability as well.
Whether the clients supports related documents for document diagnostic pulls.
- class lsprotocol.types.DiagnosticOptions(inter_file_dependencies, workspace_diagnostics, identifier=None, work_done_progress=None)
Diagnostic options.
LSP v3.17.0
- Parameters:
- identifier: Optional[str]
An optional identifier under which the diagnostics are managed by the client.
- class lsprotocol.types.DiagnosticRegistrationOptions(inter_file_dependencies, workspace_diagnostics, document_selector=None, identifier=None, work_done_progress=None, id=None)
Diagnostic registration options.
LSP v3.17.0
- Parameters:
inter_file_dependencies (bool) –
workspace_diagnostics (bool) –
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- id: Optional[str]
The id used to register the request. The id can be used to deregister the request again. See also Registration#id.
- identifier: Optional[str]
An optional identifier under which the diagnostics are managed by the client.
- class lsprotocol.types.DiagnosticRelatedInformation(location, message)
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.
- class lsprotocol.types.DiagnosticServerCancellationData(retrigger_request)
Cancellation data returned from a diagnostic request.
LSP v3.17.0
- Parameters:
retrigger_request (bool) –
- class lsprotocol.types.DiagnosticSeverity(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The diagnostic’s severity.
- Error = 1
Reports an error.
- Hint = 4
Reports a hint.
- Information = 3
Reports an information.
- Warning = 2
Reports a warning.
- class lsprotocol.types.DiagnosticTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The diagnostic tags.
LSP v3.15.0
- Deprecated = 2
Deprecated or obsolete code.
Clients are allowed to rendered diagnostics with this tag strike through.
- Unnecessary = 1
Unused or unnecessary code.
Clients are allowed to render diagnostics with this tag faded out instead of having an error squiggle.
- class lsprotocol.types.DiagnosticWorkspaceClientCapabilities(refresh_support=None)
Workspace client capabilities specific to diagnostic pull requests.
LSP v3.17.0
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all pulled diagnostics currently shown. It should be used with absolute care and is useful for situation where a server for example detects a project wide change that requires such a calculation.
- class lsprotocol.types.DidChangeConfigurationClientCapabilities(dynamic_registration=None)
- class lsprotocol.types.DidChangeConfigurationParams(settings)
The parameters of a change configuration notification.
- class lsprotocol.types.DidChangeConfigurationRegistrationOptions(section=None)
- class lsprotocol.types.DidChangeNotebookDocumentParams(notebook_document, change)
The params sent in a change notebook document notification.
LSP v3.17.0
- Parameters:
notebook_document (VersionedNotebookDocumentIdentifier) –
change (NotebookDocumentChangeEvent) –
- change: NotebookDocumentChangeEvent
The actual changes to the notebook document.
The changes describe single state changes to the notebook document. So if there are two changes c1 (at array index 0) and c2 (at array index 1) for a notebook in state S then c1 moves the notebook from S to S’ and c2 from S’ to S’’. So c1 is computed on the state S and c2 is computed on the state S’.
To mirror the content of a notebook using change events use the following approach:
start with the same initial content
apply the ‘notebookDocument/didChange’ notifications in the order you receive them.
apply the
NotebookChangeEvent
s in a single notification in the order you receive them.
- notebook_document: VersionedNotebookDocumentIdentifier
The notebook document that did change. The version number points to the version after all provided changes have been applied. If only the text document content of a cell changes the notebook version doesn’t necessarily have to change.
- class lsprotocol.types.DidChangeTextDocumentParams(text_document, content_changes)
The change text document notification’s parameters.
- Parameters:
text_document (VersionedTextDocumentIdentifier) –
content_changes (List[Union[TextDocumentContentChangeEvent_Type1, TextDocumentContentChangeEvent_Type2]]) –
- content_changes: List[Union[TextDocumentContentChangeEvent_Type1, TextDocumentContentChangeEvent_Type2]]
The actual content changes. The content changes describe single state changes to the document. So if there are two content changes c1 (at array index 0) and c2 (at array index 1) for a document in state S then c1 moves the document from S to S’ and c2 from S’ to S’’. So c1 is computed on the state S and c2 is computed on the state S’.
To mirror the content of a document using change events use the following approach:
start with the same initial content
apply the ‘textDocument/didChange’ notifications in the order you receive them.
apply the
TextDocumentContentChangeEvent
s in a single notification in the order you receive them.
- text_document: VersionedTextDocumentIdentifier
The document that did change. The version number points to the version after all provided content changes have been applied.
- class lsprotocol.types.DidChangeWatchedFilesClientCapabilities(dynamic_registration=None, relative_pattern_support=None)
- class lsprotocol.types.DidChangeWatchedFilesParams(changes)
The watched files change notification’s parameters.
- class lsprotocol.types.DidChangeWatchedFilesRegistrationOptions(watchers)
Describe options to be used when registered for text document change events.
- Parameters:
watchers (List[FileSystemWatcher]) –
- watchers: List[FileSystemWatcher]
The watchers to register.
- class lsprotocol.types.DidChangeWorkspaceFoldersParams(event)
The parameters of a
workspace/didChangeWorkspaceFolders
notification.- Parameters:
event (WorkspaceFoldersChangeEvent) –
- event: WorkspaceFoldersChangeEvent
The actual workspace folder change event.
- class lsprotocol.types.DidCloseNotebookDocumentParams(notebook_document, cell_text_documents)
The params sent in a close notebook document notification.
LSP v3.17.0
- Parameters:
notebook_document (NotebookDocumentIdentifier) –
cell_text_documents (List[TextDocumentIdentifier]) –
- cell_text_documents: List[TextDocumentIdentifier]
The text documents that represent the content of a notebook cell that got closed.
- notebook_document: NotebookDocumentIdentifier
The notebook document that got closed.
- class lsprotocol.types.DidCloseTextDocumentParams(text_document)
The parameters sent in a close text document notification
- Parameters:
text_document (TextDocumentIdentifier) –
- text_document: TextDocumentIdentifier
The document that was closed.
- class lsprotocol.types.DidOpenNotebookDocumentParams(notebook_document, cell_text_documents)
The params sent in an open notebook document notification.
LSP v3.17.0
- Parameters:
notebook_document (NotebookDocument) –
cell_text_documents (List[TextDocumentItem]) –
- cell_text_documents: List[TextDocumentItem]
The text documents that represent the content of a notebook cell.
- notebook_document: NotebookDocument
The notebook document that got opened.
- class lsprotocol.types.DidOpenTextDocumentParams(text_document)
The parameters sent in an open text document notification
- Parameters:
text_document (TextDocumentItem) –
- text_document: TextDocumentItem
The document that was opened.
- class lsprotocol.types.DidSaveNotebookDocumentParams(notebook_document)
The params sent in a save notebook document notification.
LSP v3.17.0
- Parameters:
notebook_document (NotebookDocumentIdentifier) –
- notebook_document: NotebookDocumentIdentifier
The notebook document that got saved.
- class lsprotocol.types.DidSaveTextDocumentParams(text_document, text=None)
The parameters sent in a save text document notification
- Parameters:
text_document (TextDocumentIdentifier) –
- text: Optional[str]
Optional the content when saved. Depends on the includeText value when the save notification was requested.
- text_document: TextDocumentIdentifier
The document that was saved.
- class lsprotocol.types.DocumentColorClientCapabilities(dynamic_registration=None)
- class lsprotocol.types.DocumentColorOptions(work_done_progress=None)
- class lsprotocol.types.DocumentColorParams(text_document, work_done_token=None, partial_result_token=None)
Parameters for a
DocumentColorRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DocumentColorRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentDiagnosticParams(text_document, identifier=None, previous_result_id=None, work_done_token=None, partial_result_token=None)
Parameters of the document diagnostic request.
LSP v3.17.0
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DocumentDiagnosticReportKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The document diagnostic report kinds.
LSP v3.17.0
- Full = 'full'
A diagnostic report with a full set of problems.
- Unchanged = 'unchanged'
A report indicating that the last returned report is still accurate.
- class lsprotocol.types.DocumentDiagnosticReportPartialResult(related_documents)
A partial result for a document diagnostic report.
LSP v3.17.0
- Parameters:
related_documents (Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]) –
- class lsprotocol.types.DocumentFormattingClientCapabilities(dynamic_registration=None)
Client capabilities of a
DocumentFormattingRequest
.
- class lsprotocol.types.DocumentFormattingOptions(work_done_progress=None)
Provider options for a
DocumentFormattingRequest
.
- class lsprotocol.types.DocumentFormattingParams(text_document, options, work_done_token=None)
The parameters of a
DocumentFormattingRequest
.- Parameters:
text_document (TextDocumentIdentifier) –
options (FormattingOptions) –
- options: FormattingOptions
The format options.
- text_document: TextDocumentIdentifier
The document to format.
- class lsprotocol.types.DocumentFormattingRegistrationOptions(document_selector=None, work_done_progress=None)
Registration options for a
DocumentFormattingRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentHighlight(range, kind=None)
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.
- Parameters:
range (Range) –
kind (Optional[DocumentHighlightKind]) –
- kind: Optional[DocumentHighlightKind]
The highlight kind, default is
Text text
.
- class lsprotocol.types.DocumentHighlightClientCapabilities(dynamic_registration=None)
Client Capabilities for a
DocumentHighlightRequest
.
- class lsprotocol.types.DocumentHighlightKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A document highlight kind.
- Read = 2
Read-access of a symbol, like reading a variable.
- Text = 1
A textual occurrence.
- Write = 3
Write-access of a symbol, like writing to a variable.
- class lsprotocol.types.DocumentHighlightOptions(work_done_progress=None)
Provider options for a
DocumentHighlightRequest
.
- class lsprotocol.types.DocumentHighlightParams(text_document, position, work_done_token=None, partial_result_token=None)
Parameters for a
DocumentHighlightRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DocumentHighlightRegistrationOptions(document_selector=None, work_done_progress=None)
Registration options for a
DocumentHighlightRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentLink(range, target=None, tooltip=None, data=None)
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.
- Parameters:
- data: Optional[Any]
A data entry field that is preserved on a document link between a DocumentLinkRequest and a DocumentLinkResolveRequest.
- tooltip: Optional[str]
The tooltip text when you hover over this link.
If a tooltip is provided, is will be displayed in a string that includes instructions on how to trigger the link, such as
{0} (ctrl + click)
. The specific instructions vary depending on OS, user settings, and localization.LSP v3.15.0
- class lsprotocol.types.DocumentLinkClientCapabilities(dynamic_registration=None, tooltip_support=None)
The client capabilities of a
DocumentLinkRequest
.
- class lsprotocol.types.DocumentLinkOptions(resolve_provider=None, work_done_progress=None)
Provider options for a
DocumentLinkRequest
.
- class lsprotocol.types.DocumentLinkParams(text_document, work_done_token=None, partial_result_token=None)
The parameters of a
DocumentLinkRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The document to provide document links for.
- class lsprotocol.types.DocumentLinkRegistrationOptions(document_selector=None, resolve_provider=None, work_done_progress=None)
Registration options for a
DocumentLinkRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentLinkResolveRequest(id, params, method='documentLink/resolve', jsonrpc='2.0')
Request to resolve additional information for a given document link. The request’s parameter is of type
DocumentLink
the response is of typeDocumentLink
or a Thenable that resolves to such.- params: DocumentLink
- class lsprotocol.types.DocumentLinkResolveResponse(id, result=None, jsonrpc='2.0')
-
- result: DocumentLink
- class lsprotocol.types.DocumentOnTypeFormattingClientCapabilities(dynamic_registration=None)
Client capabilities of a
DocumentOnTypeFormattingRequest
.
- class lsprotocol.types.DocumentOnTypeFormattingOptions(first_trigger_character, more_trigger_character=None)
Provider options for a
DocumentOnTypeFormattingRequest
.
- class lsprotocol.types.DocumentOnTypeFormattingParams(text_document, position, ch, options)
The parameters of a
DocumentOnTypeFormattingRequest
.- Parameters:
text_document (TextDocumentIdentifier) –
position (Position) –
ch (str) –
options (FormattingOptions) –
- ch: str
The character that has been typed that triggered the formatting on type request. That is not necessarily the last character that got inserted into the document since the client could auto insert characters as well (e.g. like automatic brace completion).
- options: FormattingOptions
The formatting options.
- position: Position
The position around which the on type formatting should happen. This is not necessarily the exact position where the character denoted by the property
ch
got typed.
- text_document: TextDocumentIdentifier
The document to format.
- class lsprotocol.types.DocumentOnTypeFormattingRegistrationOptions(first_trigger_character, document_selector=None, more_trigger_character=None)
Registration options for a
DocumentOnTypeFormattingRequest
.- Parameters:
first_trigger_character (str) –
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentRangeFormattingClientCapabilities(dynamic_registration=None, ranges_support=None)
Client capabilities of a
DocumentRangeFormattingRequest
.
- class lsprotocol.types.DocumentRangeFormattingOptions(ranges_support=None, work_done_progress=None)
Provider options for a
DocumentRangeFormattingRequest
.
- class lsprotocol.types.DocumentRangeFormattingParams(text_document, range, options, work_done_token=None)
The parameters of a
DocumentRangeFormattingRequest
.- Parameters:
text_document (TextDocumentIdentifier) –
range (Range) –
options (FormattingOptions) –
- options: FormattingOptions
The format options
- text_document: TextDocumentIdentifier
The document to format.
- class lsprotocol.types.DocumentRangeFormattingRegistrationOptions(document_selector=None, ranges_support=None, work_done_progress=None)
Registration options for a
DocumentRangeFormattingRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.DocumentRangesFormattingParams(text_document, ranges, options, work_done_token=None)
The parameters of a
DocumentRangesFormattingRequest
.LSP v3.18.0 @proposed
- Parameters:
text_document (TextDocumentIdentifier) –
options (FormattingOptions) –
- options: FormattingOptions
The format options
- text_document: TextDocumentIdentifier
The document to format.
- class lsprotocol.types.DocumentSymbol(name, kind, range, selection_range, detail=None, tags=None, deprecated=None, children=None)
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.
- Parameters:
- children: Optional[List[DocumentSymbol]]
Children of this symbol, e.g. properties of a class.
- kind: SymbolKind
The kind of this symbol.
- name: str
The name of this symbol. Will be displayed in the user interface and therefore must not be an empty string or a string only consisting of white spaces.
- range: Range
The range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to determine if the clients cursor is inside the symbol to reveal in the symbol in the UI.
- class lsprotocol.types.DocumentSymbolClientCapabilities(dynamic_registration=None, symbol_kind=None, hierarchical_document_symbol_support=None, tag_support=None, label_support=None)
Client Capabilities for a
DocumentSymbolRequest
.- Parameters:
symbol_kind (Optional[DocumentSymbolClientCapabilitiesSymbolKindType]) –
tag_support (Optional[DocumentSymbolClientCapabilitiesTagSupportType]) –
- hierarchical_document_symbol_support: Optional[bool]
The client supports hierarchical document symbols.
- label_support: Optional[bool]
The client supports an additional label presented in the UI when registering a document symbol provider.
LSP v3.16.0
- symbol_kind: Optional[DocumentSymbolClientCapabilitiesSymbolKindType]
Specific capabilities for the
SymbolKind
in thetextDocument/documentSymbol
request.
- tag_support: Optional[DocumentSymbolClientCapabilitiesTagSupportType]
The client supports tags on
SymbolInformation
. Tags are supported onDocumentSymbol
if hierarchicalDocumentSymbolSupport is set to true. Clients supporting tags have to handle unknown tags gracefully.LSP v3.16.0
- class lsprotocol.types.DocumentSymbolClientCapabilitiesSymbolKindType(value_set=None)
- Parameters:
value_set (Optional[List[SymbolKind]]) –
- value_set: Optional[List[SymbolKind]]
The symbol kind values the client supports. When this property exists the client also guarantees that it will handle values outside its set gracefully and falls back to a default value when unknown.
If this property is not present the client only supports the symbol kinds from
File
to Array as defined in the initial version of the protocol.
- class lsprotocol.types.DocumentSymbolClientCapabilitiesTagSupportType(value_set)
- class lsprotocol.types.DocumentSymbolOptions(label=None, work_done_progress=None)
Provider options for a
DocumentSymbolRequest
.
- class lsprotocol.types.DocumentSymbolParams(text_document, work_done_token=None, partial_result_token=None)
Parameters for a
DocumentSymbolRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.DocumentSymbolRegistrationOptions(document_selector=None, label=None, work_done_progress=None)
Registration options for a
DocumentSymbolRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.ErrorCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Predefined error codes.
- InternalError = -32603
- InvalidParams = -32602
- InvalidRequest = -32600
- MethodNotFound = -32601
- ParseError = -32700
- ServerNotInitialized = -32002
Error code indicating that a server received a notification or request before the server has received the
initialize
request.
- UnknownErrorCode = -32001
- class lsprotocol.types.ExecuteCommandClientCapabilities(dynamic_registration=None)
The client capabilities of a
ExecuteCommandRequest
.
- class lsprotocol.types.ExecuteCommandOptions(commands, work_done_progress=None)
The server capabilities of a
ExecuteCommandRequest
.
- class lsprotocol.types.ExecuteCommandParams(command, arguments=None, work_done_token=None)
The parameters of a
ExecuteCommandRequest
.- Parameters:
- class lsprotocol.types.ExecuteCommandRegistrationOptions(commands, work_done_progress=None)
Registration options for a
ExecuteCommandRequest
.
- class lsprotocol.types.ExecutionSummary(execution_order, success=None)
- class lsprotocol.types.ExitNotification(params=None, method='exit', jsonrpc='2.0')
The exit event is sent from the client to the server to ask the server to exit its process.
- class lsprotocol.types.FailureHandlingKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Abort = 'abort'
Applying the workspace change is simply aborted if one of the changes provided fails. All operations executed before the failing operation stay executed.
- TextOnlyTransactional = 'textOnlyTransactional'
If the workspace edit contains only textual file changes they are executed transactional. If resource changes (create, rename or delete file) are part of the change the failure handling strategy is abort.
- Transactional = 'transactional'
All operations are executed transactional. That means they either all succeed or no changes at all are applied to the workspace.
- Undo = 'undo'
The client tries to undo the operations already executed. But there is no guarantee that this is succeeding.
- class lsprotocol.types.FileChangeType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The file event type
- Changed = 2
The file got changed.
- Created = 1
The file got created.
- Deleted = 3
The file got deleted.
- class lsprotocol.types.FileCreate(uri)
Represents information on a file/folder create.
LSP v3.16.0
- Parameters:
uri (str) –
- class lsprotocol.types.FileDelete(uri)
Represents information on a file/folder delete.
LSP v3.16.0
- Parameters:
uri (str) –
- class lsprotocol.types.FileEvent(uri, type)
An event describing a file change.
- Parameters:
uri (str) –
type (FileChangeType) –
- type: FileChangeType
The change type.
- class lsprotocol.types.FileOperationClientCapabilities(dynamic_registration=None, did_create=None, will_create=None, did_rename=None, will_rename=None, did_delete=None, will_delete=None)
Capabilities relating to events from file operations by the user in the client.
These events do not come from the file system, they come from user operations like renaming a file in the UI.
LSP v3.16.0
- Parameters:
- class lsprotocol.types.FileOperationFilter(pattern, scheme=None)
A filter to describe in which file operation requests or notifications the server is interested in receiving.
LSP v3.16.0
- Parameters:
pattern (FileOperationPattern) –
- pattern: FileOperationPattern
The actual file operation pattern.
- class lsprotocol.types.FileOperationOptions(did_create=None, will_create=None, did_rename=None, will_rename=None, did_delete=None, will_delete=None)
Options for notifications/requests for user operations on files.
LSP v3.16.0
- Parameters:
did_create (Optional[FileOperationRegistrationOptions]) –
will_create (Optional[FileOperationRegistrationOptions]) –
did_rename (Optional[FileOperationRegistrationOptions]) –
will_rename (Optional[FileOperationRegistrationOptions]) –
did_delete (Optional[FileOperationRegistrationOptions]) –
will_delete (Optional[FileOperationRegistrationOptions]) –
- did_create: Optional[FileOperationRegistrationOptions]
The server is interested in receiving didCreateFiles notifications.
- did_delete: Optional[FileOperationRegistrationOptions]
The server is interested in receiving didDeleteFiles file notifications.
- did_rename: Optional[FileOperationRegistrationOptions]
The server is interested in receiving didRenameFiles notifications.
- will_create: Optional[FileOperationRegistrationOptions]
The server is interested in receiving willCreateFiles requests.
- will_delete: Optional[FileOperationRegistrationOptions]
The server is interested in receiving willDeleteFiles file requests.
- will_rename: Optional[FileOperationRegistrationOptions]
The server is interested in receiving willRenameFiles requests.
- class lsprotocol.types.FileOperationPattern(glob, matches=None, options=None)
A pattern to describe in which file operation requests or notifications the server is interested in receiving.
LSP v3.16.0
- Parameters:
glob (str) –
matches (Optional[FileOperationPatternKind]) –
options (Optional[FileOperationPatternOptions]) –
- glob: str
The glob pattern to match. Glob patterns can have the following syntax:
*
to match one or more characters in a path segment?
to match on one character in a path segment**
to match any number of path segments, including none{}
to group sub patterns into an OR expression. (e.g. **/*.{ts,js} matches all TypeScript and JavaScript files)[]
to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …)[!...]
to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0)
- matches: Optional[FileOperationPatternKind]
Whether to match files or folders with this pattern.
Matches both if undefined.
- options: Optional[FileOperationPatternOptions]
Additional options used during matching.
- class lsprotocol.types.FileOperationPatternKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A pattern kind describing if a glob pattern matches a file a folder or both.
LSP v3.16.0
- File = 'file'
The pattern matches a file only.
- Folder = 'folder'
The pattern matches a folder only.
- class lsprotocol.types.FileOperationPatternOptions(ignore_case=None)
Matching options for the file operation pattern.
LSP v3.16.0
- class lsprotocol.types.FileOperationRegistrationOptions(filters)
The options to register for file operations.
LSP v3.16.0
- Parameters:
filters (List[FileOperationFilter]) –
- filters: List[FileOperationFilter]
The actual filters.
- class lsprotocol.types.FileRename(old_uri, new_uri)
Represents information on a file/folder rename.
LSP v3.16.0
- class lsprotocol.types.FileSystemWatcher(glob_pattern, kind=None)
-
- glob_pattern: Union[str, RelativePattern]
The glob pattern to watch. See
GlobPattern glob pattern
for more detail.LSP v3.17.0 support for relative patterns.
- class lsprotocol.types.FoldingRange(start_line, end_line, start_character=None, end_character=None, kind=None, collapsed_text=None)
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:
- collapsed_text: Optional[str]
The text that the client should show when the specified range is collapsed. If not defined or not supported by the client, a default will be chosen by the client.
LSP v3.17.0
- end_character: Optional[int]
The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
- end_line: int
The zero-based end line of the range to fold. The folded area ends with the line’s last character. To be valid, the end must be zero or larger and smaller than the number of lines in the document.
- kind: Optional[Union[FoldingRangeKind, str]]
Describes the kind of the folding range such as comment’ or ‘region’. The kind is used to categorize folding ranges and used by commands like ‘Fold all comments’. See :class:`~lsprotocol.types.FoldingRangeKind for an enumeration of standardized kinds.
- class lsprotocol.types.FoldingRangeClientCapabilities(dynamic_registration=None, range_limit=None, line_folding_only=None, folding_range_kind=None, folding_range=None)
- Parameters:
folding_range_kind (Optional[FoldingRangeClientCapabilitiesFoldingRangeKindType]) –
folding_range (Optional[FoldingRangeClientCapabilitiesFoldingRangeType]) –
- dynamic_registration: Optional[bool]
Whether implementation supports dynamic registration for folding range providers. If this is set to
true
the client supports the newFoldingRangeRegistrationOptions
return value for the corresponding server capability as well.
- folding_range: Optional[FoldingRangeClientCapabilitiesFoldingRangeType]
Specific options for the folding range.
LSP v3.17.0
- folding_range_kind: Optional[FoldingRangeClientCapabilitiesFoldingRangeKindType]
Specific options for the folding range kind.
LSP v3.17.0
- class lsprotocol.types.FoldingRangeClientCapabilitiesFoldingRangeKindType(value_set=None)
- Parameters:
value_set (Optional[List[Union[FoldingRangeKind, str]]]) –
- class lsprotocol.types.FoldingRangeClientCapabilitiesFoldingRangeType(collapsed_text=None)
- class lsprotocol.types.FoldingRangeKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A set of predefined range kinds.
- Comment = 'comment'
Folding range for a comment
- Imports = 'imports'
Folding range for an import or include
- Region = 'region'
Folding range for a region (e.g.
#region
)
- class lsprotocol.types.FoldingRangeOptions(work_done_progress=None)
- class lsprotocol.types.FoldingRangeParams(text_document, work_done_token=None, partial_result_token=None)
Parameters for a
FoldingRangeRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.FoldingRangeRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.FoldingRangeWorkspaceClientCapabilities(refresh_support=None)
Client workspace capabilities specific to folding ranges
LSP v3.18.0 @proposed
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all folding ranges currently shown. It should be used with absolute care and is useful for situation where a server for example detects a project wide change that requires such a calculation.
LSP v3.18.0 @proposed
- class lsprotocol.types.FormattingOptions(tab_size, insert_spaces, trim_trailing_whitespace=None, insert_final_newline=None, trim_final_newlines=None)
Value-object describing what options formatting should use.
- Parameters:
- insert_final_newline: Optional[bool]
Insert a newline character at the end of the file if one does not exist.
LSP v3.15.0
- class lsprotocol.types.FullDocumentDiagnosticReport(items, kind='full', result_id=None)
A diagnostic report with a full set of problems.
LSP v3.17.0
- Parameters:
items (List[Diagnostic]) –
kind (str) –
- items: List[Diagnostic]
The actual items.
- class lsprotocol.types.GeneralClientCapabilities(stale_request_support=None, regular_expressions=None, markdown=None, position_encodings=None)
General client capabilities.
LSP v3.16.0
- Parameters:
stale_request_support (Optional[GeneralClientCapabilitiesStaleRequestSupportType]) –
regular_expressions (Optional[RegularExpressionsClientCapabilities]) –
markdown (Optional[MarkdownClientCapabilities]) –
position_encodings (Optional[List[Union[PositionEncodingKind, str]]]) –
- markdown: Optional[MarkdownClientCapabilities]
Client capabilities specific to the client’s markdown parser.
LSP v3.16.0
- position_encodings: Optional[List[Union[PositionEncodingKind, str]]]
The position encodings supported by the client. Client and server have to agree on the same position encoding to ensure that offsets (e.g. character position in a line) are interpreted the same on both sides.
To keep the protocol backwards compatible the following applies: if the value ‘utf-16’ is missing from the array of position encodings servers can assume that the client supports UTF-16. UTF-16 is therefore a mandatory encoding.
If omitted it defaults to [‘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.
LSP v3.17.0
- regular_expressions: Optional[RegularExpressionsClientCapabilities]
Client capabilities specific to regular expressions.
LSP v3.16.0
- stale_request_support: Optional[GeneralClientCapabilitiesStaleRequestSupportType]
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).
LSP v3.17.0
- class lsprotocol.types.GeneralClientCapabilitiesStaleRequestSupportType(cancel, retry_on_content_modified)
- class lsprotocol.types.Hover(contents, range=None)
The result of a hover request.
- Parameters:
contents (Union[MarkupContent, str, MarkedString_Type1, List[Union[str, MarkedString_Type1]]]) –
- contents: Union[MarkupContent, str, MarkedString_Type1, List[Union[str, MarkedString_Type1]]]
The hover’s content
- class lsprotocol.types.HoverClientCapabilities(dynamic_registration=None, content_format=None)
- Parameters:
content_format (Optional[List[MarkupKind]]) –
- content_format: Optional[List[MarkupKind]]
Client supports the following content formats for the content property. The order describes the preferred format of the client.
- class lsprotocol.types.HoverOptions(work_done_progress=None)
Hover options.
- class lsprotocol.types.HoverParams(text_document, position, work_done_token=None)
Parameters for a
HoverRequest
.- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.HoverRegistrationOptions(document_selector=None, work_done_progress=None)
Registration options for a
HoverRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.ImplementationClientCapabilities(dynamic_registration=None, link_support=None)
LSP v3.6.0
- class lsprotocol.types.ImplementationOptions(work_done_progress=None)
- class lsprotocol.types.ImplementationParams(text_document, position, work_done_token=None, partial_result_token=None)
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.ImplementationRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.InitializeError(retry)
The data type of the ResponseError if the initialize request fails.
- Parameters:
retry (bool) –
- class lsprotocol.types.InitializeParams(capabilities, process_id=None, client_info=None, locale=None, root_path=None, root_uri=None, initialization_options=None, trace=None, work_done_token=None, workspace_folders=None)
- Parameters:
capabilities (ClientCapabilities) –
client_info (Optional[InitializeParamsClientInfoType]) –
trace (Optional[TraceValues]) –
workspace_folders (Optional[List[WorkspaceFolder]]) –
- capabilities: ClientCapabilities
The capabilities provided by the client (editor or tool)
- client_info: Optional[InitializeParamsClientInfoType]
Information about the client
LSP v3.15.0
- locale: Optional[str]
The locale the client is currently showing the user interface in. This must not necessarily be the locale of the operating system.
Uses IETF language tags as the value’s syntax (See https://en.wikipedia.org/wiki/IETF_language_tag)
LSP v3.16.0
- process_id: Optional[int]
The process Id of the parent process that started the server.
Is
null
if the process has not been started by another process. If the parent process is not alive then the server should exit.
- root_path: Optional[str]
The rootPath of the workspace. Is null if no folder is open.
@deprecated in favour of rootUri.
- root_uri: Optional[str]
The rootUri of the workspace. Is null if no folder is open. If both
rootPath
and rootUri are setrootUri
wins.@deprecated in favour of workspaceFolders.
- trace: Optional[TraceValues]
The initial trace setting. If omitted trace is disabled (‘off’).
- work_done_token: Optional[Union[int, str]]
An optional token that a server can use to report work done progress.
- workspace_folders: Optional[List[WorkspaceFolder]]
The workspace folders configured in the client when the server starts.
This property is only available if the client supports workspace folders. It can be
null
if the client supports workspace folders but none are configured.LSP v3.6.0
- class lsprotocol.types.InitializeParamsClientInfoType(name, version=None)
- class lsprotocol.types.InitializeRequest(id, params, method='initialize', jsonrpc='2.0')
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 typeInitializeResult
of a Thenable that resolves to such.- params: InitializeParams
- class lsprotocol.types.InitializeResponse(id, result=None, jsonrpc='2.0')
-
- result: InitializeResult
- class lsprotocol.types.InitializeResult(capabilities, server_info=None)
The result returned from an initialize request.
- Parameters:
capabilities (ServerCapabilities) –
server_info (Optional[InitializeResultServerInfoType]) –
- capabilities: ServerCapabilities
The capabilities the language server provides.
- server_info: Optional[InitializeResultServerInfoType]
Information about the server.
LSP v3.15.0
- class lsprotocol.types.InitializeResultServerInfoType(name, version=None)
- class lsprotocol.types.InitializedNotification(params, method='initialized', jsonrpc='2.0')
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.
- Parameters:
params (InitializedParams) –
method (str) –
jsonrpc (str) –
- params: InitializedParams
- class lsprotocol.types.InitializedParams
- class lsprotocol.types.InlayHint(position, label, kind=None, text_edits=None, tooltip=None, padding_left=None, padding_right=None, data=None)
Inlay hint information.
LSP v3.17.0
- Parameters:
- data: Optional[Any]
A data entry field that is preserved on an inlay hint between a
textDocument/inlayHint
and a inlayHint/resolve request.
- kind: Optional[InlayHintKind]
The kind of this hint. Can be omitted in which case the client should fall back to a reasonable default.
- label: Union[str, List[InlayHintLabelPart]]
The label of this hint. A human readable string or an array of InlayHintLabelPart label parts.
Note that neither the string nor the label part can be empty.
- padding_left: Optional[bool]
Render padding before the hint.
Note: Padding should use the editor’s background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint.
- padding_right: Optional[bool]
Render padding after the hint.
Note: Padding should use the editor’s background color, not the background color of the hint itself. That means padding can be used to visually align/separate an inlay hint.
- text_edits: Optional[List[TextEdit]]
Optional text edits that are performed when accepting this inlay hint.
Note that edits are expected to change the document so that the inlay hint (or its nearest variant) is now part of the document and the inlay hint itself is now obsolete.
- tooltip: Optional[Union[str, MarkupContent]]
The tooltip text when you hover over this item.
- class lsprotocol.types.InlayHintClientCapabilities(dynamic_registration=None, resolve_support=None)
Inlay hint client capabilities.
LSP v3.17.0
- Parameters:
resolve_support (Optional[InlayHintClientCapabilitiesResolveSupportType]) –
- resolve_support: Optional[InlayHintClientCapabilitiesResolveSupportType]
Indicates which properties a client can resolve lazily on an inlay hint.
- class lsprotocol.types.InlayHintClientCapabilitiesResolveSupportType(properties)
- class lsprotocol.types.InlayHintKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Inlay hint kinds.
LSP v3.17.0
- Parameter = 2
An inlay hint that is for a parameter.
- Type = 1
An inlay hint that for a type annotation.
- class lsprotocol.types.InlayHintLabelPart(value, tooltip=None, location=None, command=None)
An inlay hint label part allows for interactive and composite labels of inlay hints.
LSP v3.17.0
- Parameters:
- command: Optional[Command]
An optional command for this label part.
Depending on the client capability
inlayHint.resolveSupport
clients might resolve this property late using the resolve request.
- location: Optional[Location]
An optional source code location that represents this label part.
The editor will use this location for the hover and for code navigation features: This part will become a clickable link that resolves to the definition of the symbol at the given location (not necessarily the location itself), it shows the hover that shows at the given location, and it shows a context menu with further code navigation commands.
Depending on the client capability
inlayHint.resolveSupport
clients might resolve this property late using the resolve request.
- tooltip: Optional[Union[str, MarkupContent]]
The tooltip text when you hover over this label part. Depending on the client capability
inlayHint.resolveSupport
clients might resolve this property late using the resolve request.
- class lsprotocol.types.InlayHintOptions(resolve_provider=None, work_done_progress=None)
Inlay hint options used during static registration.
LSP v3.17.0
- class lsprotocol.types.InlayHintParams(text_document, range, work_done_token=None)
A parameter literal used in inlay hint requests.
LSP v3.17.0
- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.InlayHintRegistrationOptions(resolve_provider=None, work_done_progress=None, document_selector=None, id=None)
Inlay hint options used during static or dynamic registration.
LSP v3.17.0
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- id: Optional[str]
The id used to register the request. The id can be used to deregister the request again. See also Registration#id.
- class lsprotocol.types.InlayHintResolveRequest(id, params, method='inlayHint/resolve', jsonrpc='2.0')
A request to resolve additional properties for an inlay hint. The request’s parameter is of type
InlayHint
, the response is of typeInlayHint
or a Thenable that resolves to such.LSP v3.17.0
- class lsprotocol.types.InlayHintResolveResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.InlayHintWorkspaceClientCapabilities(refresh_support=None)
Client workspace capabilities specific to inlay hints.
LSP v3.17.0
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all inlay hints currently shown. It should be used with absolute care and is useful for situation where a server for example detects a project wide change that requires such a calculation.
- class lsprotocol.types.InlineCompletionClientCapabilities(dynamic_registration=None)
Client capabilities specific to inline completions.
LSP v3.18.0 @proposed
- class lsprotocol.types.InlineCompletionContext(trigger_kind, selected_completion_info=None)
Provides information about the context in which an inline completion was requested.
LSP v3.18.0 @proposed
- Parameters:
trigger_kind (InlineCompletionTriggerKind) –
selected_completion_info (Optional[SelectedCompletionInfo]) –
- selected_completion_info: Optional[SelectedCompletionInfo]
Provides information about the currently selected item in the autocomplete widget if it is visible.
- trigger_kind: InlineCompletionTriggerKind
Describes how the inline completion was triggered.
- class lsprotocol.types.InlineCompletionItem(insert_text, filter_text=None, range=None, command=None)
An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
LSP v3.18.0 @proposed
- Parameters:
- filter_text: Optional[str]
A text that is used to decide if this inline completion should be shown. When
falsy
the {@link InlineCompletionItem.insertText} is used.
- insert_text: Union[str, StringValue]
The text to replace the range with. Must be set.
- class lsprotocol.types.InlineCompletionList(items)
Represents a collection of
InlineCompletionItem inline completion items
to be presented in the editor.LSP v3.18.0 @proposed
- Parameters:
items (List[InlineCompletionItem]) –
- items: List[InlineCompletionItem]
The inline completion items
- class lsprotocol.types.InlineCompletionOptions(work_done_progress=None)
Inline completion options used during static registration.
LSP v3.18.0 @proposed
- class lsprotocol.types.InlineCompletionParams(context, text_document, position, work_done_token=None)
A parameter literal used in inline completion requests.
LSP v3.18.0 @proposed
- Parameters:
context (InlineCompletionContext) –
text_document (TextDocumentIdentifier) –
position (Position) –
- context: InlineCompletionContext
Additional information about the context in which inline completions were requested.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.InlineCompletionRegistrationOptions(work_done_progress=None, document_selector=None, id=None)
Inline completion options used during static or dynamic registration.
LSP v3.18.0 @proposed
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.InlineCompletionTriggerKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Describes how an
InlineCompletionItemProvider inline completion provider
was triggered.LSP v3.18.0 @proposed
- Automatic = 1
Completion was triggered automatically while editing.
- Invoked = 0
Completion was triggered explicitly by a user gesture.
- class lsprotocol.types.InlineValueClientCapabilities(dynamic_registration=None)
Client capabilities specific to inline values.
LSP v3.17.0
- class lsprotocol.types.InlineValueContext(frame_id, stopped_location)
LSP v3.17.0
- class lsprotocol.types.InlineValueEvaluatableExpression(range, expression=None)
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.
LSP v3.17.0
- class lsprotocol.types.InlineValueOptions(work_done_progress=None)
Inline value options used during static registration.
LSP v3.17.0
- class lsprotocol.types.InlineValueParams(text_document, range, context, work_done_token=None)
A parameter literal used in inline value requests.
LSP v3.17.0
- Parameters:
text_document (TextDocumentIdentifier) –
range (Range) –
context (InlineValueContext) –
- context: InlineValueContext
Additional information about the context in which inline values were requested.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.InlineValueRegistrationOptions(work_done_progress=None, document_selector=None, id=None)
Inline value options used during static or dynamic registration.
LSP v3.17.0
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.InlineValueText(range, text)
Provide inline value as text.
LSP v3.17.0
- class lsprotocol.types.InlineValueVariableLookup(range, case_sensitive_lookup, variable_name=None)
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.
LSP v3.17.0
- class lsprotocol.types.InlineValueWorkspaceClientCapabilities(refresh_support=None)
Client workspace capabilities specific to inline values.
LSP v3.17.0
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all inline values currently shown. It should be used with absolute care and is useful for situation where a server for example detects a project wide change that requires such a calculation.
- class lsprotocol.types.InsertReplaceEdit(new_text, insert, replace)
A special text edit to provide an insert and a replace operation.
LSP v3.16.0
- class lsprotocol.types.InsertTextFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Defines whether the insert text in a completion item should be interpreted as plain text or a snippet.
- PlainText = 1
The primary text to be inserted is treated as a plain string.
- Snippet = 2
The primary text to be inserted is treated as a snippet.
A snippet can define tab stops and placeholders with
$1
, $2 and${3:foo}
. $0 defines the final tab stop, it defaults to the end of the snippet. Placeholders with equal identifiers are linked, that is typing in one will update others too.
- class lsprotocol.types.InsertTextMode(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
How whitespace and indentation is handled during completion item insertion.
LSP v3.16.0
- AdjustIndentation = 2
The editor adjusts leading whitespace of new lines so that they match the indentation up to the cursor of the line for which the item is accepted.
Consider a line like this: <2tabs><cursor><3tabs>foo. Accepting a multi line completion item is indented using 2 tabs and all following lines inserted will be indented using 2 tabs as well.
- AsIs = 1
The insertion or replace strings is taken as it is. If the value is multi line the lines below the cursor will be inserted using the indentation defined in the string value. The client will not apply any kind of adjustments to the string.
- class lsprotocol.types.LSPErrorCodes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- ContentModified = -32801
The server detected that the content of a document got modified outside normal conditions. A server should NOT send this error code if it detects a content change in it unprocessed messages. The result even computed on an older state might still be useful for the client.
If a client decides that a result is not of any use anymore the client should cancel the request.
- RequestCancelled = -32800
The client has canceled a request and a server as detected the cancel.
- RequestFailed = -32803
A request failed but it was syntactically correct, e.g the method name was known and the parameters were valid. The error message should contain human readable information about why the request failed.
LSP v3.17.0
- ServerCancelled = -32802
The server cancelled the request. This error code should only be used for requests that explicitly support being server cancellable.
LSP v3.17.0
- class lsprotocol.types.LSPObject
LSP object definition. LSP v3.17.0
- class lsprotocol.types.LinkedEditingRangeClientCapabilities(dynamic_registration=None)
Client capabilities for the linked editing range request.
LSP v3.16.0
- class lsprotocol.types.LinkedEditingRangeOptions(work_done_progress=None)
- class lsprotocol.types.LinkedEditingRangeParams(text_document, position, work_done_token=None)
- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.LinkedEditingRangeRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.LinkedEditingRanges(ranges, word_pattern=None)
The result of a linked editing range request.
LSP v3.16.0
- class lsprotocol.types.Location(uri, range)
Represents a location inside a resource, such as a line inside a text file.
- class lsprotocol.types.LocationLink(target_uri, target_range, target_selection_range, origin_selection_range=None)
Represents the connection of two locations. Provides additional metadata over normal
Location locations
, including an origin range.- Parameters:
- origin_selection_range: Optional[Range]
Span of the origin of this link.
Used as the underlined span for mouse interaction. Defaults to the word range at the definition position.
- target_range: Range
The full target range of this link. If the target for example is a symbol then target range is the range enclosing this symbol not including leading/trailing whitespace but everything else like comments. This information is typically used to highlight the range in the editor.
- class lsprotocol.types.LogMessageParams(type, message)
The log message parameters.
- Parameters:
type (MessageType) –
message (str) –
- type: MessageType
The message type. See
MessageType
- class lsprotocol.types.LogTraceNotification(params, method='$/logTrace', jsonrpc='2.0')
- Parameters:
params (LogTraceParams) –
method (str) –
jsonrpc (str) –
- params: LogTraceParams
- class lsprotocol.types.LogTraceParams(message, verbose=None)
- class lsprotocol.types.MarkdownClientCapabilities(parser, version=None, allowed_tags=None)
Client capabilities specific to the used markdown parser.
LSP v3.16.0
- class lsprotocol.types.MarkedString_Type1(language, value)
- class lsprotocol.types.MarkupContent(kind, value)
A
MarkupContent
literal represents a string value which content is interpreted base on its kind flag. Currently the protocol supportsplaintext
and markdown as markup kinds.If the kind is
markdown
then the value can contain fenced code blocks like in GitHub issues. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlightingHere is an example how such a string can be constructed using JavaScript / TypeScript:
let markdown: MarkdownContent = { kind: MarkupKind.Markdown, value: [ '# Header', 'Some text', '```typescript', 'someCode();', '```' ].join(' ') };
Please Note that clients might sanitize the return markdown. A client could decide to remove HTML from the markdown to avoid script execution.
- Parameters:
kind (MarkupKind) –
value (str) –
- kind: MarkupKind
The type of the Markup
- class lsprotocol.types.MarkupKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Describes the content type that a client supports in various result literals like
Hover
, ParameterInfo or CompletionItem.Please note that
MarkupKinds
must not start with a $. This kinds are reserved for internal usage.- Markdown = 'markdown'
Markdown is supported as a content format
- PlainText = 'plaintext'
Plain text is supported as a content format
- class lsprotocol.types.MessageDirection(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Both = 'both'
- ClientToServer = 'clientToServer'
- ServerToClient = 'serverToClient'
- class lsprotocol.types.MessageType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The message type
- Debug = 5
A debug message.
LSP v3.18.0
- Error = 1
An error message.
- Info = 3
An information message.
- Log = 4
A log message.
- Warning = 2
A warning message.
- class lsprotocol.types.Moniker(scheme, identifier, unique, kind=None)
Moniker definition to match LSIF 0.5 moniker definition.
LSP v3.16.0
- Parameters:
scheme (str) –
identifier (str) –
unique (UniquenessLevel) –
kind (Optional[MonikerKind]) –
- identifier: str
The identifier of the moniker. The value is opaque in LSIF however schema owners are allowed to define the structure if they want.
- kind: Optional[MonikerKind]
The moniker kind if known.
- unique: UniquenessLevel
The scope in which the moniker is unique
- class lsprotocol.types.MonikerClientCapabilities(dynamic_registration=None)
Client capabilities specific to the moniker request.
LSP v3.16.0
- class lsprotocol.types.MonikerKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
The moniker kind.
LSP v3.16.0
- Export = 'export'
The moniker represents a symbol that is exported from a project
- Import = 'import'
The moniker represent a symbol that is imported into a project
- Local = 'local'
The moniker represents a symbol that is local to a project (e.g. a local variable of a function, a class not visible outside the project, …)
- class lsprotocol.types.MonikerOptions(work_done_progress=None)
- class lsprotocol.types.MonikerParams(text_document, position, work_done_token=None, partial_result_token=None)
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.MonikerRegistrationOptions(document_selector=None, work_done_progress=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.NotebookCell(kind, document, metadata=None, execution_summary=None)
A notebook cell.
A cell’s document URI must be unique across ALL notebook cells and can therefore be used to uniquely identify a notebook cell or the cell’s text document.
LSP v3.17.0
- Parameters:
kind (NotebookCellKind) –
document (str) –
execution_summary (Optional[ExecutionSummary]) –
- execution_summary: Optional[ExecutionSummary]
Additional execution summary information if supported by the client.
- kind: NotebookCellKind
The cell’s kind
- class lsprotocol.types.NotebookCellArrayChange(start, delete_count, cells=None)
A change describing how to move a
NotebookCell
array from state S to S’.LSP v3.17.0
- Parameters:
start (int) –
delete_count (int) –
cells (Optional[List[NotebookCell]]) –
- cells: Optional[List[NotebookCell]]
The new cells, if any
- class lsprotocol.types.NotebookCellKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A notebook cell kind.
LSP v3.17.0
- Code = 2
A code-cell is source code.
- Markup = 1
A markup-cell is formatted source that is used for display.
- class lsprotocol.types.NotebookCellTextDocumentFilter(notebook, language=None)
A notebook cell text document filter denotes a cell text document by different properties.
LSP v3.17.0
- Parameters:
- language: Optional[str]
A language id like
python
.Will be matched against the language id of the notebook cell document. ‘*’ matches every language.
- notebook: Union[str, NotebookDocumentFilter_Type1, NotebookDocumentFilter_Type2, NotebookDocumentFilter_Type3]
A filter that matches against the notebook containing the notebook cell. If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
- class lsprotocol.types.NotebookDocument(uri, notebook_type, version, cells, metadata=None)
A notebook document.
LSP v3.17.0
- Parameters:
- cells: List[NotebookCell]
The cells of a notebook.
- class lsprotocol.types.NotebookDocumentChangeEvent(metadata=None, cells=None)
A change event for a notebook document.
LSP v3.17.0
- Parameters:
cells (Optional[NotebookDocumentChangeEventCellsType]) –
- cells: Optional[NotebookDocumentChangeEventCellsType]
Changes to cells
- class lsprotocol.types.NotebookDocumentChangeEventCellsType(structure=None, data=None, text_content=None)
- Parameters:
structure (Optional[NotebookDocumentChangeEventCellsTypeStructureType]) –
data (Optional[List[NotebookCell]]) –
text_content (Optional[List[NotebookDocumentChangeEventCellsTypeTextContentType]]) –
- data: Optional[List[NotebookCell]]
Changes to notebook cells properties like its kind, execution summary or metadata.
- structure: Optional[NotebookDocumentChangeEventCellsTypeStructureType]
Changes to the cell structure to add or remove cells.
- text_content: Optional[List[NotebookDocumentChangeEventCellsTypeTextContentType]]
Changes to the text content of notebook cells.
- class lsprotocol.types.NotebookDocumentChangeEventCellsTypeStructureType(array, did_open=None, did_close=None)
- Parameters:
array (NotebookCellArrayChange) –
did_open (Optional[List[TextDocumentItem]]) –
did_close (Optional[List[TextDocumentIdentifier]]) –
- array: NotebookCellArrayChange
The change to the cell array.
- did_close: Optional[List[TextDocumentIdentifier]]
Additional closed cell text documents.
- did_open: Optional[List[TextDocumentItem]]
Additional opened cell text documents.
- class lsprotocol.types.NotebookDocumentChangeEventCellsTypeTextContentType(document, changes)
- Parameters:
document (VersionedTextDocumentIdentifier) –
changes (List[Union[TextDocumentContentChangeEvent_Type1, TextDocumentContentChangeEvent_Type2]]) –
- document: VersionedTextDocumentIdentifier
- class lsprotocol.types.NotebookDocumentClientCapabilities(synchronization)
Capabilities specific to the notebook document support.
LSP v3.17.0
- Parameters:
synchronization (NotebookDocumentSyncClientCapabilities) –
- synchronization: NotebookDocumentSyncClientCapabilities
Capabilities specific to notebook document synchronization
LSP v3.17.0
- class lsprotocol.types.NotebookDocumentDidChangeNotification(params, method='notebookDocument/didChange', jsonrpc='2.0')
- Parameters:
params (DidChangeNotebookDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidChangeNotebookDocumentParams
- class lsprotocol.types.NotebookDocumentDidCloseNotification(params, method='notebookDocument/didClose', jsonrpc='2.0')
A notification sent when a notebook closes.
LSP v3.17.0
- Parameters:
params (DidCloseNotebookDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidCloseNotebookDocumentParams
- class lsprotocol.types.NotebookDocumentDidOpenNotification(params, method='notebookDocument/didOpen', jsonrpc='2.0')
A notification sent when a notebook opens.
LSP v3.17.0
- Parameters:
params (DidOpenNotebookDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidOpenNotebookDocumentParams
- class lsprotocol.types.NotebookDocumentDidSaveNotification(params, method='notebookDocument/didSave', jsonrpc='2.0')
A notification sent when a notebook document is saved.
LSP v3.17.0
- Parameters:
params (DidSaveNotebookDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidSaveNotebookDocumentParams
- class lsprotocol.types.NotebookDocumentFilter_Type1(notebook_type, scheme=None, pattern=None)
- class lsprotocol.types.NotebookDocumentFilter_Type2(scheme, notebook_type=None, pattern=None)
- class lsprotocol.types.NotebookDocumentFilter_Type3(pattern, notebook_type=None, scheme=None)
- class lsprotocol.types.NotebookDocumentIdentifier(uri)
A literal to identify a notebook document in the client.
LSP v3.17.0
- Parameters:
uri (str) –
- class lsprotocol.types.NotebookDocumentSyncClientCapabilities(dynamic_registration=None, execution_summary_support=None)
Notebook specific client capabilities.
LSP v3.17.0
- class lsprotocol.types.NotebookDocumentSyncOptions(notebook_selector, save=None)
Options specific to a notebook plus its cells to be synced to the server.
If a selector provides a notebook document filter but no cell selector all cells of a matching notebook document will be synced.
If a selector provides no notebook document filter but only a cell selector all notebook document that contain at least one matching cell will be synced.
LSP v3.17.0
- Parameters:
notebook_selector (List[Union[NotebookDocumentSyncOptionsNotebookSelectorType1, NotebookDocumentSyncOptionsNotebookSelectorType2]]) –
- notebook_selector: List[Union[NotebookDocumentSyncOptionsNotebookSelectorType1, NotebookDocumentSyncOptionsNotebookSelectorType2]]
The notebooks to be synced
- class lsprotocol.types.NotebookDocumentSyncOptionsNotebookSelectorType1(notebook, cells=None)
- Parameters:
- cells: Optional[List[NotebookDocumentSyncOptionsNotebookSelectorType1CellsType]]
The cells of the matching notebook to be synced.
- notebook: Union[str, NotebookDocumentFilter_Type1, NotebookDocumentFilter_Type2, NotebookDocumentFilter_Type3]
The notebook to be synced If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
- class lsprotocol.types.NotebookDocumentSyncOptionsNotebookSelectorType1CellsType(language)
- Parameters:
language (str) –
- class lsprotocol.types.NotebookDocumentSyncOptionsNotebookSelectorType2(cells, notebook=None)
- Parameters:
- cells: List[NotebookDocumentSyncOptionsNotebookSelectorType2CellsType]
The cells of the matching notebook to be synced.
- notebook: Optional[Union[str, NotebookDocumentFilter_Type1, NotebookDocumentFilter_Type2, NotebookDocumentFilter_Type3]]
The notebook to be synced If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
- class lsprotocol.types.NotebookDocumentSyncOptionsNotebookSelectorType2CellsType(language)
- Parameters:
language (str) –
- class lsprotocol.types.NotebookDocumentSyncRegistrationOptions(notebook_selector, save=None, id=None)
Registration options specific to a notebook.
LSP v3.17.0
- Parameters:
- id: Optional[str]
The id used to register the request. The id can be used to deregister the request again. See also Registration#id.
- notebook_selector: List[Union[NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1, NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2]]
The notebooks to be synced
- class lsprotocol.types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1(notebook, cells=None)
- Parameters:
- cells: Optional[List[NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType]]
The cells of the matching notebook to be synced.
- notebook: Union[str, NotebookDocumentFilter_Type1, NotebookDocumentFilter_Type2, NotebookDocumentFilter_Type3]
The notebook to be synced If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
- class lsprotocol.types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType(language)
- Parameters:
language (str) –
- class lsprotocol.types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2(cells, notebook=None)
- Parameters:
- cells: List[NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType]
The cells of the matching notebook to be synced.
- notebook: Optional[Union[str, NotebookDocumentFilter_Type1, NotebookDocumentFilter_Type2, NotebookDocumentFilter_Type3]]
The notebook to be synced If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
- class lsprotocol.types.NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2CellsType(language)
- Parameters:
language (str) –
- class lsprotocol.types.OptionalVersionedTextDocumentIdentifier(uri, version=None)
A text document identifier to optionally denote a specific version of a text document.
- version: Optional[int]
The version number of this document. If a versioned text document identifier is sent from the server to the client and the file is not open in the editor (the server has not received an open notification before) the server can send
null
to indicate that the version is unknown and the content on disk is the truth (as specified with document content ownership).
- class lsprotocol.types.ParameterInformation(label, documentation=None)
Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.
- Parameters:
- documentation: Optional[Union[str, MarkupContent]]
The human-readable doc-comment of this parameter. Will be shown in the UI but can be omitted.
- label: Union[str, Tuple[int, int]]
The label of this parameter information.
Either a string or an inclusive start and exclusive end offsets within its containing signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 string representation as
Position
and Range does.Note: a label of type string should be a substring of its containing signature label. Its intended use case is to highlight the parameter label part in the
SignatureInformation.label
.
- class lsprotocol.types.PartialResultParams(partial_result_token=None)
- lsprotocol.types.Pattern
The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
*
to match one or more characters in a path segment?
to match on one character in a path segment**
to match any number of path segments, including none{}
to group conditions (e.g. **/*.{ts,js} matches all TypeScript and JavaScript files)[]
to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …)[!...]
to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0)
LSP v3.17.0
- class lsprotocol.types.Position(line, character)
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 charactera
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 index0
is the most preferred one). To stay backwards compatible the only mandatory encoding is UTF-16 represented via the stringutf-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 valueutf-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 valueutf-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.Positions are line end character agnostic. So you can not specify a position that denotes ` | `` or `` |`` where `` |` represents the character offset.
LSP v3.17.0 - support for negotiated position encoding.
- class lsprotocol.types.PositionEncodingKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A set of predefined position encoding kinds.
LSP v3.17.0
- Utf16 = 'utf-16'
Character offsets count UTF-16 code units.
This is the default and must always be supported by servers
- Utf32 = 'utf-32'
Character offsets count UTF-32 code units.
Implementation note: these are the same as Unicode codepoints, so this
PositionEncodingKind
may also be used for an encoding-agnostic representation of character offsets.
- Utf8 = 'utf-8'
Character offsets count UTF-8 code units (e.g. bytes).
- class lsprotocol.types.PrepareRenameParams(text_document, position, work_done_token=None)
- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.PrepareRenameResult_Type1(range, placeholder)
- class lsprotocol.types.PrepareRenameResult_Type2(default_behavior)
- Parameters:
default_behavior (bool) –
- class lsprotocol.types.PrepareSupportDefaultBehavior(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Identifier = 1
The client’s default behavior is to select the identifier according the to language’s syntax rule.
- class lsprotocol.types.PreviousResultId(uri, value)
A previous result id in a workspace pull request.
LSP v3.17.0
- class lsprotocol.types.ProgressNotification(params, method='$/progress', jsonrpc='2.0')
- Parameters:
params (ProgressParams) –
method (str) –
jsonrpc (str) –
- params: ProgressParams
- class lsprotocol.types.ProgressParams(token, value)
- class lsprotocol.types.PublishDiagnosticsClientCapabilities(related_information=None, tag_support=None, version_support=None, code_description_support=None, data_support=None)
The publish diagnostic client capabilities.
- Parameters:
- data_support: Optional[bool]
Whether code action supports the
data
property which is preserved between atextDocument/publishDiagnostics
andtextDocument/codeAction
request.LSP v3.16.0
Whether the clients accepts diagnostics with related information.
- tag_support: Optional[PublishDiagnosticsClientCapabilitiesTagSupportType]
Client supports the tag property to provide meta data about a diagnostic. Clients supporting tags have to handle unknown tags gracefully.
LSP v3.15.0
- class lsprotocol.types.PublishDiagnosticsClientCapabilitiesTagSupportType(value_set)
- Parameters:
value_set (List[DiagnosticTag]) –
- value_set: List[DiagnosticTag]
The tags supported by the client.
- class lsprotocol.types.PublishDiagnosticsParams(uri, diagnostics, version=None)
The publish diagnostic notification’s parameters.
- Parameters:
uri (str) –
diagnostics (List[Diagnostic]) –
- diagnostics: List[Diagnostic]
An array of diagnostic information items.
- class lsprotocol.types.Range(start, end)
A range in a text document expressed as (zero-based) start and end positions.
If you want to specify a range that contains a line including the line ending character(s) then use an end position denoting the start of the next line. For example:
{ start: { line: 5, character: 23 } end : { line 6, character : 0 } }
- class lsprotocol.types.ReferenceClientCapabilities(dynamic_registration=None)
Client Capabilities for a
ReferencesRequest
.
- class lsprotocol.types.ReferenceContext(include_declaration)
Value-object that contains additional information when requesting references.
- Parameters:
include_declaration (bool) –
- class lsprotocol.types.ReferenceOptions(work_done_progress=None)
Reference options.
- class lsprotocol.types.ReferenceParams(context, text_document, position, work_done_token=None, partial_result_token=None)
Parameters for a
ReferencesRequest
.- Parameters:
- context: ReferenceContext
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.ReferenceRegistrationOptions(document_selector=None, work_done_progress=None)
Registration options for a
ReferencesRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.Registration(id, method, register_options=None)
General parameters to register for a notification or to register a provider.
- class lsprotocol.types.RegistrationParams(registrations)
- Parameters:
registrations (List[Registration]) –
- registrations: List[Registration]
- class lsprotocol.types.RegularExpressionsClientCapabilities(engine, version=None)
Client capabilities specific to regular expressions.
LSP v3.16.0
- class lsprotocol.types.RelatedFullDocumentDiagnosticReport(items, related_documents=None, kind='full', result_id=None)
A full diagnostic report with a set of related documents.
LSP v3.17.0
- Parameters:
items (List[Diagnostic]) –
related_documents (Optional[Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]]) –
kind (str) –
- items: List[Diagnostic]
The actual items.
Diagnostics of related documents. This information is useful in programming languages where code in a file A can generate diagnostics in a file B which A depends on. An example of such a language is C/C++ where marco definitions in a file a.cpp and result in errors in a header file b.hpp.
LSP v3.17.0
- class lsprotocol.types.RelatedUnchangedDocumentDiagnosticReport(result_id, related_documents=None, kind='unchanged')
An unchanged diagnostic report with a set of related documents.
LSP v3.17.0
- Parameters:
result_id (str) –
related_documents (Optional[Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]]) –
kind (str) –
- kind: str
A document diagnostic report indicating no changes to the last result. A server can only return
unchanged
if result ids are provided.
Diagnostics of related documents. This information is useful in programming languages where code in a file A can generate diagnostics in a file B which A depends on. An example of such a language is C/C++ where marco definitions in a file a.cpp and result in errors in a header file b.hpp.
LSP v3.17.0
- class lsprotocol.types.RelativePattern(base_uri, pattern)
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.LSP v3.17.0
- Parameters:
base_uri (Union[WorkspaceFolder, str]) –
pattern (str) –
- base_uri: Union[WorkspaceFolder, str]
A workspace folder or a base URI to which this pattern will be matched against relatively.
- class lsprotocol.types.RenameClientCapabilities(dynamic_registration=None, prepare_support=None, prepare_support_default_behavior=None, honors_change_annotations=None)
- Parameters:
- honors_change_annotations: Optional[bool]
Whether the client honors the change annotations in text edits and resource operations returned via the rename request’s workspace edit by for example presenting the workspace edit in the user interface and asking for confirmation.
LSP v3.16.0
- prepare_support: Optional[bool]
Client supports testing for validity of rename operations before execution.
LSP v3.12.0
- prepare_support_default_behavior: Optional[PrepareSupportDefaultBehavior]
Client supports the default behavior result.
The value indicates the default behavior used by the client.
LSP v3.16.0
- class lsprotocol.types.RenameFile(old_uri, new_uri, kind='rename', options=None, annotation_id=None)
Rename file operation
- Parameters:
- annotation_id: Optional[str]
An optional annotation identifier describing the operation.
LSP v3.16.0
- options: Optional[RenameFileOptions]
Rename options.
- class lsprotocol.types.RenameFileOptions(overwrite=None, ignore_if_exists=None)
Rename file options
- class lsprotocol.types.RenameFilesParams(files)
The parameters sent in notifications/requests for user-initiated renames of files.
LSP v3.16.0
- Parameters:
files (List[FileRename]) –
- files: List[FileRename]
An array of all files/folders renamed in this operation. When a folder is renamed, only the folder will be included, and not its children.
- class lsprotocol.types.RenameOptions(prepare_provider=None, work_done_progress=None)
Provider options for a
RenameRequest
.
- class lsprotocol.types.RenameParams(text_document, position, new_name, work_done_token=None)
The parameters of a
RenameRequest
.- Parameters:
- new_name: str
The new name of the symbol. If the given name is not valid the request must return a
ResponseError
with an appropriate message set.
- text_document: TextDocumentIdentifier
The document to rename.
- class lsprotocol.types.RenameRegistrationOptions(document_selector=None, prepare_provider=None, work_done_progress=None)
Registration options for a
RenameRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.ResourceOperation(kind, annotation_id=None)
A generic resource operation.
- class lsprotocol.types.ResourceOperationKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Create = 'create'
Supports creating new files and folders.
- Delete = 'delete'
Supports deleting existing files and folders.
- Rename = 'rename'
Supports renaming existing files and folders.
- class lsprotocol.types.ResponseError(code, message, data=None)
- class lsprotocol.types.ResponseErrorMessage(id=None, error=None, jsonrpc='2.0')
-
- error: Optional[ResponseError]
The error object in case a request fails.
- class lsprotocol.types.SaveOptions(include_text=None)
Save options.
- class lsprotocol.types.SelectedCompletionInfo(range, text)
Describes the currently selected completion item.
LSP v3.18.0 @proposed
- class lsprotocol.types.SelectionRange(range, parent=None)
A selection range represents a part of a selection hierarchy. A selection range may have a parent selection range that contains it.
- Parameters:
range (Range) –
parent (Optional[SelectionRange]) –
- parent: Optional[SelectionRange]
The parent selection range containing this range. Therefore
parent.range
must contain this.range.
- class lsprotocol.types.SelectionRangeClientCapabilities(dynamic_registration=None)
- class lsprotocol.types.SelectionRangeOptions(work_done_progress=None)
- class lsprotocol.types.SelectionRangeParams(text_document, positions, work_done_token=None, partial_result_token=None)
A parameter literal used in selection range requests.
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.SelectionRangeRegistrationOptions(work_done_progress=None, document_selector=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.SemanticTokenModifiers(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A set of predefined token modifiers. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.
LSP v3.16.0
- Abstract = 'abstract'
- Async = 'async'
- Declaration = 'declaration'
- DefaultLibrary = 'defaultLibrary'
- Definition = 'definition'
- Deprecated = 'deprecated'
- Documentation = 'documentation'
- Modification = 'modification'
- Readonly = 'readonly'
- Static = 'static'
- class lsprotocol.types.SemanticTokenTypes(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A set of predefined token types. This set is not fixed an clients can specify additional token types via the corresponding client capabilities.
LSP v3.16.0
- Class = 'class'
- Comment = 'comment'
- Decorator = 'decorator'
LSP v3.17.0
- Enum = 'enum'
- EnumMember = 'enumMember'
- Event = 'event'
- Function = 'function'
- Interface = 'interface'
- Keyword = 'keyword'
- Macro = 'macro'
- Method = 'method'
- Modifier = 'modifier'
- Namespace = 'namespace'
- Number = 'number'
- Operator = 'operator'
- Parameter = 'parameter'
- Property = 'property'
- Regexp = 'regexp'
- String = 'string'
- Struct = 'struct'
- Type = 'type'
Represents a generic type. Acts as a fallback for types which can’t be mapped to a specific type like class or enum.
- TypeParameter = 'typeParameter'
- Variable = 'variable'
- class lsprotocol.types.SemanticTokens(data, result_id=None)
LSP v3.16.0
- class lsprotocol.types.SemanticTokensClientCapabilities(requests, token_types, token_modifiers, formats, dynamic_registration=None, overlapping_token_support=None, multiline_token_support=None, server_cancel_support=None, augments_syntax_tokens=None)
LSP v3.16.0
- Parameters:
requests (SemanticTokensClientCapabilitiesRequestsType) –
formats (List[TokenFormat]) –
- augments_syntax_tokens: Optional[bool]
Whether the client uses semantic tokens to augment existing syntax tokens. If set to
true
client side created syntax tokens and semantic tokens are both used for colorization. If set tofalse
the client only uses the returned semantic tokens for colorization.If the value is
undefined
then the client behavior is not specified.LSP v3.17.0
- dynamic_registration: Optional[bool]
Whether implementation supports dynamic registration. If this is set to
true
the client supports the new(TextDocumentRegistrationOptions & StaticRegistrationOptions)
return value for the corresponding server capability as well.
- formats: List[TokenFormat]
The token formats the clients supports.
- multiline_token_support: Optional[bool]
Whether the client supports tokens that can span multiple lines.
- overlapping_token_support: Optional[bool]
Whether the client supports tokens that can overlap each other.
- requests: SemanticTokensClientCapabilitiesRequestsType
Which requests the client supports and might send to the server depending on the server’s capability. Please note that clients might not show semantic tokens or degrade some of the user experience if a range or full request is advertised by the client but not provided by the server. If for example the client capability
requests.full
andrequest.range
are both set to true but the server only provides a range provider the client might not render a minimap correctly or might even decide to not show any semantic tokens at all.
- class lsprotocol.types.SemanticTokensClientCapabilitiesRequestsType(range=None, full=None)
- Parameters:
- full: Optional[Union[bool, SemanticTokensClientCapabilitiesRequestsTypeFullType1]]
The client will send the
textDocument/semanticTokens/full
request if the server provides a corresponding handler.
- class lsprotocol.types.SemanticTokensClientCapabilitiesRequestsTypeFullType1(delta=None)
- class lsprotocol.types.SemanticTokensDelta(edits, result_id=None)
LSP v3.16.0
- Parameters:
edits (List[SemanticTokensEdit]) –
- edits: List[SemanticTokensEdit]
The semantic token edits to transform a previous result into a new result.
- class lsprotocol.types.SemanticTokensDeltaParams(text_document, previous_result_id, work_done_token=None, partial_result_token=None)
LSP v3.16.0
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- previous_result_id: str
The result id of a previous response. The result Id can either point to a full response or a delta response depending on what was received last.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.SemanticTokensDeltaPartialResult(edits)
LSP v3.16.0
- Parameters:
edits (List[SemanticTokensEdit]) –
- edits: List[SemanticTokensEdit]
- class lsprotocol.types.SemanticTokensEdit(start, delete_count, data=None)
LSP v3.16.0
- class lsprotocol.types.SemanticTokensLegend(token_types, token_modifiers)
LSP v3.16.0
- class lsprotocol.types.SemanticTokensOptions(legend, range=None, full=None, work_done_progress=None)
LSP v3.16.0
- Parameters:
- full: Optional[Union[bool, SemanticTokensOptionsFullType1]]
Server supports providing semantic tokens for a full document.
- legend: SemanticTokensLegend
The legend used by the server
- class lsprotocol.types.SemanticTokensOptionsFullType1(delta=None)
- class lsprotocol.types.SemanticTokensParams(text_document, work_done_token=None, partial_result_token=None)
LSP v3.16.0
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.SemanticTokensPartialResult(data)
LSP v3.16.0
- class lsprotocol.types.SemanticTokensRangeParams(text_document, range, work_done_token=None, partial_result_token=None)
LSP v3.16.0
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.SemanticTokensRegistrationOptions(legend, document_selector=None, range=None, full=None, work_done_progress=None, id=None)
LSP v3.16.0
- Parameters:
legend (SemanticTokensLegend) –
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
full (Optional[Union[bool, SemanticTokensRegistrationOptionsFullType1]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- full: Optional[Union[bool, SemanticTokensRegistrationOptionsFullType1]]
Server supports providing semantic tokens for a full document.
- id: Optional[str]
The id used to register the request. The id can be used to deregister the request again. See also Registration#id.
- legend: SemanticTokensLegend
The legend used by the server
- class lsprotocol.types.SemanticTokensRegistrationOptionsFullType1(delta=None)
- class lsprotocol.types.SemanticTokensWorkspaceClientCapabilities(refresh_support=None)
LSP v3.16.0
- refresh_support: Optional[bool]
Whether the client implementation supports a refresh request sent from the server to the client.
Note that this event is global and will force the client to refresh all semantic tokens currently shown. It should be used with absolute care and is useful for situation where a server for example detects a project wide change that requires such a calculation.
- class lsprotocol.types.ServerCapabilities(position_encoding=None, text_document_sync=None, notebook_document_sync=None, completion_provider=None, hover_provider=None, signature_help_provider=None, declaration_provider=None, definition_provider=None, type_definition_provider=None, implementation_provider=None, references_provider=None, document_highlight_provider=None, document_symbol_provider=None, code_action_provider=None, code_lens_provider=None, document_link_provider=None, color_provider=None, workspace_symbol_provider=None, document_formatting_provider=None, document_range_formatting_provider=None, document_on_type_formatting_provider=None, rename_provider=None, folding_range_provider=None, selection_range_provider=None, execute_command_provider=None, call_hierarchy_provider=None, linked_editing_range_provider=None, semantic_tokens_provider=None, moniker_provider=None, type_hierarchy_provider=None, inline_value_provider=None, inlay_hint_provider=None, diagnostic_provider=None, inline_completion_provider=None, workspace=None, experimental=None)
Defines the capabilities provided by a language server.
- Parameters:
position_encoding (Optional[Union[PositionEncodingKind, str]]) –
text_document_sync (Optional[Union[TextDocumentSyncOptions, TextDocumentSyncKind]]) –
notebook_document_sync (Optional[Union[NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions]]) –
completion_provider (Optional[CompletionOptions]) –
hover_provider (Optional[Union[bool, HoverOptions]]) –
signature_help_provider (Optional[SignatureHelpOptions]) –
declaration_provider (Optional[Union[bool, DeclarationOptions, DeclarationRegistrationOptions]]) –
definition_provider (Optional[Union[bool, DefinitionOptions]]) –
type_definition_provider (Optional[Union[bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions]]) –
implementation_provider (Optional[Union[bool, ImplementationOptions, ImplementationRegistrationOptions]]) –
references_provider (Optional[Union[bool, ReferenceOptions]]) –
document_highlight_provider (Optional[Union[bool, DocumentHighlightOptions]]) –
document_symbol_provider (Optional[Union[bool, DocumentSymbolOptions]]) –
code_action_provider (Optional[Union[bool, CodeActionOptions]]) –
code_lens_provider (Optional[CodeLensOptions]) –
document_link_provider (Optional[DocumentLinkOptions]) –
color_provider (Optional[Union[bool, DocumentColorOptions, DocumentColorRegistrationOptions]]) –
workspace_symbol_provider (Optional[Union[bool, WorkspaceSymbolOptions]]) –
document_formatting_provider (Optional[Union[bool, DocumentFormattingOptions]]) –
document_range_formatting_provider (Optional[Union[bool, DocumentRangeFormattingOptions]]) –
document_on_type_formatting_provider (Optional[DocumentOnTypeFormattingOptions]) –
rename_provider (Optional[Union[bool, RenameOptions]]) –
folding_range_provider (Optional[Union[bool, FoldingRangeOptions, FoldingRangeRegistrationOptions]]) –
selection_range_provider (Optional[Union[bool, SelectionRangeOptions, SelectionRangeRegistrationOptions]]) –
execute_command_provider (Optional[ExecuteCommandOptions]) –
call_hierarchy_provider (Optional[Union[bool, CallHierarchyOptions, CallHierarchyRegistrationOptions]]) –
linked_editing_range_provider (Optional[Union[bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions]]) –
semantic_tokens_provider (Optional[Union[SemanticTokensOptions, SemanticTokensRegistrationOptions]]) –
moniker_provider (Optional[Union[bool, MonikerOptions, MonikerRegistrationOptions]]) –
type_hierarchy_provider (Optional[Union[bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions]]) –
inline_value_provider (Optional[Union[bool, InlineValueOptions, InlineValueRegistrationOptions]]) –
inlay_hint_provider (Optional[Union[bool, InlayHintOptions, InlayHintRegistrationOptions]]) –
diagnostic_provider (Optional[Union[DiagnosticOptions, DiagnosticRegistrationOptions]]) –
inline_completion_provider (Optional[Union[bool, InlineCompletionOptions]]) –
workspace (Optional[ServerCapabilitiesWorkspaceType]) –
- call_hierarchy_provider: Optional[Union[bool, CallHierarchyOptions, CallHierarchyRegistrationOptions]]
The server provides call hierarchy support.
LSP v3.16.0
- code_action_provider: Optional[Union[bool, CodeActionOptions]]
The server provides code actions. CodeActionOptions may only be specified if the client states that it supports
codeActionLiteralSupport
in its initial initialize request.
- code_lens_provider: Optional[CodeLensOptions]
The server provides code lens.
- color_provider: Optional[Union[bool, DocumentColorOptions, DocumentColorRegistrationOptions]]
The server provides color provider support.
- completion_provider: Optional[CompletionOptions]
The server provides completion support.
- declaration_provider: Optional[Union[bool, DeclarationOptions, DeclarationRegistrationOptions]]
The server provides Goto Declaration support.
- definition_provider: Optional[Union[bool, DefinitionOptions]]
The server provides goto definition support.
- diagnostic_provider: Optional[Union[DiagnosticOptions, DiagnosticRegistrationOptions]]
The server has support for pull model diagnostics.
LSP v3.17.0
- document_formatting_provider: Optional[Union[bool, DocumentFormattingOptions]]
The server provides document formatting.
- document_highlight_provider: Optional[Union[bool, DocumentHighlightOptions]]
The server provides document highlight support.
- document_link_provider: Optional[DocumentLinkOptions]
The server provides document link support.
- document_on_type_formatting_provider: Optional[DocumentOnTypeFormattingOptions]
The server provides document formatting on typing.
- document_range_formatting_provider: Optional[Union[bool, DocumentRangeFormattingOptions]]
The server provides document range formatting.
- document_symbol_provider: Optional[Union[bool, DocumentSymbolOptions]]
The server provides document symbol support.
- execute_command_provider: Optional[ExecuteCommandOptions]
The server provides execute command support.
- folding_range_provider: Optional[Union[bool, FoldingRangeOptions, FoldingRangeRegistrationOptions]]
The server provides folding provider support.
- hover_provider: Optional[Union[bool, HoverOptions]]
The server provides hover support.
- implementation_provider: Optional[Union[bool, ImplementationOptions, ImplementationRegistrationOptions]]
The server provides Goto Implementation support.
- inlay_hint_provider: Optional[Union[bool, InlayHintOptions, InlayHintRegistrationOptions]]
The server provides inlay hints.
LSP v3.17.0
- inline_completion_provider: Optional[Union[bool, InlineCompletionOptions]]
Inline completion options used during static registration.
LSP v3.18.0 @proposed
- inline_value_provider: Optional[Union[bool, InlineValueOptions, InlineValueRegistrationOptions]]
The server provides inline values.
LSP v3.17.0
- linked_editing_range_provider: Optional[Union[bool, LinkedEditingRangeOptions, LinkedEditingRangeRegistrationOptions]]
The server provides linked editing range support.
LSP v3.16.0
- moniker_provider: Optional[Union[bool, MonikerOptions, MonikerRegistrationOptions]]
The server provides moniker support.
LSP v3.16.0
- notebook_document_sync: Optional[Union[NotebookDocumentSyncOptions, NotebookDocumentSyncRegistrationOptions]]
Defines how notebook documents are synced.
LSP v3.17.0
- position_encoding: Optional[Union[PositionEncodingKind, str]]
The position encoding the server picked from the encodings offered by the client via the client capability
general.positionEncodings
.If the client didn’t provide any position encodings the only valid value that a server can return is ‘utf-16’.
If omitted it defaults to ‘utf-16’.
LSP v3.17.0
- references_provider: Optional[Union[bool, ReferenceOptions]]
The server provides find references support.
- rename_provider: Optional[Union[bool, RenameOptions]]
The server provides rename support. RenameOptions may only be specified if the client states that it supports
prepareSupport
in its initial initialize request.
- selection_range_provider: Optional[Union[bool, SelectionRangeOptions, SelectionRangeRegistrationOptions]]
The server provides selection range support.
- semantic_tokens_provider: Optional[Union[SemanticTokensOptions, SemanticTokensRegistrationOptions]]
The server provides semantic tokens support.
LSP v3.16.0
- signature_help_provider: Optional[SignatureHelpOptions]
The server provides signature help support.
- text_document_sync: Optional[Union[TextDocumentSyncOptions, TextDocumentSyncKind]]
Defines how text documents are synced. Is either a detailed structure defining each notification or for backwards compatibility the TextDocumentSyncKind number.
- type_definition_provider: Optional[Union[bool, TypeDefinitionOptions, TypeDefinitionRegistrationOptions]]
The server provides Goto Type Definition support.
- type_hierarchy_provider: Optional[Union[bool, TypeHierarchyOptions, TypeHierarchyRegistrationOptions]]
The server provides type hierarchy support.
LSP v3.17.0
- workspace: Optional[ServerCapabilitiesWorkspaceType]
Workspace specific server capabilities.
- workspace_symbol_provider: Optional[Union[bool, WorkspaceSymbolOptions]]
The server provides workspace symbol support.
- class lsprotocol.types.ServerCapabilitiesWorkspaceType(workspace_folders=None, file_operations=None)
- Parameters:
workspace_folders (Optional[WorkspaceFoldersServerCapabilities]) –
file_operations (Optional[FileOperationOptions]) –
- file_operations: Optional[FileOperationOptions]
The server is interested in notifications/requests for operations on files.
LSP v3.16.0
- workspace_folders: Optional[WorkspaceFoldersServerCapabilities]
The server supports workspace folder.
LSP v3.6.0
- class lsprotocol.types.SetTraceNotification(params, method='$/setTrace', jsonrpc='2.0')
- Parameters:
params (SetTraceParams) –
method (str) –
jsonrpc (str) –
- params: SetTraceParams
- class lsprotocol.types.SetTraceParams(value)
- Parameters:
value (TraceValues) –
- value: TraceValues
- class lsprotocol.types.ShowDocumentClientCapabilities(support)
Client capabilities for the showDocument request.
LSP v3.16.0
- Parameters:
support (bool) –
- class lsprotocol.types.ShowDocumentParams(uri, external=None, take_focus=None, selection=None)
Params to show a resource in the UI.
LSP v3.16.0
- Parameters:
- external: Optional[bool]
Indicates to show the resource in an external program. To show, for example,
https://code.visualstudio.com/
in the default WEB browser setexternal
to true.
- selection: Optional[Range]
An optional selection range if the document is a text document. Clients might ignore the property if an external program is started or the file is not a text file.
- class lsprotocol.types.ShowDocumentResult(success)
The result of a showDocument request.
LSP v3.16.0
- Parameters:
success (bool) –
- class lsprotocol.types.ShowMessageParams(type, message)
The parameters of a notification message.
- Parameters:
type (MessageType) –
message (str) –
- type: MessageType
The message type. See
MessageType
- class lsprotocol.types.ShowMessageRequestClientCapabilities(message_action_item=None)
Show message request client capabilities
- Parameters:
message_action_item (Optional[ShowMessageRequestClientCapabilitiesMessageActionItemType]) –
- message_action_item: Optional[ShowMessageRequestClientCapabilitiesMessageActionItemType]
Capabilities specific to the
MessageActionItem
type.
- class lsprotocol.types.ShowMessageRequestClientCapabilitiesMessageActionItemType(additional_properties_support=None)
- class lsprotocol.types.ShowMessageRequestParams(type, message, actions=None)
- Parameters:
type (MessageType) –
message (str) –
actions (Optional[List[MessageActionItem]]) –
- actions: Optional[List[MessageActionItem]]
The message action items to present.
- type: MessageType
The message type. See
MessageType
- class lsprotocol.types.ShutdownRequest(id, params=None, method='shutdown', jsonrpc='2.0')
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.
- class lsprotocol.types.ShutdownResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.SignatureHelp(signatures, active_signature=None, active_parameter=None)
Signature help represents the signature of something callable. There can be multiple signature but only one active and only one active parameter.
- Parameters:
- active_parameter: Optional[int]
The active parameter of the active signature. If omitted or the value lies outside the range of
signatures[activeSignature].parameters
defaults to 0 if the active signature has parameters. If the active signature has no parameters it is ignored. In future version of the protocol this property might become mandatory to better express the active parameter if the active signature does have any.
- active_signature: Optional[int]
The active signature. If omitted or the value lies outside the range of
signatures
the value defaults to zero or is ignored if theSignatureHelp
has no signatures.Whenever possible implementors should make an active decision about the active signature and shouldn’t rely on a default value.
In future version of the protocol this property might become mandatory to better express this.
- signatures: List[SignatureInformation]
One or more signatures.
- class lsprotocol.types.SignatureHelpClientCapabilities(dynamic_registration=None, signature_information=None, context_support=None)
Client Capabilities for a
SignatureHelpRequest
.- Parameters:
- context_support: Optional[bool]
The client supports to send additional context information for a
textDocument/signatureHelp
request. A client that opts into contextSupport will also support theretriggerCharacters
onSignatureHelpOptions
.LSP v3.15.0
- signature_information: Optional[SignatureHelpClientCapabilitiesSignatureInformationType]
The client supports the following
SignatureInformation
specific properties.
- class lsprotocol.types.SignatureHelpClientCapabilitiesSignatureInformationType(documentation_format=None, parameter_information=None, active_parameter_support=None)
- Parameters:
documentation_format (Optional[List[MarkupKind]]) –
parameter_information (Optional[SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType]) –
- active_parameter_support: Optional[bool]
The client supports the
activeParameter
property on SignatureInformation literal.LSP v3.16.0
- documentation_format: Optional[List[MarkupKind]]
Client supports the following content formats for the documentation property. The order describes the preferred format of the client.
- parameter_information: Optional[SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType]
Client capabilities specific to parameter information.
- class lsprotocol.types.SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformationType(label_offset_support=None)
- class lsprotocol.types.SignatureHelpContext(trigger_kind, is_retrigger, trigger_character=None, active_signature_help=None)
Additional information about the context in which a signature help request was triggered.
LSP v3.15.0
- Parameters:
trigger_kind (SignatureHelpTriggerKind) –
is_retrigger (bool) –
active_signature_help (Optional[SignatureHelp]) –
- active_signature_help: Optional[SignatureHelp]
The currently active
SignatureHelp
.The
activeSignatureHelp
has its SignatureHelp.activeSignature field updated based on the user navigating through available signatures.
- is_retrigger: bool
true
if signature help was already showing when it was triggered.Retriggers occurs when the signature help is already active and can be caused by actions such as typing a trigger character, a cursor move, or document content changes.
- trigger_character: Optional[str]
Character that caused signature help to be triggered.
This is undefined when
triggerKind !== SignatureHelpTriggerKind.TriggerCharacter
- trigger_kind: SignatureHelpTriggerKind
Action that caused signature help to be triggered.
- class lsprotocol.types.SignatureHelpOptions(trigger_characters=None, retrigger_characters=None, work_done_progress=None)
Server Capabilities for a
SignatureHelpRequest
.- Parameters:
- retrigger_characters: Optional[List[str]]
List of characters that re-trigger signature help.
These trigger characters are only active when signature help is already showing. All trigger characters are also counted as re-trigger characters.
LSP v3.15.0
- class lsprotocol.types.SignatureHelpParams(text_document, position, context=None, work_done_token=None)
Parameters for a
SignatureHelpRequest
.- Parameters:
text_document (TextDocumentIdentifier) –
position (Position) –
context (Optional[SignatureHelpContext]) –
- context: Optional[SignatureHelpContext]
The signature help context. This is only available if the client specifies to send this using the client capability
textDocument.signatureHelp.contextSupport === true
LSP v3.15.0
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.SignatureHelpRegistrationOptions(document_selector=None, trigger_characters=None, retrigger_characters=None, work_done_progress=None)
Registration options for a
SignatureHelpRequest
.- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- retrigger_characters: Optional[List[str]]
List of characters that re-trigger signature help.
These trigger characters are only active when signature help is already showing. All trigger characters are also counted as re-trigger characters.
LSP v3.15.0
- class lsprotocol.types.SignatureHelpTriggerKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
How a signature help was triggered.
LSP v3.15.0
- ContentChange = 3
Signature help was triggered by the cursor moving or by the document content changing.
- Invoked = 1
Signature help was invoked manually by the user or by a command.
- TriggerCharacter = 2
Signature help was triggered by a trigger character.
- class lsprotocol.types.SignatureInformation(label, documentation=None, parameters=None, active_parameter=None)
Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.
- Parameters:
label (str) –
documentation (Optional[Union[str, MarkupContent]]) –
parameters (Optional[List[ParameterInformation]]) –
- active_parameter: Optional[int]
The index of the active parameter.
If provided, this is used in place of
SignatureHelp.activeParameter
.LSP v3.16.0
- documentation: Optional[Union[str, MarkupContent]]
The human-readable doc-comment of this signature. Will be shown in the UI but can be omitted.
- parameters: Optional[List[ParameterInformation]]
The parameters of this signature.
- class lsprotocol.types.StaticRegistrationOptions(id=None)
Static registration options to be returned in the initialize request.
- class lsprotocol.types.StringValue(value, kind='snippet')
A string value used as a snippet is a template which allows to insert text and to control the editor cursor when insertion happens.
A snippet can define tab stops and placeholders with
$1
, $2 and${3:foo}
. $0 defines the final tab stop, it defaults to the end of the snippet. Variables are defined with$name
and${name:default value}
.LSP v3.18.0 @proposed
- class lsprotocol.types.SymbolInformation(location, name, kind, deprecated=None, tags=None, container_name=None)
Represents information about programming constructs like variables, classes, interfaces etc.
- Parameters:
- container_name: Optional[str]
The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can’t be used to re-infer a hierarchy for the document symbols.
- kind: SymbolKind
The kind of this symbol.
- location: Location
The location of this symbol. The location’s range is used by a tool to reveal the location in the editor. If the symbol is selected in the tool the range’s start information is used to position the cursor. So the range usually spans more than the actual symbol’s name and does normally include things like visibility modifiers.
The range doesn’t have to denote a node range in the sense of an abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.
- class lsprotocol.types.SymbolKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
A symbol kind.
- Array = 18
- Boolean = 17
- Class = 5
- Constant = 14
- Constructor = 9
- Enum = 10
- EnumMember = 22
- Event = 24
- Field = 8
- File = 1
- Function = 12
- Interface = 11
- Key = 20
- Method = 6
- Module = 2
- Namespace = 3
- Null = 21
- Number = 16
- Object = 19
- Operator = 25
- Package = 4
- Property = 7
- String = 15
- Struct = 23
- TypeParameter = 26
- Variable = 13
- class lsprotocol.types.SymbolTag(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Symbol tags are extra annotations that tweak the rendering of a symbol.
LSP v3.16
- Deprecated = 1
Render a symbol as obsolete, usually using a strike-out.
- class lsprotocol.types.TelemetryEventNotification(params, method='telemetry/event', jsonrpc='2.0')
The telemetry event notification is sent from the server to the client to ask the client to log telemetry data.
- class lsprotocol.types.TextDocumentChangeRegistrationOptions(sync_kind, document_selector=None)
Describe options to be used when registered for text document change events.
- Parameters:
sync_kind (TextDocumentSyncKind) –
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- sync_kind: TextDocumentSyncKind
How documents are synced to the server.
- class lsprotocol.types.TextDocumentClientCapabilities(synchronization=None, completion=None, hover=None, signature_help=None, declaration=None, definition=None, type_definition=None, implementation=None, references=None, document_highlight=None, document_symbol=None, code_action=None, code_lens=None, document_link=None, color_provider=None, formatting=None, range_formatting=None, on_type_formatting=None, rename=None, folding_range=None, selection_range=None, publish_diagnostics=None, call_hierarchy=None, semantic_tokens=None, linked_editing_range=None, moniker=None, type_hierarchy=None, inline_value=None, inlay_hint=None, diagnostic=None, inline_completion=None)
Text document specific client capabilities.
- Parameters:
synchronization (Optional[TextDocumentSyncClientCapabilities]) –
completion (Optional[CompletionClientCapabilities]) –
hover (Optional[HoverClientCapabilities]) –
signature_help (Optional[SignatureHelpClientCapabilities]) –
declaration (Optional[DeclarationClientCapabilities]) –
definition (Optional[DefinitionClientCapabilities]) –
type_definition (Optional[TypeDefinitionClientCapabilities]) –
implementation (Optional[ImplementationClientCapabilities]) –
references (Optional[ReferenceClientCapabilities]) –
document_highlight (Optional[DocumentHighlightClientCapabilities]) –
document_symbol (Optional[DocumentSymbolClientCapabilities]) –
code_action (Optional[CodeActionClientCapabilities]) –
code_lens (Optional[CodeLensClientCapabilities]) –
document_link (Optional[DocumentLinkClientCapabilities]) –
color_provider (Optional[DocumentColorClientCapabilities]) –
formatting (Optional[DocumentFormattingClientCapabilities]) –
range_formatting (Optional[DocumentRangeFormattingClientCapabilities]) –
on_type_formatting (Optional[DocumentOnTypeFormattingClientCapabilities]) –
rename (Optional[RenameClientCapabilities]) –
folding_range (Optional[FoldingRangeClientCapabilities]) –
selection_range (Optional[SelectionRangeClientCapabilities]) –
publish_diagnostics (Optional[PublishDiagnosticsClientCapabilities]) –
call_hierarchy (Optional[CallHierarchyClientCapabilities]) –
semantic_tokens (Optional[SemanticTokensClientCapabilities]) –
linked_editing_range (Optional[LinkedEditingRangeClientCapabilities]) –
moniker (Optional[MonikerClientCapabilities]) –
type_hierarchy (Optional[TypeHierarchyClientCapabilities]) –
inline_value (Optional[InlineValueClientCapabilities]) –
inlay_hint (Optional[InlayHintClientCapabilities]) –
diagnostic (Optional[DiagnosticClientCapabilities]) –
inline_completion (Optional[InlineCompletionClientCapabilities]) –
- call_hierarchy: Optional[CallHierarchyClientCapabilities]
Capabilities specific to the various call hierarchy requests.
LSP v3.16.0
- code_action: Optional[CodeActionClientCapabilities]
Capabilities specific to the
textDocument/codeAction
request.
- code_lens: Optional[CodeLensClientCapabilities]
Capabilities specific to the
textDocument/codeLens
request.
- color_provider: Optional[DocumentColorClientCapabilities]
Capabilities specific to the
textDocument/documentColor
and thetextDocument/colorPresentation
request.LSP v3.6.0
- completion: Optional[CompletionClientCapabilities]
Capabilities specific to the
textDocument/completion
request.
- declaration: Optional[DeclarationClientCapabilities]
Capabilities specific to the
textDocument/declaration
request.LSP v3.14.0
- definition: Optional[DefinitionClientCapabilities]
Capabilities specific to the
textDocument/definition
request.
- diagnostic: Optional[DiagnosticClientCapabilities]
Capabilities specific to the diagnostic pull model.
LSP v3.17.0
- document_highlight: Optional[DocumentHighlightClientCapabilities]
Capabilities specific to the
textDocument/documentHighlight
request.
- document_link: Optional[DocumentLinkClientCapabilities]
Capabilities specific to the
textDocument/documentLink
request.
- document_symbol: Optional[DocumentSymbolClientCapabilities]
Capabilities specific to the
textDocument/documentSymbol
request.
- folding_range: Optional[FoldingRangeClientCapabilities]
Capabilities specific to the
textDocument/foldingRange
request.LSP v3.10.0
- formatting: Optional[DocumentFormattingClientCapabilities]
Capabilities specific to the
textDocument/formatting
request.
- hover: Optional[HoverClientCapabilities]
Capabilities specific to the
textDocument/hover
request.
- implementation: Optional[ImplementationClientCapabilities]
Capabilities specific to the
textDocument/implementation
request.LSP v3.6.0
- inlay_hint: Optional[InlayHintClientCapabilities]
Capabilities specific to the
textDocument/inlayHint
request.LSP v3.17.0
- inline_completion: Optional[InlineCompletionClientCapabilities]
Client capabilities specific to inline completions.
LSP v3.18.0 @proposed
- inline_value: Optional[InlineValueClientCapabilities]
Capabilities specific to the
textDocument/inlineValue
request.LSP v3.17.0
- linked_editing_range: Optional[LinkedEditingRangeClientCapabilities]
Capabilities specific to the
textDocument/linkedEditingRange
request.LSP v3.16.0
- moniker: Optional[MonikerClientCapabilities]
Client capabilities specific to the
textDocument/moniker
request.LSP v3.16.0
- on_type_formatting: Optional[DocumentOnTypeFormattingClientCapabilities]
Capabilities specific to the
textDocument/onTypeFormatting
request.
- publish_diagnostics: Optional[PublishDiagnosticsClientCapabilities]
Capabilities specific to the
textDocument/publishDiagnostics
notification.
- range_formatting: Optional[DocumentRangeFormattingClientCapabilities]
Capabilities specific to the
textDocument/rangeFormatting
request.
- references: Optional[ReferenceClientCapabilities]
Capabilities specific to the
textDocument/references
request.
- rename: Optional[RenameClientCapabilities]
Capabilities specific to the
textDocument/rename
request.
- selection_range: Optional[SelectionRangeClientCapabilities]
Capabilities specific to the
textDocument/selectionRange
request.LSP v3.15.0
- semantic_tokens: Optional[SemanticTokensClientCapabilities]
Capabilities specific to the various semantic token request.
LSP v3.16.0
- signature_help: Optional[SignatureHelpClientCapabilities]
Capabilities specific to the
textDocument/signatureHelp
request.
- synchronization: Optional[TextDocumentSyncClientCapabilities]
Defines which synchronization capabilities the client supports.
- type_definition: Optional[TypeDefinitionClientCapabilities]
Capabilities specific to the
textDocument/typeDefinition
request.LSP v3.6.0
- type_hierarchy: Optional[TypeHierarchyClientCapabilities]
Capabilities specific to the various type hierarchy requests.
LSP v3.17.0
- class lsprotocol.types.TextDocumentCodeActionRequest(id, params, method='textDocument/codeAction', jsonrpc='2.0')
A request to provide commands for the given text document and range.
- params: CodeActionParams
- class lsprotocol.types.TextDocumentCodeActionResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- class lsprotocol.types.TextDocumentCodeLensRequest(id, params, method='textDocument/codeLens', jsonrpc='2.0')
A request to provide code lens for the given text document.
- params: CodeLensParams
- class lsprotocol.types.TextDocumentCodeLensResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentColorPresentationOptions(work_done_progress=None, document_selector=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.TextDocumentColorPresentationRequest(id, params, method='textDocument/colorPresentation', jsonrpc='2.0')
A request to list all presentation for a color. The request’s parameter is of type
ColorPresentationParams
the response is of typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- Parameters:
- params: ColorPresentationParams
- class lsprotocol.types.TextDocumentColorPresentationResponse(id, result=None, jsonrpc='2.0')
-
- result: List[ColorPresentation]
- class lsprotocol.types.TextDocumentCompletionRequest(id, params, method='textDocument/completion', jsonrpc='2.0')
Request to request completion at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeCompletionItem CompletionItem[]
or {@link CompletionList} or a Thenable that resolves to such.The request can delay the computation of the {@link CompletionItem.detail
detail
} and {@link CompletionItem.documentationdocumentation
} properties to the completionItem/resolve request. However, properties that are needed for the initial sorting and filtering, likesortText
,filterText
, insertText, and textEdit, must not be changed during resolve.- params: CompletionParams
- class lsprotocol.types.TextDocumentCompletionResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Optional[Union[List[CompletionItem], CompletionList]]) –
jsonrpc (str) –
- result: Optional[Union[List[CompletionItem], CompletionList]]
- class lsprotocol.types.TextDocumentContentChangeEvent_Type1(range, text, range_length=None)
- class lsprotocol.types.TextDocumentDeclarationRequest(id, params, method='textDocument/declaration', jsonrpc='2.0')
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 typeDeclaration
or a typed array of {@link DeclarationLink} or a Thenable that resolves to such.- params: DeclarationParams
- class lsprotocol.types.TextDocumentDeclarationResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- class lsprotocol.types.TextDocumentDefinitionRequest(id, params, method='textDocument/definition', jsonrpc='2.0')
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 typeDefinition
or a typed array ofDefinitionLink
or a Thenable that resolves to such.- params: DefinitionParams
- class lsprotocol.types.TextDocumentDefinitionResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- class lsprotocol.types.TextDocumentDiagnosticRequest(id, params, method='textDocument/diagnostic', jsonrpc='2.0')
The document diagnostic request definition.
LSP v3.17.0
- Parameters:
- params: DocumentDiagnosticParams
- class lsprotocol.types.TextDocumentDiagnosticResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Union[RelatedFullDocumentDiagnosticReport, RelatedUnchangedDocumentDiagnosticReport]) –
jsonrpc (str) –
- class lsprotocol.types.TextDocumentDidChangeNotification(params, method='textDocument/didChange', jsonrpc='2.0')
The document change notification is sent from the client to the server to signal changes to a text document.
- Parameters:
params (DidChangeTextDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidChangeTextDocumentParams
- class lsprotocol.types.TextDocumentDidCloseNotification(params, method='textDocument/didClose', jsonrpc='2.0')
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.
- Parameters:
params (DidCloseTextDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidCloseTextDocumentParams
- class lsprotocol.types.TextDocumentDidOpenNotification(params, method='textDocument/didOpen', jsonrpc='2.0')
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.
- Parameters:
params (DidOpenTextDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidOpenTextDocumentParams
- class lsprotocol.types.TextDocumentDidSaveNotification(params, method='textDocument/didSave', jsonrpc='2.0')
The document save notification is sent from the client to the server when the document got saved in the client.
- Parameters:
params (DidSaveTextDocumentParams) –
method (str) –
jsonrpc (str) –
- params: DidSaveTextDocumentParams
- class lsprotocol.types.TextDocumentDocumentColorRequest(id, params, method='textDocument/documentColor', jsonrpc='2.0')
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 typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- params: DocumentColorParams
- class lsprotocol.types.TextDocumentDocumentColorResponse(id, result=None, jsonrpc='2.0')
-
- result: List[ColorInformation]
- class lsprotocol.types.TextDocumentDocumentHighlightRequest(id, params, method='textDocument/documentHighlight', jsonrpc='2.0')
Request to resolve a
DocumentHighlight
for a given text document position. The request’s parameter is of typeTextDocumentPosition
the request response is an array of typeDocumentHighlight
or a Thenable that resolves to such.- Parameters:
- params: DocumentHighlightParams
- class lsprotocol.types.TextDocumentDocumentHighlightResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[DocumentHighlight]]
- class lsprotocol.types.TextDocumentDocumentLinkRequest(id, params, method='textDocument/documentLink', jsonrpc='2.0')
A request to provide document links
- params: DocumentLinkParams
- class lsprotocol.types.TextDocumentDocumentLinkResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[DocumentLink]]
- class lsprotocol.types.TextDocumentDocumentSymbolRequest(id, params, method='textDocument/documentSymbol', jsonrpc='2.0')
A request to list all symbols found in a given text document. The request’s parameter is of type
TextDocumentIdentifier
the response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- params: DocumentSymbolParams
- class lsprotocol.types.TextDocumentDocumentSymbolResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[Union[List[SymbolInformation], List[DocumentSymbol]]]
- class lsprotocol.types.TextDocumentEdit(text_document, edits)
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.
- Parameters:
text_document (OptionalVersionedTextDocumentIdentifier) –
edits (List[Union[TextEdit, AnnotatedTextEdit]]) –
- edits: List[Union[TextEdit, AnnotatedTextEdit]]
The edits to be applied.
LSP v3.16.0 - support for AnnotatedTextEdit. This is guarded using a client capability.
- text_document: OptionalVersionedTextDocumentIdentifier
The text document to change.
- class lsprotocol.types.TextDocumentFilter_Type1(language, scheme=None, pattern=None)
- class lsprotocol.types.TextDocumentFilter_Type2(scheme, language=None, pattern=None)
- class lsprotocol.types.TextDocumentFilter_Type3(pattern, language=None, scheme=None)
- class lsprotocol.types.TextDocumentFoldingRangeRequest(id, params, method='textDocument/foldingRange', jsonrpc='2.0')
A request to provide folding ranges in a document. The request’s parameter is of type
FoldingRangeParams
, the response is of typeFoldingRangeList
or a Thenable that resolves to such.- params: FoldingRangeParams
- class lsprotocol.types.TextDocumentFoldingRangeResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[FoldingRange]]
- class lsprotocol.types.TextDocumentFormattingRequest(id, params, method='textDocument/formatting', jsonrpc='2.0')
A request to format a whole document.
- Parameters:
- params: DocumentFormattingParams
- class lsprotocol.types.TextDocumentFormattingResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentHoverRequest(id, params, method='textDocument/hover', jsonrpc='2.0')
Request to request hover information at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeHover
or a Thenable that resolves to such.- params: HoverParams
- class lsprotocol.types.TextDocumentHoverResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentIdentifier(uri)
A literal to identify a text document in the client.
- Parameters:
uri (str) –
- class lsprotocol.types.TextDocumentImplementationRequest(id, params, method='textDocument/implementation', jsonrpc='2.0')
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 typeDefinition
or a Thenable that resolves to such.- params: ImplementationParams
- class lsprotocol.types.TextDocumentImplementationResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- class lsprotocol.types.TextDocumentInlayHintRequest(id, params, method='textDocument/inlayHint', jsonrpc='2.0')
A request to provide inlay hints in a document. The request’s parameter is of type
InlayHintsParams
, the response is of typeInlayHint InlayHint[]
or a Thenable that resolves to such.LSP v3.17.0
- params: InlayHintParams
- class lsprotocol.types.TextDocumentInlayHintResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentInlineCompletionRequest(id, params, method='textDocument/inlineCompletion', jsonrpc='2.0')
A request to provide inline completions in a document. The request’s parameter is of type
InlineCompletionParams
, the response is of typeInlineCompletion InlineCompletion[]
or a Thenable that resolves to such.LSP v3.18.0 @proposed
- params: InlineCompletionParams
- class lsprotocol.types.TextDocumentInlineCompletionResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Optional[Union[InlineCompletionList, List[InlineCompletionItem]]]) –
jsonrpc (str) –
- result: Optional[Union[InlineCompletionList, List[InlineCompletionItem]]]
- class lsprotocol.types.TextDocumentInlineValueRequest(id, params, method='textDocument/inlineValue', jsonrpc='2.0')
A request to provide inline values in a document. The request’s parameter is of type
InlineValueParams
, the response is of typeInlineValue InlineValue[]
or a Thenable that resolves to such.LSP v3.17.0
- params: InlineValueParams
- class lsprotocol.types.TextDocumentInlineValueResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Optional[List[Union[InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression]]]) –
jsonrpc (str) –
- class lsprotocol.types.TextDocumentItem(uri, language_id, version, text)
An item to transfer a text document from the client to the server.
- class lsprotocol.types.TextDocumentLinkedEditingRangeRequest(id, params, method='textDocument/linkedEditingRange', jsonrpc='2.0')
A request to provide ranges that can be edited together.
LSP v3.16.0
- Parameters:
- params: LinkedEditingRangeParams
- class lsprotocol.types.TextDocumentLinkedEditingRangeResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[LinkedEditingRanges]
- class lsprotocol.types.TextDocumentMonikerRequest(id, params, method='textDocument/moniker', jsonrpc='2.0')
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 {@link Moniker Moniker[]} ornull
.- params: MonikerParams
- class lsprotocol.types.TextDocumentMonikerResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentOnTypeFormattingRequest(id, params, method='textDocument/onTypeFormatting', jsonrpc='2.0')
A request to format a document on type.
- Parameters:
- params: DocumentOnTypeFormattingParams
- class lsprotocol.types.TextDocumentOnTypeFormattingResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentPositionParams(text_document, position)
A parameter literal used in requests to pass a text document and a position inside that document.
- Parameters:
text_document (TextDocumentIdentifier) –
position (Position) –
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.TextDocumentPrepareCallHierarchyRequest(id, params, method='textDocument/prepareCallHierarchy', jsonrpc='2.0')
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.LSP v3.16.0
- Parameters:
- params: CallHierarchyPrepareParams
- class lsprotocol.types.TextDocumentPrepareCallHierarchyResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[CallHierarchyItem]]
- class lsprotocol.types.TextDocumentPrepareRenameRequest(id, params, method='textDocument/prepareRename', jsonrpc='2.0')
A request to test and perform the setup necessary for a rename.
LSP v3.16 - support for default behavior
- params: PrepareRenameParams
- class lsprotocol.types.TextDocumentPrepareRenameResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Optional[Union[Range, PrepareRenameResult_Type1, PrepareRenameResult_Type2]]) –
jsonrpc (str) –
- class lsprotocol.types.TextDocumentPrepareTypeHierarchyRequest(id, params, method='textDocument/prepareTypeHierarchy', jsonrpc='2.0')
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.LSP v3.17.0
- Parameters:
- params: TypeHierarchyPrepareParams
- class lsprotocol.types.TextDocumentPrepareTypeHierarchyResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[TypeHierarchyItem]]
- class lsprotocol.types.TextDocumentPublishDiagnosticsNotification(params, method='textDocument/publishDiagnostics', jsonrpc='2.0')
Diagnostics notification are sent from the server to the client to signal results of validation runs.
- Parameters:
params (PublishDiagnosticsParams) –
method (str) –
jsonrpc (str) –
- params: PublishDiagnosticsParams
- class lsprotocol.types.TextDocumentRangeFormattingRequest(id, params, method='textDocument/rangeFormatting', jsonrpc='2.0')
A request to format a range in a document.
- Parameters:
- params: DocumentRangeFormattingParams
- class lsprotocol.types.TextDocumentRangeFormattingResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentRangesFormattingRequest(id, params, method='textDocument/rangesFormatting', jsonrpc='2.0')
A request to format ranges in a document.
LSP v3.18.0 @proposed
- Parameters:
- params: DocumentRangesFormattingParams
- class lsprotocol.types.TextDocumentRangesFormattingResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentReferencesRequest(id, params, method='textDocument/references', jsonrpc='2.0')
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 typeLocation Location[]
or a Thenable that resolves to such.- params: ReferenceParams
- class lsprotocol.types.TextDocumentReferencesResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextDocumentRegistrationOptions(document_selector=None)
General text document registration options.
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.TextDocumentRenameRequest(id, params, method='textDocument/rename', jsonrpc='2.0')
A request to rename a symbol.
- params: RenameParams
- class lsprotocol.types.TextDocumentRenameResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[WorkspaceEdit]
- class lsprotocol.types.TextDocumentSaveReason(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Represents reasons why a text document is saved.
- AfterDelay = 2
Automatic after a delay.
- FocusOut = 3
When the editor lost focus.
- Manual = 1
Manually triggered, e.g. by the user pressing save, by starting debugging, or by an API call.
- class lsprotocol.types.TextDocumentSaveRegistrationOptions(document_selector=None, include_text=None)
Save registration options.
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.TextDocumentSelectionRangeRequest(id, params, method='textDocument/selectionRange', jsonrpc='2.0')
A request to provide selection ranges in a document. The request’s parameter is of type
SelectionRangeParams
, the response is of typeSelectionRange SelectionRange[]
or a Thenable that resolves to such.- params: SelectionRangeParams
- class lsprotocol.types.TextDocumentSelectionRangeResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[SelectionRange]]
- class lsprotocol.types.TextDocumentSemanticTokensFullDeltaRequest(id, params, method='textDocument/semanticTokens/full/delta', jsonrpc='2.0')
LSP v3.16.0
- Parameters:
- params: SemanticTokensDeltaParams
- class lsprotocol.types.TextDocumentSemanticTokensFullDeltaResponse(id, result=None, jsonrpc='2.0')
- Parameters:
result (Optional[Union[SemanticTokens, SemanticTokensDelta]]) –
jsonrpc (str) –
- result: Optional[Union[SemanticTokens, SemanticTokensDelta]]
- class lsprotocol.types.TextDocumentSemanticTokensFullRequest(id, params, method='textDocument/semanticTokens/full', jsonrpc='2.0')
LSP v3.16.0
- params: SemanticTokensParams
- class lsprotocol.types.TextDocumentSemanticTokensFullResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[SemanticTokens]
- class lsprotocol.types.TextDocumentSemanticTokensRangeRequest(id, params, method='textDocument/semanticTokens/range', jsonrpc='2.0')
LSP v3.16.0
- Parameters:
- params: SemanticTokensRangeParams
- class lsprotocol.types.TextDocumentSemanticTokensRangeResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[SemanticTokens]
- class lsprotocol.types.TextDocumentSignatureHelpRequest(id, params, method='textDocument/signatureHelp', jsonrpc='2.0')
-
- params: SignatureHelpParams
- class lsprotocol.types.TextDocumentSignatureHelpResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[SignatureHelp]
- class lsprotocol.types.TextDocumentSyncClientCapabilities(dynamic_registration=None, will_save=None, will_save_wait_until=None, did_save=None)
- Parameters:
- class lsprotocol.types.TextDocumentSyncKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Defines how the host (editor) should sync document changes to the language server.
- Full = 1
Documents are synced by always sending the full content of the document.
- Incremental = 2
Documents are synced by sending the full content on open. After that only incremental updates to the document are send.
- None_ = 0
Documents should not be synced at all.
- class lsprotocol.types.TextDocumentSyncOptions(open_close=None, change=None, will_save=None, will_save_wait_until=None, save=None)
- Parameters:
- change: Optional[TextDocumentSyncKind]
Change notifications are sent to the server. See TextDocumentSyncKind.None, TextDocumentSyncKind.Full and TextDocumentSyncKind.Incremental. If omitted it defaults to TextDocumentSyncKind.None.
- open_close: Optional[bool]
Open and close notifications are sent to the server. If omitted open close notification should not be sent.
- save: Optional[Union[bool, SaveOptions]]
If present save notifications are sent to the server. If omitted the notification should not be sent.
- class lsprotocol.types.TextDocumentTypeDefinitionRequest(id, params, method='textDocument/typeDefinition', jsonrpc='2.0')
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 typeDefinition
or a Thenable that resolves to such.- params: TypeDefinitionParams
- class lsprotocol.types.TextDocumentTypeDefinitionResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- class lsprotocol.types.TextDocumentWillSaveNotification(params, method='textDocument/willSave', jsonrpc='2.0')
A document will save notification is sent from the client to the server before the document is actually saved.
- Parameters:
params (WillSaveTextDocumentParams) –
method (str) –
jsonrpc (str) –
- params: WillSaveTextDocumentParams
- class lsprotocol.types.TextDocumentWillSaveWaitUntilRequest(id, params, method='textDocument/willSaveWaitUntil', jsonrpc='2.0')
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.
- Parameters:
- params: WillSaveTextDocumentParams
- class lsprotocol.types.TextDocumentWillSaveWaitUntilResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.TextEdit(range, new_text)
A text edit applicable to a text document.
- class lsprotocol.types.TokenFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Relative = 'relative'
- class lsprotocol.types.TraceValues(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Messages = 'messages'
Trace messages only.
- Off = 'off'
Turn tracing off.
- Verbose = 'verbose'
Verbose message tracing.
- class lsprotocol.types.TypeDefinitionClientCapabilities(dynamic_registration=None, link_support=None)
Since 3.6.0
- class lsprotocol.types.TypeDefinitionOptions(work_done_progress=None)
- class lsprotocol.types.TypeDefinitionParams(text_document, position, work_done_token=None, partial_result_token=None)
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.TypeDefinitionRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.TypeHierarchyClientCapabilities(dynamic_registration=None)
LSP v3.17.0
- class lsprotocol.types.TypeHierarchyItem(name, kind, uri, range, selection_range, tags=None, detail=None, data=None)
LSP v3.17.0
- Parameters:
- data: Optional[Any]
A data entry field that is preserved between a type hierarchy prepare and supertypes or subtypes requests. It could also be used to identify the type hierarchy in the server, helping improve the performance on resolving supertypes and subtypes.
- kind: SymbolKind
The kind of this item.
- range: Range
The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
- class lsprotocol.types.TypeHierarchyOptions(work_done_progress=None)
Type hierarchy options used during static registration.
LSP v3.17.0
- class lsprotocol.types.TypeHierarchyPrepareParams(text_document, position, work_done_token=None)
The parameter of a
textDocument/prepareTypeHierarchy
request.LSP v3.17.0
- Parameters:
- text_document: TextDocumentIdentifier
The text document.
- class lsprotocol.types.TypeHierarchyRegistrationOptions(document_selector=None, work_done_progress=None, id=None)
Type hierarchy options used during static or dynamic registration.
LSP v3.17.0
- Parameters:
document_selector (Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]) –
- document_selector: Optional[List[Union[TextDocumentFilter_Type1, TextDocumentFilter_Type2, TextDocumentFilter_Type3, NotebookCellTextDocumentFilter]]]
A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.
- class lsprotocol.types.TypeHierarchySubtypesParams(item, work_done_token=None, partial_result_token=None)
The parameter of a
typeHierarchy/subtypes
request.LSP v3.17.0
- Parameters:
- item: TypeHierarchyItem
- class lsprotocol.types.TypeHierarchySubtypesRequest(id, params, method='typeHierarchy/subtypes', jsonrpc='2.0')
A request to resolve the subtypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
- params: TypeHierarchySubtypesParams
- class lsprotocol.types.TypeHierarchySubtypesResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[TypeHierarchyItem]]
- class lsprotocol.types.TypeHierarchySupertypesParams(item, work_done_token=None, partial_result_token=None)
The parameter of a
typeHierarchy/supertypes
request.LSP v3.17.0
- Parameters:
- item: TypeHierarchyItem
- class lsprotocol.types.TypeHierarchySupertypesRequest(id, params, method='typeHierarchy/supertypes', jsonrpc='2.0')
A request to resolve the supertypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
- params: TypeHierarchySupertypesParams
- class lsprotocol.types.TypeHierarchySupertypesResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[TypeHierarchyItem]]
- class lsprotocol.types.UnchangedDocumentDiagnosticReport(result_id, kind='unchanged')
A diagnostic report indicating that the last returned report is still accurate.
LSP v3.17.0
- class lsprotocol.types.UniquenessLevel(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
Moniker uniqueness level to define scope of the moniker.
LSP v3.16.0
- Document = 'document'
The moniker is only unique inside a document
- Global = 'global'
The moniker is globally unique
- Group = 'group'
The moniker is unique inside the group to which a project belongs
- Project = 'project'
The moniker is unique inside a project for which a dump got created
- Scheme = 'scheme'
The moniker is unique inside the moniker scheme.
- class lsprotocol.types.Unregistration(id, method)
General parameters to unregister a request or notification.
- class lsprotocol.types.UnregistrationParams(unregisterations)
- Parameters:
unregisterations (List[Unregistration]) –
- unregisterations: List[Unregistration]
- class lsprotocol.types.VersionedNotebookDocumentIdentifier(version, uri)
A versioned notebook document identifier.
LSP v3.17.0
- class lsprotocol.types.VersionedTextDocumentIdentifier(version, uri)
A text document identifier to denote a specific version of a text document.
- class lsprotocol.types.WatchKind(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)
- Change = 2
Interested in change events
- Create = 1
Interested in create events.
- Delete = 4
Interested in delete events
- class lsprotocol.types.WillSaveTextDocumentParams(text_document, reason)
The parameters sent in a will save text document notification.
- Parameters:
text_document (TextDocumentIdentifier) –
reason (TextDocumentSaveReason) –
- reason: TextDocumentSaveReason
The ‘TextDocumentSaveReason’.
- text_document: TextDocumentIdentifier
The document that will be saved.
- class lsprotocol.types.WindowClientCapabilities(work_done_progress=None, show_message=None, show_document=None)
- Parameters:
show_message (Optional[ShowMessageRequestClientCapabilities]) –
show_document (Optional[ShowDocumentClientCapabilities]) –
- show_document: Optional[ShowDocumentClientCapabilities]
Capabilities specific to the showDocument request.
LSP v3.16.0
- show_message: Optional[ShowMessageRequestClientCapabilities]
Capabilities specific to the showMessage request.
LSP v3.16.0
- work_done_progress: Optional[bool]
It indicates whether the client supports server initiated progress using the
window/workDoneProgress/create
request.The capability also controls Whether client supports handling of progress notifications. If set servers are allowed to report a
workDoneProgress
property in the request specific server capabilities.LSP v3.15.0
- class lsprotocol.types.WindowLogMessageNotification(params, method='window/logMessage', jsonrpc='2.0')
The log message notification is sent from the server to the client to ask the client to log a particular message.
- Parameters:
params (LogMessageParams) –
method (str) –
jsonrpc (str) –
- params: LogMessageParams
- class lsprotocol.types.WindowShowDocumentRequest(id, params, method='window/showDocument', jsonrpc='2.0')
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.LSP v3.16.0
- params: ShowDocumentParams
- class lsprotocol.types.WindowShowDocumentResponse(id, result=None, jsonrpc='2.0')
-
- result: ShowDocumentResult
- class lsprotocol.types.WindowShowMessageNotification(params, method='window/showMessage', jsonrpc='2.0')
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.
- Parameters:
params (ShowMessageParams) –
method (str) –
jsonrpc (str) –
- params: ShowMessageParams
- class lsprotocol.types.WindowShowMessageRequestRequest(id, params, method='window/showMessageRequest', jsonrpc='2.0')
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.
- Parameters:
- params: ShowMessageRequestParams
- class lsprotocol.types.WindowShowMessageRequestResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[MessageActionItem]
- class lsprotocol.types.WindowWorkDoneProgressCancelNotification(params, method='window/workDoneProgress/cancel', jsonrpc='2.0')
The
window/workDoneProgress/cancel
notification is sent from the client to the server to cancel a progress initiated on the server side.- Parameters:
params (WorkDoneProgressCancelParams) –
method (str) –
jsonrpc (str) –
- params: WorkDoneProgressCancelParams
- class lsprotocol.types.WindowWorkDoneProgressCreateRequest(id, params, method='window/workDoneProgress/create', jsonrpc='2.0')
The
window/workDoneProgress/create
request is sent from the server to the client to initiate progress reporting from the server.- Parameters:
- params: WorkDoneProgressCreateParams
- class lsprotocol.types.WindowWorkDoneProgressCreateResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkDoneProgressBegin(title, kind='begin', cancellable=None, message=None, percentage=None)
- Parameters:
- cancellable: Optional[bool]
Controls if a cancel button should show to allow the user to cancel the long running operation. Clients that don’t support cancellation are allowed to ignore the setting.
- message: Optional[str]
Optional, more detailed associated progress message. Contains complementary information to the
title
.Examples: “3/25 files”, “project/src/module2”, “node_modules/some_dep”. If unset, the previous progress message (if any) is still valid.
- percentage: Optional[int]
Optional progress percentage to display (value 100 is considered 100%). If not provided infinite progress is assumed and clients are allowed to ignore the
percentage
value in subsequent in report notifications.The value should be steadily rising. Clients are free to ignore values that are not following this rule. The value range is [0, 100].
- class lsprotocol.types.WorkDoneProgressCancelParams(token)
- class lsprotocol.types.WorkDoneProgressCreateParams(token)
- class lsprotocol.types.WorkDoneProgressEnd(kind='end', message=None)
- class lsprotocol.types.WorkDoneProgressOptions(work_done_progress=None)
- class lsprotocol.types.WorkDoneProgressParams(work_done_token=None)
- class lsprotocol.types.WorkDoneProgressReport(kind='report', cancellable=None, message=None, percentage=None)
- Parameters:
- cancellable: Optional[bool]
Controls enablement state of a cancel button.
Clients that don’t support cancellation or don’t support controlling the button’s enablement state are allowed to ignore the property.
- message: Optional[str]
Optional, more detailed associated progress message. Contains complementary information to the
title
.Examples: “3/25 files”, “project/src/module2”, “node_modules/some_dep”. If unset, the previous progress message (if any) is still valid.
- percentage: Optional[int]
Optional progress percentage to display (value 100 is considered 100%). If not provided infinite progress is assumed and clients are allowed to ignore the
percentage
value in subsequent in report notifications.The value should be steadily rising. Clients are free to ignore values that are not following this rule. The value range is [0, 100]
- class lsprotocol.types.WorkspaceApplyEditRequest(id, params, method='workspace/applyEdit', jsonrpc='2.0')
A request sent from the server to the client to modified certain resources.
- Parameters:
- params: ApplyWorkspaceEditParams
- class lsprotocol.types.WorkspaceApplyEditResponse(id, result=None, jsonrpc='2.0')
-
- result: ApplyWorkspaceEditResult
- class lsprotocol.types.WorkspaceClientCapabilities(apply_edit=None, workspace_edit=None, did_change_configuration=None, did_change_watched_files=None, symbol=None, execute_command=None, workspace_folders=None, configuration=None, semantic_tokens=None, code_lens=None, file_operations=None, inline_value=None, inlay_hint=None, diagnostics=None, folding_range=None)
Workspace specific client capabilities.
- Parameters:
workspace_edit (Optional[WorkspaceEditClientCapabilities]) –
did_change_configuration (Optional[DidChangeConfigurationClientCapabilities]) –
did_change_watched_files (Optional[DidChangeWatchedFilesClientCapabilities]) –
symbol (Optional[WorkspaceSymbolClientCapabilities]) –
execute_command (Optional[ExecuteCommandClientCapabilities]) –
semantic_tokens (Optional[SemanticTokensWorkspaceClientCapabilities]) –
code_lens (Optional[CodeLensWorkspaceClientCapabilities]) –
file_operations (Optional[FileOperationClientCapabilities]) –
inline_value (Optional[InlineValueWorkspaceClientCapabilities]) –
inlay_hint (Optional[InlayHintWorkspaceClientCapabilities]) –
diagnostics (Optional[DiagnosticWorkspaceClientCapabilities]) –
folding_range (Optional[FoldingRangeWorkspaceClientCapabilities]) –
- apply_edit: Optional[bool]
The client supports applying batch edits to the workspace by supporting the request ‘workspace/applyEdit’
- code_lens: Optional[CodeLensWorkspaceClientCapabilities]
Capabilities specific to the code lens requests scoped to the workspace.
LSP v3.16.0.
- diagnostics: Optional[DiagnosticWorkspaceClientCapabilities]
Capabilities specific to the diagnostic requests scoped to the workspace.
LSP v3.17.0.
- did_change_configuration: Optional[DidChangeConfigurationClientCapabilities]
Capabilities specific to the
workspace/didChangeConfiguration
notification.
- did_change_watched_files: Optional[DidChangeWatchedFilesClientCapabilities]
Capabilities specific to the
workspace/didChangeWatchedFiles
notification.
- execute_command: Optional[ExecuteCommandClientCapabilities]
Capabilities specific to the
workspace/executeCommand
request.
- file_operations: Optional[FileOperationClientCapabilities]
The client has support for file notifications/requests for user operations on files.
Since 3.16.0
- folding_range: Optional[FoldingRangeWorkspaceClientCapabilities]
Capabilities specific to the folding range requests scoped to the workspace.
LSP v3.18.0 @proposed
- inlay_hint: Optional[InlayHintWorkspaceClientCapabilities]
Capabilities specific to the inlay hint requests scoped to the workspace.
LSP v3.17.0.
- inline_value: Optional[InlineValueWorkspaceClientCapabilities]
Capabilities specific to the inline values requests scoped to the workspace.
LSP v3.17.0.
- semantic_tokens: Optional[SemanticTokensWorkspaceClientCapabilities]
Capabilities specific to the semantic token requests scoped to the workspace.
LSP v3.16.0.
- symbol: Optional[WorkspaceSymbolClientCapabilities]
Capabilities specific to the
workspace/symbol
request.
- workspace_edit: Optional[WorkspaceEditClientCapabilities]
Capabilities specific to
WorkspaceEdit
s.
- class lsprotocol.types.WorkspaceCodeLensRefreshRequest(id, params=None, method='workspace/codeLens/refresh', jsonrpc='2.0')
A request to refresh all code actions
LSP v3.16.0
- class lsprotocol.types.WorkspaceCodeLensRefreshResponse(id, result=None, jsonrpc='2.0')
- lsprotocol.types.WorkspaceConfigurationParams
alias of
ConfigurationParams
- class lsprotocol.types.WorkspaceConfigurationRequest(id, params, method='workspace/configuration', jsonrpc='2.0')
The ‘workspace/configuration’ request is sent from the server to the client to fetch a certain configuration setting.
This pull model replaces the old push model were the client signaled configuration change via an event. If the server still needs to react to configuration changes (since the server caches the result of
workspace/configuration
requests) the server should register for an empty configuration change event and empty the cache if such an event is received.- params: ConfigurationParams
- class lsprotocol.types.WorkspaceConfigurationResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceDiagnosticParams(previous_result_ids, identifier=None, work_done_token=None, partial_result_token=None)
Parameters of the workspace diagnostic request.
LSP v3.17.0
- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- previous_result_ids: List[PreviousResultId]
The currently known diagnostic reports with their previous result ids.
- class lsprotocol.types.WorkspaceDiagnosticRefreshRequest(id, params=None, method='workspace/diagnostic/refresh', jsonrpc='2.0')
The diagnostic refresh request definition.
LSP v3.17.0
- class lsprotocol.types.WorkspaceDiagnosticRefreshResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceDiagnosticReport(items)
A workspace diagnostic report.
LSP v3.17.0
- Parameters:
items (List[Union[WorkspaceFullDocumentDiagnosticReport, WorkspaceUnchangedDocumentDiagnosticReport]]) –
- class lsprotocol.types.WorkspaceDiagnosticReportPartialResult(items)
A partial result for a workspace diagnostic report.
LSP v3.17.0
- Parameters:
items (List[Union[WorkspaceFullDocumentDiagnosticReport, WorkspaceUnchangedDocumentDiagnosticReport]]) –
- class lsprotocol.types.WorkspaceDiagnosticRequest(id, params, method='workspace/diagnostic', jsonrpc='2.0')
The workspace diagnostic request definition.
LSP v3.17.0
- Parameters:
- params: WorkspaceDiagnosticParams
- class lsprotocol.types.WorkspaceDiagnosticResponse(id, result=None, jsonrpc='2.0')
-
- result: WorkspaceDiagnosticReport
- class lsprotocol.types.WorkspaceDidChangeConfigurationNotification(params, method='workspace/didChangeConfiguration', jsonrpc='2.0')
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.
- Parameters:
params (DidChangeConfigurationParams) –
method (str) –
jsonrpc (str) –
- params: DidChangeConfigurationParams
- class lsprotocol.types.WorkspaceDidChangeWatchedFilesNotification(params, method='workspace/didChangeWatchedFiles', jsonrpc='2.0')
The watched files notification is sent from the client to the server when the client detects changes to file watched by the language client.
- Parameters:
params (DidChangeWatchedFilesParams) –
method (str) –
jsonrpc (str) –
- params: DidChangeWatchedFilesParams
- class lsprotocol.types.WorkspaceDidChangeWorkspaceFoldersNotification(params, method='workspace/didChangeWorkspaceFolders', jsonrpc='2.0')
The
workspace/didChangeWorkspaceFolders
notification is sent from the client to the server when the workspace folder configuration changes.- Parameters:
params (DidChangeWorkspaceFoldersParams) –
method (str) –
jsonrpc (str) –
- params: DidChangeWorkspaceFoldersParams
- class lsprotocol.types.WorkspaceDidCreateFilesNotification(params, method='workspace/didCreateFiles', jsonrpc='2.0')
The did create files notification is sent from the client to the server when files were created from within the client.
LSP v3.16.0
- Parameters:
params (CreateFilesParams) –
method (str) –
jsonrpc (str) –
- params: CreateFilesParams
- class lsprotocol.types.WorkspaceDidDeleteFilesNotification(params, method='workspace/didDeleteFiles', jsonrpc='2.0')
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.
LSP v3.16.0
- Parameters:
params (DeleteFilesParams) –
method (str) –
jsonrpc (str) –
- params: DeleteFilesParams
- class lsprotocol.types.WorkspaceDidRenameFilesNotification(params, method='workspace/didRenameFiles', jsonrpc='2.0')
The did rename files notification is sent from the client to the server when files were renamed from within the client.
LSP v3.16.0
- Parameters:
params (RenameFilesParams) –
method (str) –
jsonrpc (str) –
- params: RenameFilesParams
- class lsprotocol.types.WorkspaceEdit(changes=None, document_changes=None, change_annotations=None)
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 overchanges
if the client can handle versioned document edits.Since version 3.13.0 a workspace edit can contain resource operations as well. If resource operations are present clients need to execute the operations in the order in which they are provided. So a workspace edit for example can consist of the following two changes: (1) a create file a.txt and (2) a text document edit which insert text into file a.txt.
An invalid sequence (e.g. (1) delete file a.txt and (2) insert text into file a.txt) will cause failure of the operation. How the client recovers from the failure is described by the client capability:
workspace.workspaceEdit.failureHandling
- Parameters:
document_changes (Optional[List[Union[TextDocumentEdit, CreateFile, RenameFile, DeleteFile]]]) –
change_annotations (Optional[Dict[str, ChangeAnnotation]]) –
- change_annotations: Optional[Dict[str, ChangeAnnotation]]
A map of change annotations that can be referenced in
AnnotatedTextEdit
s or create, rename and delete file / folder operations.Whether clients honor this property depends on the client capability
workspace.changeAnnotationSupport
.LSP v3.16.0
- document_changes: Optional[List[Union[TextDocumentEdit, CreateFile, RenameFile, DeleteFile]]]
Depending on the client capability
workspace.workspaceEdit.resourceOperations
document changes are either an array ofTextDocumentEdit
s to express changes to n different text documents where each text document edit addresses a specific version of a text document. Or it can contain aboveTextDocumentEdit
s mixed with create, rename and delete file / folder operations.Whether a client supports versioned document edits is expressed via
workspace.workspaceEdit.documentChanges
client capability.If a client neither supports
documentChanges
nor workspace.workspaceEdit.resourceOperations then only plainTextEdit
s using the changes property are supported.
- class lsprotocol.types.WorkspaceEditClientCapabilities(document_changes=None, resource_operations=None, failure_handling=None, normalizes_line_endings=None, change_annotation_support=None)
- Parameters:
resource_operations (Optional[List[ResourceOperationKind]]) –
failure_handling (Optional[FailureHandlingKind]) –
change_annotation_support (Optional[WorkspaceEditClientCapabilitiesChangeAnnotationSupportType]) –
- change_annotation_support: Optional[WorkspaceEditClientCapabilitiesChangeAnnotationSupportType]
Whether the client in general supports change annotations on text edits, create file, rename file and delete file changes.
LSP v3.16.0
- failure_handling: Optional[FailureHandlingKind]
The failure handling strategy of a client if applying the workspace edit fails.
LSP v3.13.0
- normalizes_line_endings: Optional[bool]
Whether the client normalizes line endings to the client specific setting. If set to
true
the client will normalize line ending characters in a workspace edit to the client-specified new line character.LSP v3.16.0
- resource_operations: Optional[List[ResourceOperationKind]]
The resource operations the client supports. Clients should at least support ‘create’, ‘rename’ and ‘delete’ files and folders.
LSP v3.13.0
- class lsprotocol.types.WorkspaceEditClientCapabilitiesChangeAnnotationSupportType(groups_on_label=None)
- class lsprotocol.types.WorkspaceExecuteCommandRequest(id, params, method='workspace/executeCommand', jsonrpc='2.0')
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.
- params: ExecuteCommandParams
- class lsprotocol.types.WorkspaceExecuteCommandResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceFolder(uri, name)
A workspace folder inside a client.
- class lsprotocol.types.WorkspaceFoldersChangeEvent(added, removed)
The workspace folder change event.
- Parameters:
added (List[WorkspaceFolder]) –
removed (List[WorkspaceFolder]) –
- added: List[WorkspaceFolder]
The array of added workspace folders
- removed: List[WorkspaceFolder]
The array of the removed workspace folders
- class lsprotocol.types.WorkspaceFoldersInitializeParams(workspace_folders=None)
- Parameters:
workspace_folders (Optional[List[WorkspaceFolder]]) –
- workspace_folders: Optional[List[WorkspaceFolder]]
The workspace folders configured in the client when the server starts.
This property is only available if the client supports workspace folders. It can be
null
if the client supports workspace folders but none are configured.LSP v3.6.0
- class lsprotocol.types.WorkspaceFoldersServerCapabilities(supported=None, change_notifications=None)
-
- change_notifications: Optional[Union[str, bool]]
Whether the server wants to receive workspace folder change notifications.
If a string is provided the string is treated as an ID under which the notification is registered on the client side. The ID can be used to unregister for these events using the
client/unregisterCapability
request.
- class lsprotocol.types.WorkspaceFoldingRangeRefreshRequest(id, params=None, method='workspace/foldingRange/refresh', jsonrpc='2.0')
LSP v3.18.0 @proposed
- class lsprotocol.types.WorkspaceFoldingRangeRefreshResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceFullDocumentDiagnosticReport(uri, items, version=None, kind='full', result_id=None)
A full document diagnostic report for a workspace diagnostic result.
LSP v3.17.0
- Parameters:
- items: List[Diagnostic]
The actual items.
- class lsprotocol.types.WorkspaceInlayHintRefreshRequest(id, params=None, method='workspace/inlayHint/refresh', jsonrpc='2.0')
LSP v3.17.0
- class lsprotocol.types.WorkspaceInlayHintRefreshResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceInlineValueRefreshRequest(id, params=None, method='workspace/inlineValue/refresh', jsonrpc='2.0')
LSP v3.17.0
- class lsprotocol.types.WorkspaceInlineValueRefreshResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceSemanticTokensRefreshRequest(id, params=None, method='workspace/semanticTokens/refresh', jsonrpc='2.0')
LSP v3.16.0
- class lsprotocol.types.WorkspaceSemanticTokensRefreshResponse(id, result=None, jsonrpc='2.0')
- class lsprotocol.types.WorkspaceSymbol(location, name, kind, data=None, tags=None, container_name=None)
A special workspace symbol that supports locations without a range.
See also SymbolInformation.
LSP v3.17.0
- Parameters:
- container_name: Optional[str]
The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can’t be used to re-infer a hierarchy for the document symbols.
- data: Optional[Any]
A data entry field that is preserved on a workspace symbol between a workspace symbol request and a workspace symbol resolve request.
- kind: SymbolKind
The kind of this symbol.
- location: Union[Location, WorkspaceSymbolLocationType1]
The location of the symbol. Whether a server is allowed to return a location without a range depends on the client capability
workspace.symbol.resolveSupport
.See SymbolInformation#location for more details.
- class lsprotocol.types.WorkspaceSymbolClientCapabilities(dynamic_registration=None, symbol_kind=None, tag_support=None, resolve_support=None)
Client capabilities for a
WorkspaceSymbolRequest
.- Parameters:
symbol_kind (Optional[WorkspaceSymbolClientCapabilitiesSymbolKindType]) –
tag_support (Optional[WorkspaceSymbolClientCapabilitiesTagSupportType]) –
resolve_support (Optional[WorkspaceSymbolClientCapabilitiesResolveSupportType]) –
- resolve_support: Optional[WorkspaceSymbolClientCapabilitiesResolveSupportType]
The client support partial workspace symbols. The client will send the request
workspaceSymbol/resolve
to the server to resolve additional properties.LSP v3.17.0
- symbol_kind: Optional[WorkspaceSymbolClientCapabilitiesSymbolKindType]
Specific capabilities for the
SymbolKind
in the workspace/symbol request.
- tag_support: Optional[WorkspaceSymbolClientCapabilitiesTagSupportType]
The client supports tags on
SymbolInformation
. Clients supporting tags have to handle unknown tags gracefully.LSP v3.16.0
- class lsprotocol.types.WorkspaceSymbolClientCapabilitiesResolveSupportType(properties)
- class lsprotocol.types.WorkspaceSymbolClientCapabilitiesSymbolKindType(value_set=None)
- Parameters:
value_set (Optional[List[SymbolKind]]) –
- value_set: Optional[List[SymbolKind]]
The symbol kind values the client supports. When this property exists the client also guarantees that it will handle values outside its set gracefully and falls back to a default value when unknown.
If this property is not present the client only supports the symbol kinds from
File
to Array as defined in the initial version of the protocol.
- class lsprotocol.types.WorkspaceSymbolClientCapabilitiesTagSupportType(value_set)
- class lsprotocol.types.WorkspaceSymbolOptions(resolve_provider=None, work_done_progress=None)
Server capabilities for a
WorkspaceSymbolRequest
.
- class lsprotocol.types.WorkspaceSymbolParams(query, work_done_token=None, partial_result_token=None)
The parameters of a
WorkspaceSymbolRequest
.- Parameters:
- partial_result_token: Optional[Union[int, str]]
An optional token that a server can use to report partial results (e.g. streaming) to the client.
- class lsprotocol.types.WorkspaceSymbolRegistrationOptions(resolve_provider=None, work_done_progress=None)
Registration options for a
WorkspaceSymbolRequest
.
- class lsprotocol.types.WorkspaceSymbolRequest(id, params, method='workspace/symbol', jsonrpc='2.0')
A request to list project-wide symbols matching the query string given by the
WorkspaceSymbolParams
. The response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- LSP v3.17.0 - support for WorkspaceSymbol in the returned data. Clients
need to advertise support for WorkspaceSymbols via the client capability
workspace.symbol.resolveSupport
.
- params: WorkspaceSymbolParams
- class lsprotocol.types.WorkspaceSymbolResolveRequest(id, params, method='workspaceSymbol/resolve', jsonrpc='2.0')
A request to resolve the range inside the workspace symbol’s location.
LSP v3.17.0
- params: WorkspaceSymbol
- class lsprotocol.types.WorkspaceSymbolResolveResponse(id, result=None, jsonrpc='2.0')
-
- result: WorkspaceSymbol
- class lsprotocol.types.WorkspaceSymbolResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[Union[List[SymbolInformation], List[WorkspaceSymbol]]]
- class lsprotocol.types.WorkspaceUnchangedDocumentDiagnosticReport(uri, result_id, version=None, kind='unchanged')
An unchanged document diagnostic report for a workspace diagnostic result.
LSP v3.17.0
- kind: str
A document diagnostic report indicating no changes to the last result. A server can only return
unchanged
if result ids are provided.
- class lsprotocol.types.WorkspaceWillCreateFilesRequest(id, params, method='workspace/willCreateFiles', jsonrpc='2.0')
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 theWorkspaceEdit
can not manipulate the content of the file to be created.LSP v3.16.0
- params: CreateFilesParams
- class lsprotocol.types.WorkspaceWillCreateFilesResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[WorkspaceEdit]
- class lsprotocol.types.WorkspaceWillDeleteFilesRequest(id, params, method='workspace/willDeleteFiles', jsonrpc='2.0')
The did delete files notification is sent from the client to the server when files were deleted from within the client.
LSP v3.16.0
- params: DeleteFilesParams
- class lsprotocol.types.WorkspaceWillDeleteFilesResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[WorkspaceEdit]
- class lsprotocol.types.WorkspaceWillRenameFilesRequest(id, params, method='workspace/willRenameFiles', jsonrpc='2.0')
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.
LSP v3.16.0
- params: RenameFilesParams
- class lsprotocol.types.WorkspaceWillRenameFilesResponse(id, result=None, jsonrpc='2.0')
-
- result: Optional[WorkspaceEdit]
- class lsprotocol.types.WorkspaceWorkspaceFoldersRequest(id, params=None, method='workspace/workspaceFolders', jsonrpc='2.0')
The
workspace/workspaceFolders
is sent from the server to the client to fetch the open workspace folders.
- class lsprotocol.types.WorkspaceWorkspaceFoldersResponse(id, result=None, jsonrpc='2.0')
- Parameters:
- result: Optional[List[WorkspaceFolder]]
- lsprotocol.types.is_keyword_class(cls)
Returns true if the class has a property that may be python keyword.
- lsprotocol.types.is_special_class(cls)
Returns true if the class or its properties require special handling.
- lsprotocol.types.is_special_property(cls, property_name)
Returns true if the class or its properties require special handling. .. rubric:: Example
- Consider RenameRegistrationOptions
- document_selector property:
When you set
document_selector
to None in python it has to be preserved when serializing it. Since the serialized JSON value{"document_selector": null}
means use the Clients document selector. Omitting it might throw error.
- prepare_provider property
This property does NOT need special handling, since omitting it or using
{"prepare_provider": null}
in JSON has the same meaning.
- lsprotocol.types.message_direction(method)
Returns message direction clientToServer, serverToClient or both.
- lsprotocol.types.Declaration
The declaration of a symbol representation as one or many
Location locations
.
- lsprotocol.types.DeclarationLink = ForwardRef('LocationLink')
Information about where a symbol is declared.
Provides additional metadata over normal
Location location
declarations, including the range of the declaring symbol.Servers should prefer returning
DeclarationLink
over Declaration if supported by the client.
- lsprotocol.types.Definition
The definition of a symbol represented as one or many
Location locations
. For most programming languages there is only one location at which a symbol is defined.Servers should prefer returning
DefinitionLink
over Definition if supported by the client.
- lsprotocol.types.DefinitionLink = ForwardRef('LocationLink')
Information about where a symbol is defined.
Provides additional metadata over normal
Location location
definitions, including the range of the defining symbol
- lsprotocol.types.DocumentDiagnosticReport
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.
LSP v3.17.0
alias of
Union
[RelatedFullDocumentDiagnosticReport
,RelatedUnchangedDocumentDiagnosticReport
]
- lsprotocol.types.DocumentFilter
A document filter describes a top level text document or a notebook cell document.
LSP v3.17.0 - proposed support for NotebookCellTextDocumentFilter.
alias of
Union
[TextDocumentFilter
,NotebookCellTextDocumentFilter
]
- lsprotocol.types.DocumentSelector
A document selector is the combination of one or many document filters.
@sample
let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**/tsconfig.json' }]
;The use of a string as a document filter is deprecated LSP v3.16.0.
alias of
List
[DocumentFilter
]
- lsprotocol.types.GlobPattern
The glob pattern. Either a string pattern or a relative pattern.
LSP v3.17.0
alias of
Union
[Pattern
,RelativePattern
]
- lsprotocol.types.InlineValue
Inline value information can be provided by different means:
directly as a text value (class InlineValueText).
as a name to use for a variable lookup (class InlineValueVariableLookup)
as an evaluatable expression (class InlineValueEvaluatableExpression)
The InlineValue types combines all inline value types into one type.
LSP v3.17.0
alias of
Union
[InlineValueText
,InlineValueVariableLookup
,InlineValueEvaluatableExpression
]
- lsprotocol.types.LSPAny
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. LSP v3.17.0
- lsprotocol.types.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. See https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
The pair of a language and a value is an equivalent to markdown:
${value}
Note that markdown strings will be sanitized - that means html will be escaped. @deprecated use MarkupContent instead.
alias of
Union
[str
,MarkedString_Type1
]
- lsprotocol.types.NotebookDocumentFilter
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)
LSP v3.17.0
alias of
Union
[NotebookDocumentFilter_Type1
,NotebookDocumentFilter_Type2
,NotebookDocumentFilter_Type3
]
- lsprotocol.types.TextDocumentContentChangeEvent
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.
alias of
Union
[TextDocumentContentChangeEvent_Type1
,TextDocumentContentChangeEvent_Type2
]
- lsprotocol.types.TextDocumentFilter
A document filter denotes a document by different properties like the
languageId language
, the {@link Uri.scheme scheme} of its resource, or a glob-pattern that is applied to thefileName path
.Glob patterns can have the following syntax:
*
to match one or more characters in a path segment?
to match on one character in a path segment**
to match any number of path segments, including none{}
to group sub patterns into an OR expression. (e.g. **/*.{ts,js} matches all TypeScript and JavaScript files)[]
to declare a range of characters to match in a path segment (e.g., example.[0-9] to match on example.0, example.1, …)[!...]
to negate a range of characters to match in a path segment (e.g., example.[!0-9] to match on example.a, example.b, but not example.0)
@sample A language filter that applies to typescript files on disk:
{ language: 'typescript', scheme: 'file' }
@sample A language filter that applies to all package.json paths:{ language: 'json', pattern: '**package.json' }
LSP v3.17.0
alias of
Union
[TextDocumentFilter_Type1
,TextDocumentFilter_Type2
,TextDocumentFilter_Type3
]
- lsprotocol.types.WorkspaceDocumentDiagnosticReport
A workspace diagnostic document report.
LSP v3.17.0
alias of
Union
[WorkspaceFullDocumentDiagnosticReport
,WorkspaceUnchangedDocumentDiagnosticReport
]