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.

Parameters:
  • annotation_id (str) –

  • range (Range) –

  • new_text (str) –

annotation_id: str

The actual identifier of the change annotation

new_text: str

The string to be inserted. For delete operations use an empty string.

range: Range

The range of the text document to be manipulated. To insert text into a document create a range where start === end.

class lsprotocol.types.ApplyWorkspaceEditParams(edit, label=None)

The parameters passed via an apply workspace edit request.

Parameters:
edit: WorkspaceEdit

The edits to apply.

label: Optional[str]

An optional label of the workspace edit. This label is presented in the user interface for example on an undo stack to undo the workspace edit.

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

Parameters:
applied: bool

Indicates whether the edit was applied or not.

failed_change: Optional[int]

Depending on the client’s failure handling strategy failedChange might contain the index of the change that failed. This property is only available if the client signals a failureHandlingStrategy in its client capabilities.

failure_reason: Optional[str]

An optional textual description for why the edit was not applied. This may be used by the server for diagnostic logging or to provide a suitable error for a request that triggered the edit.

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.

name: str

The name of this symbol.

tags: Optional[List[SymbolTag]]

Tags for this symbol.

LSP v3.16.0

class lsprotocol.types.CallHierarchyClientCapabilities(dynamic_registration=None)

LSP v3.16.0

Parameters:

dynamic_registration (Optional[bool]) –

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.

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

The item that makes the call.

from_ranges: List[Range]

The ranges at which the calls appear. This is relative to the caller denoted by {@link CallHierarchyIncomingCall.from this.from }.

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

work_done_token: Optional[Union[int, str]]

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

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CallHierarchyIncomingCallsParams
class lsprotocol.types.CallHierarchyIncomingCallsResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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.

detail: Optional[str]

More detail for this item, e.g. the signature of a function.

kind: SymbolKind

The kind of this item.

name: str

The name of this item.

range: Range

The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.

selection_range: Range

The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the {@link CallHierarchyItem.range range }.

tags: Optional[List[SymbolTag]]

Tags for this item.

uri: str

The resource identifier of this item.

class lsprotocol.types.CallHierarchyOptions(work_done_progress=None)

Call hierarchy options used during static registration.

LSP v3.16.0

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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:
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.to this.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
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.

work_done_token: Optional[Union[int, str]]

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

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CallHierarchyOutgoingCallsParams
class lsprotocol.types.CallHierarchyOutgoingCallsResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.CancelParams(id)
Parameters:

id (Union[int, str]) –

id: Union[int, str]

The request id to cancel.

class lsprotocol.types.CancelRequestNotification(params, method='$/cancelRequest', jsonrpc='2.0')
Parameters:
jsonrpc: str
method: str

The method to be invoked.

params: CancelParams
class lsprotocol.types.ChangeAnnotation(label, needs_confirmation=None, description=None)

Additional information that describes document changes.

LSP v3.16.0

Parameters:
description: Optional[str]

A human-readable string which is rendered less prominent in the user interface.

label: str

A human-readable string describing the actual change. The string is rendered prominent in the user interface.

needs_confirmation: Optional[bool]

A flag which indicates that user confirmation is needed before applying the change.

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:
experimental: Optional[Any]

Experimental client capabilities.

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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: RegistrationParams
class lsprotocol.types.ClientRegisterCapabilityResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: UnregistrationParams
class lsprotocol.types.ClientUnregisterCapabilityResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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:
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.

title: str

A short, human-readable, title for this code action.

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]

The client support code action literals of type CodeAction as a valid response of the textDocument/codeAction request. If the property is not set the request can only return Command literals.

LSP v3.8.0

data_support: Optional[bool]

Whether code action supports the data property which is preserved between a textDocument/codeAction and a codeAction/resolve request.

LSP v3.16.0

disabled_support: Optional[bool]

Whether code action supports the disabled property.

LSP v3.16.0

dynamic_registration: Optional[bool]

Whether code action supports dynamic registration.

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)
Parameters:

properties (List[str]) –

properties: List[str]

The properties that a client can resolve lazily.

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]

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.CodeActionDisabledType(reason)
Parameters:

reason (str) –

reason: str

Human readable description of why the code action is currently disabled.

This is displayed in the code actions UI.

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.

resolve_provider: Optional[bool]

The server provides support to resolve additional information for a code action.

LSP v3.16.0

work_done_progress: Optional[bool]
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.

range: Range

The range for which the command was invoked.

text_document: TextDocumentIdentifier

The document in which the command was invoked.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.CodeActionRegistrationOptions(document_selector=None, code_action_kinds=None, resolve_provider=None, work_done_progress=None)

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

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 code action.

LSP v3.16.0

work_done_progress: Optional[bool]
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 type CodeAction or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CodeAction
class lsprotocol.types.CodeActionResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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) –

href: str

An URI to open with more information about the diagnostic error.

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.

Parameters:
command: Optional[Command]

The command this code lens represents.

data: Optional[Any]

A data entry field that is preserved on a code lens item between a CodeLensRequest and a {@link CodeLensResolveRequest}

range: Range

The range in which this code lens is valid. Should only span a single line.

class lsprotocol.types.CodeLensClientCapabilities(dynamic_registration=None)

The client capabilities of a CodeLensRequest.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether code lens supports dynamic registration.

class lsprotocol.types.CodeLensOptions(resolve_provider=None, work_done_progress=None)

Code Lens provider options of a CodeLensRequest.

Parameters:
resolve_provider: Optional[bool]

Code lens has a resolve provider as well.

work_done_progress: Optional[bool]
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.

work_done_token: Optional[Union[int, str]]

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

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]]]

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]

Code lens has a resolve provider as well.

work_done_progress: Optional[bool]
class lsprotocol.types.CodeLensResolveRequest(id, params, method='codeLens/resolve', jsonrpc='2.0')

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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CodeLens
class lsprotocol.types.CodeLensResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: CodeLens
class lsprotocol.types.CodeLensWorkspaceClientCapabilities(refresh_support=None)

LSP v3.16.0

Parameters:

refresh_support (Optional[bool]) –

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.

Parameters:
alpha: float

The alpha component of this color in the range [0-1].

blue: float

The blue component of this color in the range [0-1].

green: float

The green component of this color in the range [0-1].

red: float

The red component of this color in the range [0-1].

class lsprotocol.types.ColorInformation(range, color)

Represents a color range from a document.

Parameters:
color: Color

The actual color value for this color range.

range: Range

The range in the document where this color appears.

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 main textEdit edit nor with themselves.

label: str

The label of this color presentation. It will be shown on the color picker header. By default this is also the text that is inserted when selecting this color presentation.

text_edit: Optional[TextEdit]

An TextEdit edit which is applied to a document when selecting this presentation for the color. When falsy the {@link ColorPresentation.label label} is used.

class lsprotocol.types.ColorPresentationParams(text_document, color, range, work_done_token=None, partial_result_token=None)

Parameters for a ColorPresentationRequest.

Parameters:
color: Color

The color to request presentations for.

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.

range: Range

The range where the color would be inserted. Serves as a context.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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.

Parameters:
arguments: Optional[List[Optional[Any]]]

Arguments that the command handler should be invoked with.

command: str

The identifier of the actual command handler.

title: str

Title of the command, like save .

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]

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.

dynamic_registration: Optional[bool]

Whether completion supports dynamic registration.

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:
commit_characters_support: Optional[bool]

Client supports commit characters on a completion item.

deprecated_support: Optional[bool]

Client supports the deprecated property on a completion item.

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 (see insertTextMode ).

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

preselect_support: Optional[bool]

Client supports the preselect property on a completion item.

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 and details 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)
Parameters:

properties (List[str]) –

properties: List[str]

The properties that a client can resolve lazily.

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)
Parameters:

item_defaults (Optional[List[str]]) –

item_defaults: Optional[List[str]]

The client supports the following itemDefaults on a completion list.

The value lists the supported property names of the CompletionList.itemDefaults object. If omitted no properties are supported.

LSP v3.17.0

class lsprotocol.types.CompletionContext(trigger_kind, trigger_character=None)

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

Parameters:
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:
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 main textEdit 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 the additionalTextEdits 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}.

deprecated: Optional[bool]

Indicates if this item is deprecated. @deprecated Use tags instead.

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 example con<cursor position> and a completion item with an insertText of console is provided it will only insert sole. Therefore it is recommended to use textEdit 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 provided textEdit . 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 of insertText 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 the textDocument.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

Parameters:
description: Optional[str]

An optional string which is rendered less prominently after detail. Should be used for fully qualified names and file paths.

detail: Optional[str]

An optional string which is rendered less prominently directly after label label, without any spacing. Should be used for function signatures and type annotations.

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 type CompletionItem or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CompletionItem
class lsprotocol.types.CompletionItemResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

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:
commit_characters: Optional[List[str]]

A default commit character set.

LSP v3.17.0

data: Optional[Any]

A default data value.

LSP v3.17.0

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)
Parameters:
insert: Range
replace: Range
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 present console 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.

work_done_progress: Optional[bool]
class lsprotocol.types.CompletionOptionsCompletionItemType(label_details_support=None)
Parameters:

label_details_support (Optional[bool]) –

label_details_support: Optional[bool]

The server has support for completion item label details (see also CompletionItemLabelDetails ) when receiving a completion item in a resolve call.

LSP v3.17.0

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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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:
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 present console 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.

work_done_progress: Optional[bool]
class lsprotocol.types.CompletionRegistrationOptionsCompletionItemType(label_details_support=None)
Parameters:

label_details_support (Optional[bool]) –

label_details_support: Optional[bool]

The server has support for completion item label details (see also CompletionItemLabelDetails ) when receiving a completion item in a resolve call.

LSP v3.17.0

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)
Parameters:
scope_uri: Optional[str]

The scope to get the configuration section for.

section: Optional[str]

The configuration section asked for.

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

kind: str

A create

options: Optional[CreateFileOptions]

Additional options

uri: str

The resource to create.

class lsprotocol.types.CreateFileOptions(overwrite=None, ignore_if_exists=None)

Options to create a file.

Parameters:
ignore_if_exists: Optional[bool]

Ignore if exists.

overwrite: Optional[bool]

Overwrite existing file. Overwrite wins over ignoreIfExists

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

Parameters:
dynamic_registration: Optional[bool]

Whether declaration supports dynamic registration. If this is set to true the client supports the new DeclarationRegistrationOptions return value for the corresponding server capability as well.

The client supports additional metadata in the form of declaration links.

class lsprotocol.types.DeclarationOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.DefinitionClientCapabilities(dynamic_registration=None, link_support=None)

Client Capabilities for a DefinitionRequest.

Parameters:
dynamic_registration: Optional[bool]

Whether definition supports dynamic registration.

The client supports additional metadata in the form of definition links.

LSP v3.14.0

class lsprotocol.types.DefinitionOptions(work_done_progress=None)

Server Capabilities for a DefinitionRequest.

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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

kind: str

A delete

options: Optional[DeleteFileOptions]

Delete options.

uri: str

The file to delete.

class lsprotocol.types.DeleteFileOptions(recursive=None, ignore_if_not_exists=None)

Delete file options

Parameters:
ignore_if_not_exists: Optional[bool]

Ignore the operation if the file doesn’t exist.

recursive: Optional[bool]

Delete the content recursively if a folder is denoted.

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:
code: Optional[Union[int, str]]

The diagnostic’s code, which usually appear in the user interface.

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 and textDocument/codeAction request.

LSP v3.16.0

message: str

The diagnostic’s message. It usually appears in the user interface

range: Range

The range at which the message applies

related_information: Optional[List[DiagnosticRelatedInformation]]

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

Parameters:
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.

related_document_support: Optional[bool]

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.

inter_file_dependencies: bool

Whether the language has inter file dependencies meaning that editing code in one file can result in a different diagnostic set in another file. Inter file dependencies are common for most programming languages and typically uncommon for linters.

work_done_progress: Optional[bool]
workspace_diagnostics: bool

The server provides support for workspace diagnostics as well.

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

inter_file_dependencies: bool

Whether the language has inter file dependencies meaning that editing code in one file can result in a different diagnostic set in another file. Inter file dependencies are common for most programming languages and typically uncommon for linters.

work_done_progress: Optional[bool]
workspace_diagnostics: bool

The server provides support for workspace diagnostics as well.

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.

Parameters:
location: Location

The location of this related diagnostic information.

message: str

The message of this related diagnostic information.

class lsprotocol.types.DiagnosticServerCancellationData(retrigger_request)

Cancellation data returned from a diagnostic request.

LSP v3.17.0

Parameters:

retrigger_request (bool) –

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

Parameters:

refresh_support (Optional[bool]) –

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)
Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Did change configuration notification supports dynamic registration.

class lsprotocol.types.DidChangeConfigurationParams(settings)

The parameters of a change configuration notification.

Parameters:

settings (Optional[Any]) –

settings: Optional[Any]

The actual changed settings

class lsprotocol.types.DidChangeConfigurationRegistrationOptions(section=None)
Parameters:

section (Optional[Union[str, List[str]]]) –

section: Optional[Union[str, List[str]]]
class lsprotocol.types.DidChangeNotebookDocumentParams(notebook_document, change)

The params sent in a change notebook document notification.

LSP v3.17.0

Parameters:
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:
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)
Parameters:
dynamic_registration: Optional[bool]

Did change watched files notification supports dynamic registration. Please note that the current protocol doesn’t support static configuration for file changes from the server side.

relative_pattern_support: Optional[bool]

Whether the client has support for RelativePattern relative pattern or not.

LSP v3.17.0

class lsprotocol.types.DidChangeWatchedFilesParams(changes)

The watched files change notification’s parameters.

Parameters:

changes (List[FileEvent]) –

changes: List[FileEvent]

The actual file events.

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:
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:
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: 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)
Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration. If this is set to true the client supports the new DocumentColorRegistrationOptions return value for the corresponding server capability as well.

class lsprotocol.types.DocumentColorOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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:
identifier: Optional[str]

The additional identifier provided during registration.

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: Optional[str]

The result id of a previous response if provided.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]) –

related_documents: Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]
class lsprotocol.types.DocumentFormattingClientCapabilities(dynamic_registration=None)

Client capabilities of a DocumentFormattingRequest.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether formatting supports dynamic registration.

class lsprotocol.types.DocumentFormattingOptions(work_done_progress=None)

Provider options for a DocumentFormattingRequest.

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
class lsprotocol.types.DocumentFormattingParams(text_document, options, work_done_token=None)

The parameters of a DocumentFormattingRequest.

Parameters:
options: FormattingOptions

The format options.

text_document: TextDocumentIdentifier

The document to format.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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:
kind: Optional[DocumentHighlightKind]

The highlight kind, default is Text text.

range: Range

The range this highlight applies to.

class lsprotocol.types.DocumentHighlightClientCapabilities(dynamic_registration=None)

Client Capabilities for a DocumentHighlightRequest.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether document highlight supports dynamic registration.

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.

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]

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.

range: Range

The range this link applies to.

target: Optional[str]

The uri this link points to. If missing a resolve request is sent later.

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.

Parameters:
dynamic_registration: Optional[bool]

Whether document link supports dynamic registration.

tooltip_support: Optional[bool]

Whether the client supports the tooltip property on DocumentLink.

LSP v3.15.0

class lsprotocol.types.DocumentLinkOptions(resolve_provider=None, work_done_progress=None)

Provider options for a DocumentLinkRequest.

Parameters:
resolve_provider: Optional[bool]

Document links have a resolve provider as well.

work_done_progress: Optional[bool]
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.

work_done_token: Optional[Union[int, str]]

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

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]]]

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]

Document links have a resolve provider as well.

work_done_progress: Optional[bool]
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 type DocumentLink or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentLink
class lsprotocol.types.DocumentLinkResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: DocumentLink
class lsprotocol.types.DocumentOnTypeFormattingClientCapabilities(dynamic_registration=None)

Client capabilities of a DocumentOnTypeFormattingRequest.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether on type formatting supports dynamic registration.

class lsprotocol.types.DocumentOnTypeFormattingOptions(first_trigger_character, more_trigger_character=None)

Provider options for a DocumentOnTypeFormattingRequest.

Parameters:
first_trigger_character: str

A character on which formatting should be triggered, like { .

more_trigger_character: Optional[List[str]]

More trigger characters.

class lsprotocol.types.DocumentOnTypeFormattingParams(text_document, position, ch, options)

The parameters of a DocumentOnTypeFormattingRequest.

Parameters:
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:
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.

first_trigger_character: str

A character on which formatting should be triggered, like { .

more_trigger_character: Optional[List[str]]

More trigger characters.

class lsprotocol.types.DocumentRangeFormattingClientCapabilities(dynamic_registration=None, ranges_support=None)

Client capabilities of a DocumentRangeFormattingRequest.

Parameters:
dynamic_registration: Optional[bool]

Whether range formatting supports dynamic registration.

ranges_support: Optional[bool]

Whether the client supports formatting multiple ranges at once.

LSP v3.18.0 @proposed

class lsprotocol.types.DocumentRangeFormattingOptions(ranges_support=None, work_done_progress=None)

Provider options for a DocumentRangeFormattingRequest.

Parameters:
ranges_support: Optional[bool]

Whether the server supports formatting multiple ranges at once.

LSP v3.18.0 @proposed

work_done_progress: Optional[bool]
class lsprotocol.types.DocumentRangeFormattingParams(text_document, range, options, work_done_token=None)

The parameters of a DocumentRangeFormattingRequest.

Parameters:
options: FormattingOptions

The format options

range: Range

The range to format

text_document: TextDocumentIdentifier

The document to format.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

ranges_support: Optional[bool]

Whether the server supports formatting multiple ranges at once.

LSP v3.18.0 @proposed

work_done_progress: Optional[bool]
class lsprotocol.types.DocumentRangesFormattingParams(text_document, ranges, options, work_done_token=None)

The parameters of a DocumentRangesFormattingRequest.

LSP v3.18.0 @proposed

Parameters:
options: FormattingOptions

The format options

ranges: List[Range]

The ranges to format

text_document: TextDocumentIdentifier

The document to format.

work_done_token: Optional[Union[int, str]]

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

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.

deprecated: Optional[bool]

Indicates if this symbol is deprecated.

@deprecated Use tags instead

detail: Optional[str]

More detail for this symbol, e.g the signature of a function.

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.

selection_range: Range

The range that should be selected and revealed when this symbol is being picked, e.g the name of a function. Must be contained by the range .

tags: Optional[List[SymbolTag]]

Tags for this document symbol.

LSP v3.16.0

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:
dynamic_registration: Optional[bool]

Whether document symbol supports dynamic registration.

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 the textDocument/documentSymbol request.

tag_support: Optional[DocumentSymbolClientCapabilitiesTagSupportType]

The client supports tags on SymbolInformation . Tags are supported on DocumentSymbol 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)
Parameters:

value_set (List[SymbolTag]) –

value_set: List[SymbolTag]

The tags supported by the client.

class lsprotocol.types.DocumentSymbolOptions(label=None, work_done_progress=None)

Provider options for a DocumentSymbolRequest.

Parameters:
label: Optional[str]

A human-readable string that is shown when multiple outlines trees are shown for the same document.

LSP v3.16.0

work_done_progress: Optional[bool]
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.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

label: Optional[str]

A human-readable string that is shown when multiple outlines trees are shown for the same document.

LSP v3.16.0

work_done_progress: Optional[bool]
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.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Execute command supports dynamic registration.

class lsprotocol.types.ExecuteCommandOptions(commands, work_done_progress=None)

The server capabilities of a ExecuteCommandRequest.

Parameters:
commands: List[str]

The commands to be executed on the server

work_done_progress: Optional[bool]
class lsprotocol.types.ExecuteCommandParams(command, arguments=None, work_done_token=None)

The parameters of a ExecuteCommandRequest.

Parameters:
arguments: Optional[List[Optional[Any]]]

Arguments that the command should be invoked with.

command: str

The identifier of the actual command handler.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.ExecuteCommandRegistrationOptions(commands, work_done_progress=None)

Registration options for a ExecuteCommandRequest.

Parameters:
commands: List[str]

The commands to be executed on the server

work_done_progress: Optional[bool]
class lsprotocol.types.ExecutionSummary(execution_order, success=None)
Parameters:
execution_order: int

A strict monotonically increasing value indicating the execution order of a cell inside a notebook.

success: Optional[bool]

Whether the execution was successful or not if known by the client.

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.

Parameters:
  • params (None) –

  • method (str) –

  • jsonrpc (str) –

jsonrpc: str
method: str

The method to be invoked.

params: None
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) –

uri: str

// URI for the location of the file/folder being created.

Type:

A file

class lsprotocol.types.FileDelete(uri)

Represents information on a file/folder delete.

LSP v3.16.0

Parameters:

uri (str) –

uri: str

// URI for the location of the file/folder being deleted.

Type:

A file

class lsprotocol.types.FileEvent(uri, type)

An event describing a file change.

Parameters:
type: FileChangeType

The change type.

uri: str

The file’s uri.

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:
did_create: Optional[bool]

The client has support for sending didCreateFiles notifications.

did_delete: Optional[bool]

The client has support for sending didDeleteFiles notifications.

did_rename: Optional[bool]

The client has support for sending didRenameFiles notifications.

dynamic_registration: Optional[bool]

Whether the client supports dynamic registration for file requests/notifications.

will_create: Optional[bool]

The client has support for sending willCreateFiles requests.

will_delete: Optional[bool]

The client has support for sending willDeleteFiles requests.

will_rename: Optional[bool]

The client has support for sending willRenameFiles requests.

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

The actual file operation pattern.

scheme: Optional[str]

A Uri scheme like file or untitled.

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]

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

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

Parameters:

ignore_case (Optional[bool]) –

ignore_case: Optional[bool]

The pattern should be matched ignoring casing.

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

Parameters:
  • old_uri (str) –

  • new_uri (str) –

new_uri: str

// URI for the new location of the file/folder being renamed.

Type:

A file

old_uri: str

// URI for the original location of the file/folder being renamed.

Type:

A file

class lsprotocol.types.FileSystemWatcher(glob_pattern, kind=None)
Parameters:
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.

kind: Optional[Union[WatchKind, int]]

The kind of events of interest. If omitted it defaults to WatchKind.Create | WatchKind.Change | WatchKind.Delete which is 7.

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.

start_character: Optional[int]

The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.

start_line: int

The zero-based start line of the range to fold. The folded area starts after 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.

class lsprotocol.types.FoldingRangeClientCapabilities(dynamic_registration=None, range_limit=None, line_folding_only=None, folding_range_kind=None, folding_range=None)
Parameters:
dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration for folding range providers. If this is set to true the client supports the new FoldingRangeRegistrationOptions 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

line_folding_only: Optional[bool]

If set, the client signals that it only supports folding complete lines. If set, client will ignore specified startCharacter and endCharacter properties in a FoldingRange.

range_limit: Optional[int]

The maximum number of folding ranges that the client prefers to receive per document. The value serves as a hint, servers are free to follow the limit.

class lsprotocol.types.FoldingRangeClientCapabilitiesFoldingRangeKindType(value_set=None)
Parameters:

value_set (Optional[List[Union[FoldingRangeKind, str]]]) –

value_set: Optional[List[Union[FoldingRangeKind, str]]]

The folding range 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.FoldingRangeClientCapabilitiesFoldingRangeType(collapsed_text=None)
Parameters:

collapsed_text (Optional[bool]) –

collapsed_text: Optional[bool]

If set, the client signals that it supports setting collapsedText on folding ranges to display custom labels instead of the default text.

LSP v3.17.0

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)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.FoldingRangeWorkspaceClientCapabilities(refresh_support=None)

Client workspace capabilities specific to folding ranges

LSP v3.18.0 @proposed

Parameters:

refresh_support (Optional[bool]) –

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

insert_spaces: bool

Prefer spaces over tabs.

tab_size: int

Size of a tab in spaces.

trim_final_newlines: Optional[bool]

Trim all newlines after the final newline at the end of the file.

LSP v3.15.0

trim_trailing_whitespace: Optional[bool]

Trim trailing whitespace on a line.

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]

The actual items.

kind: str

A full document diagnostic report.

result_id: Optional[str]

An optional result id. If provided it will be sent on the next diagnostic request for the same document.

class lsprotocol.types.GeneralClientCapabilities(stale_request_support=None, regular_expressions=None, markdown=None, position_encodings=None)

General client capabilities.

LSP v3.16.0

Parameters:
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)
Parameters:
  • cancel (bool) –

  • retry_on_content_modified (List[str]) –

cancel: bool

The client will actively cancel the request.

retry_on_content_modified: List[str]

The list of requests for which the client will retry the request if it receives a response with error code ContentModified

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]]]

The hover’s content

range: Optional[Range]

An optional range inside the text document that is used to visualize the hover, e.g. by changing the background color.

class lsprotocol.types.HoverClientCapabilities(dynamic_registration=None, content_format=None)
Parameters:
content_format: Optional[List[MarkupKind]]

Client supports the following content formats for the content property. The order describes the preferred format of the client.

dynamic_registration: Optional[bool]

Whether hover supports dynamic registration.

class lsprotocol.types.HoverOptions(work_done_progress=None)

Hover options.

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
class lsprotocol.types.HoverParams(text_document, position, work_done_token=None)

Parameters for a HoverRequest.

Parameters:
position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.ImplementationClientCapabilities(dynamic_registration=None, link_support=None)

LSP v3.6.0

Parameters:
dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration. If this is set to true the client supports the new ImplementationRegistrationOptions return value for the corresponding server capability as well.

The client supports additional metadata in the form of definition links.

LSP v3.14.0

class lsprotocol.types.ImplementationOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.InitializeError(retry)

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

Parameters:

retry (bool) –

retry: bool

Indicates whether the client execute the following retry logic: (1) show the message provided by the ResponseError to the user (2) user selects retry or cancel (3) if user selected retry the initialize method is sent again.

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

The capabilities provided by the client (editor or tool)

client_info: Optional[InitializeParamsClientInfoType]

Information about the client

LSP v3.15.0

initialization_options: Optional[Any]

User provided initialization options.

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 set rootUri 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)
Parameters:
name: str

The name of the client as defined by the client.

version: Optional[str]

The client’s version as defined by the client.

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 type InitializeResult of a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: InitializeParams
class lsprotocol.types.InitializeResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: InitializeResult
class lsprotocol.types.InitializeResult(capabilities, server_info=None)

The result returned from an initialize request.

Parameters:
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)
Parameters:
name: str

The name of the server as defined by the server.

version: Optional[str]

The server’s version as defined by the server.

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:
jsonrpc: str
method: str

The method to be invoked.

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.

position: Position

The position of this 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:
dynamic_registration: Optional[bool]

Whether inlay hints support dynamic registration.

resolve_support: Optional[InlayHintClientCapabilitiesResolveSupportType]

Indicates which properties a client can resolve lazily on an inlay hint.

class lsprotocol.types.InlayHintClientCapabilitiesResolveSupportType(properties)
Parameters:

properties (List[str]) –

properties: List[str]

The properties that a client can resolve lazily.

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.

value: str

The value of this label part.

class lsprotocol.types.InlayHintOptions(resolve_provider=None, work_done_progress=None)

Inlay hint options used during static registration.

LSP v3.17.0

Parameters:
resolve_provider: Optional[bool]

The server provides support to resolve additional information for an inlay hint item.

work_done_progress: Optional[bool]
class lsprotocol.types.InlayHintParams(text_document, range, work_done_token=None)

A parameter literal used in inlay hint requests.

LSP v3.17.0

Parameters:
range: Range

The document range for which inlay hints should be computed.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

resolve_provider: Optional[bool]

The server provides support to resolve additional information for an inlay hint item.

work_done_progress: Optional[bool]
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 type InlayHint or a Thenable that resolves to such.

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: InlayHint
class lsprotocol.types.InlayHintResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: InlayHint
class lsprotocol.types.InlayHintWorkspaceClientCapabilities(refresh_support=None)

Client workspace capabilities specific to inlay hints.

LSP v3.17.0

Parameters:

refresh_support (Optional[bool]) –

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

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration for inline completion providers.

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:
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:
command: Optional[Command]

An optional Command that is executed after inserting this completion.

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.

range: Optional[Range]

The range to replace. Must begin and end on the same line.

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

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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

Additional information about the context in which inline completions were requested.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration for inline value providers.

class lsprotocol.types.InlineValueContext(frame_id, stopped_location)

LSP v3.17.0

Parameters:
  • frame_id (int) –

  • stopped_location (Range) –

frame_id: int

The stack frame (as a DAP Id) where the execution has stopped.

stopped_location: Range

The document range where execution has stopped. Typically the end position of the range denotes the line where the inline values are shown.

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

Parameters:
expression: Optional[str]

If specified the expression overrides the extracted expression.

range: Range

The document range for which the inline value applies. The range is used to extract the evaluatable expression from the underlying document.

class lsprotocol.types.InlineValueOptions(work_done_progress=None)

Inline value options used during static registration.

LSP v3.17.0

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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:
context: InlineValueContext

Additional information about the context in which inline values were requested.

range: Range

The document range for which inline values should be computed.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.InlineValueText(range, text)

Provide inline value as text.

LSP v3.17.0

Parameters:
range: Range

The document range for which the inline value applies.

text: str

The text of the inline value.

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

Parameters:
case_sensitive_lookup: bool

How to perform the lookup.

range: Range

The document range for which the inline value applies. The range is used to extract the variable name from the underlying document.

variable_name: Optional[str]

If specified the name of the variable to look up.

class lsprotocol.types.InlineValueWorkspaceClientCapabilities(refresh_support=None)

Client workspace capabilities specific to inline values.

LSP v3.17.0

Parameters:

refresh_support (Optional[bool]) –

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

Parameters:
insert: Range

The range if the insert is requested

new_text: str

The string to be inserted.

replace: Range

The range if the replace is requested.

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.

See also: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#snippet_syntax

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

Parameters:

dynamic_registration (Optional[bool]) –

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.

class lsprotocol.types.LinkedEditingRangeOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
class lsprotocol.types.LinkedEditingRangeParams(text_document, position, work_done_token=None)
Parameters:
position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.LinkedEditingRanges(ranges, word_pattern=None)

The result of a linked editing range request.

LSP v3.16.0

Parameters:
ranges: List[Range]

A list of ranges that can be edited together. The ranges must have identical length and contain identical text content. The ranges cannot overlap.

word_pattern: Optional[str]

An optional word pattern (regular expression) that describes valid contents for the given ranges. If no pattern is provided, the client configuration’s word pattern will be used.

class lsprotocol.types.Location(uri, range)

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

Parameters:
range: Range
uri: str

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.

target_selection_range: Range

The range that should be selected and revealed when this link is being followed, e.g the name of a function. Must be contained by the targetRange . See also DocumentSymbol#range

target_uri: str

The target resource identifier of this link.

class lsprotocol.types.LogMessageParams(type, message)

The log message parameters.

Parameters:
message: str

The actual message.

type: MessageType

The message type. See MessageType

class lsprotocol.types.LogTraceNotification(params, method='$/logTrace', jsonrpc='2.0')
Parameters:
jsonrpc: str
method: str

The method to be invoked.

params: LogTraceParams
class lsprotocol.types.LogTraceParams(message, verbose=None)
Parameters:
message: str
verbose: Optional[str]
class lsprotocol.types.MarkdownClientCapabilities(parser, version=None, allowed_tags=None)

Client capabilities specific to the used markdown parser.

LSP v3.16.0

Parameters:
allowed_tags: Optional[List[str]]

A list of HTML tags that the client allows / supports in Markdown.

LSP v3.17.0

parser: str

The name of the parser.

version: Optional[str]

The version of the parser.

class lsprotocol.types.MarkedString_Type1(language, value)
Parameters:
  • language (str) –

  • value (str) –

language: str
value: str
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 supports plaintext 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-highlighting

Here 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

The type of the Markup

value: str

The content itself

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.MessageActionItem(title)
Parameters:

title (str) –

title: str

A short title like ‘Retry’, ‘Open Log’ etc.

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

scheme: str

The scheme of the moniker. For example tsc or .Net

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

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether moniker supports dynamic registration. If this is set to true the client supports the new MonikerRegistrationOptions return value for the corresponding server capability as well.

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)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.MonikerRegistrationOptions(document_selector=None, work_done_progress=None)
Parameters:
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.

work_done_progress: Optional[bool]
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:
document: str

The URI of the cell’s text document content.

execution_summary: Optional[ExecutionSummary]

Additional execution summary information if supported by the client.

kind: NotebookCellKind

The cell’s kind

metadata: Optional[LSPObject]

Additional metadata stored with the cell.

Note: should always be an object literal (e.g. LSPObject)

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:
cells: Optional[List[NotebookCell]]

The new cells, if any

delete_count: int

The deleted cells

start: int

The start oftest of the cell that changed.

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.

metadata: Optional[LSPObject]

Additional metadata stored with the notebook document.

Note: should always be an object literal (e.g. LSPObject)

notebook_type: str

The type of the notebook.

uri: str

The notebook document’s uri.

version: int

The version number of this document (it will increase after each change, including undo/redo).

class lsprotocol.types.NotebookDocumentChangeEvent(metadata=None, cells=None)

A change event for a notebook document.

LSP v3.17.0

Parameters:
cells: Optional[NotebookDocumentChangeEventCellsType]

Changes to cells

metadata: Optional[LSPObject]

The changed meta data if any.

Note: should always be an object literal (e.g. LSPObject)

class lsprotocol.types.NotebookDocumentChangeEventCellsType(structure=None, data=None, text_content=None)
Parameters:
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

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:
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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

params: DidSaveNotebookDocumentParams
class lsprotocol.types.NotebookDocumentFilter_Type1(notebook_type, scheme=None, pattern=None)
Parameters:
notebook_type: str

The type of the enclosing notebook.

pattern: Optional[str]

A glob pattern.

scheme: Optional[str]

A Uri {@link Uri.scheme scheme}, like file or untitled.

class lsprotocol.types.NotebookDocumentFilter_Type2(scheme, notebook_type=None, pattern=None)
Parameters:
notebook_type: Optional[str]

The type of the enclosing notebook.

pattern: Optional[str]

A glob pattern.

scheme: str

A Uri {@link Uri.scheme scheme}, like file or untitled.

class lsprotocol.types.NotebookDocumentFilter_Type3(pattern, notebook_type=None, scheme=None)
Parameters:
notebook_type: Optional[str]

The type of the enclosing notebook.

pattern: str

A glob pattern.

scheme: Optional[str]

A Uri {@link Uri.scheme scheme}, like file or untitled.

class lsprotocol.types.NotebookDocumentIdentifier(uri)

A literal to identify a notebook document in the client.

LSP v3.17.0

Parameters:

uri (str) –

uri: str

The notebook document’s uri.

class lsprotocol.types.NotebookDocumentSyncClientCapabilities(dynamic_registration=None, execution_summary_support=None)

Notebook specific client capabilities.

LSP v3.17.0

Parameters:
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.

execution_summary_support: Optional[bool]

The client supports sending execution summary data per cell.

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]]

The notebooks to be synced

save: Optional[bool]

Whether save notification should be forwarded to the server. Will only be honored if mode === notebook .

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

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

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

save: Optional[bool]

Whether save notification should be forwarded to the server. Will only be honored if mode === notebook .

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

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

language: str
class lsprotocol.types.OptionalVersionedTextDocumentIdentifier(uri, version=None)

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

Parameters:
uri: str

The text document’s uri.

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)
Parameters:

partial_result_token (Optional[Union[int, str]]) –

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.

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 character a is 0, the character offset of 𐐀 is 1 and the character offset of b is 3 since 𐐀 is represented using two code units in UTF-16. Since 3.17 clients and servers can agree on a different string encoding representation (e.g. UTF-8). The client announces it’s supported encoding via the client capability general.positionEncodings. The value is an array of position encodings the client supports, with decreasing preference (e.g. the encoding at index 0 is the most preferred one). To stay backwards compatible the only mandatory encoding is UTF-16 represented via the string utf-16 . The server can pick one of the encodings offered by the client and signals that encoding back to the client via the initialize result’s property capabilities.positionEncoding. If the string value utf-16 is missing from the client’s capability general.positionEncodings servers can safely assume that the client supports UTF-16. If the server omits the position encoding in its initialize result the encoding defaults to the string value utf-16 . Implementation considerations: since the conversion from one encoding into another requires the content of the file / line the conversion is best done where the file is read which is usually on the server side.

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.

Parameters:
  • line (int) –

  • character (int) –

character: int

Character offset on a line in a document (zero-based).

The meaning of this offset is determined by the negotiated PositionEncodingKind .

If the character value is greater than the line length it defaults back to the line length.

line: int

Line position in a document (zero-based).

If a line number is greater than the number of lines in a document, it defaults back to the number of lines in the document. If a line number is negative, it defaults to 0.

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:
position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.PrepareRenameResult_Type1(range, placeholder)
Parameters:
  • range (Range) –

  • placeholder (str) –

placeholder: str
range: Range
class lsprotocol.types.PrepareRenameResult_Type2(default_behavior)
Parameters:

default_behavior (bool) –

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

Parameters:
  • uri (str) –

  • value (str) –

uri: str

The URI for which the client knowns a result id.

value: str

The value of the previous result id.

class lsprotocol.types.ProgressNotification(params, method='$/progress', jsonrpc='2.0')
Parameters:
jsonrpc: str
method: str

The method to be invoked.

params: ProgressParams
class lsprotocol.types.ProgressParams(token, value)
Parameters:
token: Union[int, str]

The progress token provided by the client or server.

value: Optional[Any]

The progress data.

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:
code_description_support: Optional[bool]

Client supports a codeDescription property

LSP v3.16.0

data_support: Optional[bool]

Whether code action supports the data property which is preserved between a textDocument/publishDiagnostics and textDocument/codeAction request.

LSP v3.16.0

related_information: Optional[bool]

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

version_support: Optional[bool]

Whether the client interprets the version property of the textDocument/publishDiagnostics notification’s parameter.

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:
diagnostics: List[Diagnostic]

An array of diagnostic information items.

uri: str

The URI for which diagnostic information is reported.

version: Optional[int]

Optional the version number of the document the diagnostics are published for.

LSP v3.15.0

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 }
}
Parameters:
end: Position

The range’s end position.

start: Position

The range’s start position.

class lsprotocol.types.ReferenceClientCapabilities(dynamic_registration=None)

Client Capabilities for a ReferencesRequest.

Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether references supports dynamic registration.

class lsprotocol.types.ReferenceContext(include_declaration)

Value-object that contains additional information when requesting references.

Parameters:

include_declaration (bool) –

include_declaration: bool

Include the declaration of the current symbol.

class lsprotocol.types.ReferenceOptions(work_done_progress=None)

Reference options.

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.Registration(id, method, register_options=None)

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

Parameters:
id: str

The id used to register the request. The id can be used to deregister the request again.

method: str

The method / capability to register for.

register_options: Optional[Any]

Options necessary for the registration.

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

Parameters:
engine: str

The engine’s name.

version: Optional[str]

The engine’s version.

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]

The actual items.

kind: str

A full document diagnostic report.

related_documents: Optional[Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]]

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

result_id: Optional[str]

An optional result id. If provided it will be sent on the next diagnostic request for the same document.

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:
kind: str

A document diagnostic report indicating no changes to the last result. A server can only return unchanged if result ids are provided.

related_documents: Optional[Dict[str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport]]]

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

result_id: str

A result id which will be sent on the next diagnostic request for the same document.

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]

A workspace folder or a base URI to which this pattern will be matched against relatively.

pattern: str

The actual glob pattern;

class lsprotocol.types.RenameClientCapabilities(dynamic_registration=None, prepare_support=None, prepare_support_default_behavior=None, honors_change_annotations=None)
Parameters:
dynamic_registration: Optional[bool]

Whether rename supports dynamic registration.

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

kind: str

A rename

new_uri: str

The new location.

old_uri: str

The old (existing) location.

options: Optional[RenameFileOptions]

Rename options.

class lsprotocol.types.RenameFileOptions(overwrite=None, ignore_if_exists=None)

Rename file options

Parameters:
ignore_if_exists: Optional[bool]

Ignores if target exists.

overwrite: Optional[bool]

Overwrite target if existing. Overwrite wins over ignoreIfExists

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.

Parameters:
prepare_provider: Optional[bool]

Renames should be checked and tested before being executed.

@since version 3.12.0

work_done_progress: Optional[bool]
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.

position: Position

The position at which this request was sent.

text_document: TextDocumentIdentifier

The document to rename.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

prepare_provider: Optional[bool]

Renames should be checked and tested before being executed.

@since version 3.12.0

work_done_progress: Optional[bool]
class lsprotocol.types.ResourceOperation(kind, annotation_id=None)

A generic resource operation.

Parameters:
annotation_id: Optional[str]

An optional annotation identifier describing the operation.

LSP v3.16.0

kind: str

The resource operation kind.

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)
Parameters:
code: int

A number indicating the error type that occurred.

data: Optional[Any]

A primitive or structured value that contains additional information about the error. Can be omitted.

message: str

A string providing a short description of the error.

class lsprotocol.types.ResponseErrorMessage(id=None, error=None, jsonrpc='2.0')
Parameters:
error: Optional[ResponseError]

The error object in case a request fails.

id: Optional[Union[int, str]]

The request id where the error occurred.

jsonrpc: str
class lsprotocol.types.SaveOptions(include_text=None)

Save options.

Parameters:

include_text (Optional[bool]) –

include_text: Optional[bool]

The client is supposed to include the content on save.

class lsprotocol.types.SelectedCompletionInfo(range, text)

Describes the currently selected completion item.

LSP v3.18.0 @proposed

Parameters:
range: Range

The range that will be replaced if this completion item is accepted.

text: str

The text the range will be replaced with if this completion is accepted.

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:
parent: Optional[SelectionRange]

The parent selection range containing this range. Therefore parent.range must contain this.range.

range: Range

The Range range of this selection range.

class lsprotocol.types.SelectionRangeClientCapabilities(dynamic_registration=None)
Parameters:

dynamic_registration (Optional[bool]) –

dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration for selection range providers. If this is set to true the client supports the new SelectionRangeRegistrationOptions return value for the corresponding server capability as well.

class lsprotocol.types.SelectionRangeOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

positions: List[Position]

The positions inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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

Parameters:
data: List[int]

The actual tokens.

result_id: Optional[str]

An optional result id. If provided and clients support delta updating the client will include the result id in the next semantic token request. A server can then instead of computing all semantic tokens again simply send a delta.

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:
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 to false 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 and request.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.

server_cancel_support: Optional[bool]

Whether the client allows the server to actively cancel a semantic token request, e.g. supports returning LSPErrorCodes.ServerCancelled. If a server does the client needs to retrigger the request.

LSP v3.17.0

token_modifiers: List[str]

The token modifiers that the client supports.

token_types: List[str]

The token types that the client supports.

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.

range: Optional[Union[bool, Any]]

The client will send the textDocument/semanticTokens/range request if the server provides a corresponding handler.

class lsprotocol.types.SemanticTokensClientCapabilitiesRequestsTypeFullType1(delta=None)
Parameters:

delta (Optional[bool]) –

delta: Optional[bool]

The client will send the textDocument/semanticTokens/full/delta request if the server provides a corresponding handler.

class lsprotocol.types.SemanticTokensDelta(edits, result_id=None)

LSP v3.16.0

Parameters:
edits: List[SemanticTokensEdit]

The semantic token edits to transform a previous result into a new result.

result_id: Optional[str]
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.

work_done_token: Optional[Union[int, str]]

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

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

Parameters:
data: Optional[List[int]]

The elements to insert.

delete_count: int

The count of elements to remove.

start: int

The start offset of the edit.

class lsprotocol.types.SemanticTokensLegend(token_types, token_modifiers)

LSP v3.16.0

Parameters:
token_modifiers: List[str]

The token modifiers a server uses.

token_types: List[str]

The token types a server uses.

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

range: Optional[Union[bool, Any]]

Server supports providing semantic tokens for a specific range of a document.

work_done_progress: Optional[bool]
class lsprotocol.types.SemanticTokensOptionsFullType1(delta=None)
Parameters:

delta (Optional[bool]) –

delta: Optional[bool]

The server supports deltas for full documents.

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.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.SemanticTokensPartialResult(data)

LSP v3.16.0

Parameters:

data (List[int]) –

data: List[int]
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.

range: Range

The range the semantic tokens are requested for.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.SemanticTokensRegistrationOptions(legend, document_selector=None, range=None, full=None, work_done_progress=None, id=None)

LSP v3.16.0

Parameters:
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

range: Optional[Union[bool, Any]]

Server supports providing semantic tokens for a specific range of a document.

work_done_progress: Optional[bool]
class lsprotocol.types.SemanticTokensRegistrationOptionsFullType1(delta=None)
Parameters:

delta (Optional[bool]) –

delta: Optional[bool]

The server supports deltas for full documents.

class lsprotocol.types.SemanticTokensWorkspaceClientCapabilities(refresh_support=None)

LSP v3.16.0

Parameters:

refresh_support (Optional[bool]) –

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

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.

experimental: Optional[Any]

Experimental server capabilities.

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:
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:
jsonrpc: str
method: str

The method to be invoked.

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

support: bool

The client has support for the showDocument request.

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 set external 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.

take_focus: Optional[bool]

An optional property to indicate whether the editor showing the document should take focus or not. Clients might ignore this property if an external program is started.

uri: str

The uri to show.

class lsprotocol.types.ShowDocumentResult(success)

The result of a showDocument request.

LSP v3.16.0

Parameters:

success (bool) –

success: bool

A boolean indicating if the show was successful.

class lsprotocol.types.ShowMessageParams(type, message)

The parameters of a notification message.

Parameters:
message: str

The actual message.

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)
Parameters:

additional_properties_support (Optional[bool]) –

additional_properties_support: Optional[bool]

Whether the client supports additional attributes which are preserved and send back to the server in the request’s response.

class lsprotocol.types.ShowMessageRequestParams(type, message, actions=None)
Parameters:
actions: Optional[List[MessageActionItem]]

The message action items to present.

message: str

The actual message.

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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.ShutdownResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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 the SignatureHelp 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 the retriggerCharacters on SignatureHelpOptions .

LSP v3.15.0

dynamic_registration: Optional[bool]

Whether signature help supports dynamic registration.

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:
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)
Parameters:

label_offset_support (Optional[bool]) –

label_offset_support: Optional[bool]

The client supports processing label offsets instead of a simple label string.

LSP v3.14.0

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:
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

trigger_characters: Optional[List[str]]

List of characters that trigger signature help automatically.

work_done_progress: Optional[bool]
class lsprotocol.types.SignatureHelpParams(text_document, position, context=None, work_done_token=None)

Parameters for a SignatureHelpRequest.

Parameters:
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

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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

trigger_characters: Optional[List[str]]

List of characters that trigger signature help automatically.

work_done_progress: Optional[bool]
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:
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.

label: str

The label of this signature. Will be shown in the UI.

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.

Parameters:

id (Optional[str]) –

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

Parameters:
  • value (str) –

  • kind (str) –

kind: str

The kind of string value.

value: str

The snippet string.

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.

deprecated: Optional[bool]

Indicates if this symbol is deprecated.

@deprecated Use tags instead

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.

name: str

The name of this symbol.

tags: Optional[List[SymbolTag]]

Tags for this symbol.

LSP v3.16.0

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.

Parameters:
jsonrpc: str
method: str

The method to be invoked.

params: Optional[Any]
class lsprotocol.types.TextDocumentChangeRegistrationOptions(sync_kind, document_selector=None)

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

Parameters:
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:
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 the textDocument/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.

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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CodeActionParams
class lsprotocol.types.TextDocumentCodeActionResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[Union[Command, CodeAction]]]
class lsprotocol.types.TextDocumentCodeLensRequest(id, params, method='textDocument/codeLens', jsonrpc='2.0')

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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CodeLensParams
class lsprotocol.types.TextDocumentCodeLensResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[CodeLens]]
class lsprotocol.types.TextDocumentColorPresentationOptions(work_done_progress=None, document_selector=None)
Parameters:
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.

work_done_progress: Optional[bool]
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 type ColorInformation ColorInformation[] or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ColorPresentationParams
class lsprotocol.types.TextDocumentColorPresentationResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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 type CompletionItem 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.documentation documentation } properties to the completionItem/resolve request. However, properties that are needed for the initial sorting and filtering, like sortText , filterText , insertText, and textEdit, must not be changed during resolve.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CompletionParams
class lsprotocol.types.TextDocumentCompletionResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[List[CompletionItem], CompletionList]]
class lsprotocol.types.TextDocumentContentChangeEvent_Type1(range, text, range_length=None)
Parameters:
range: Range

The range of the document that changed.

range_length: Optional[int]

The optional length of the range that got replaced.

@deprecated use range instead.

text: str

The new text for the provided range.

class lsprotocol.types.TextDocumentContentChangeEvent_Type2(text)
Parameters:

text (str) –

text: str

The new text of the whole document.

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 type Declaration or a typed array of {@link DeclarationLink} or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DeclarationParams
class lsprotocol.types.TextDocumentDeclarationResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[Location, List[Location], List[LocationLink]]]
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 type Definition or a typed array of DefinitionLink or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DefinitionParams
class lsprotocol.types.TextDocumentDefinitionResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[Location, List[Location], List[LocationLink]]]
class lsprotocol.types.TextDocumentDiagnosticRequest(id, params, method='textDocument/diagnostic', jsonrpc='2.0')

The document diagnostic request definition.

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentDiagnosticParams
class lsprotocol.types.TextDocumentDiagnosticResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Union[RelatedFullDocumentDiagnosticReport, RelatedUnchangedDocumentDiagnosticReport]
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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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 type ColorInformation ColorInformation[] or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentColorParams
class lsprotocol.types.TextDocumentDocumentColorResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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 type TextDocumentPosition the request response is an array of type DocumentHighlight or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentHighlightParams
class lsprotocol.types.TextDocumentDocumentHighlightResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[DocumentHighlight]]
class lsprotocol.types.TextDocumentDocumentLinkRequest(id, params, method='textDocument/documentLink', jsonrpc='2.0')

A request to provide document links

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentLinkParams
class lsprotocol.types.TextDocumentDocumentLinkResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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 type SymbolInformation SymbolInformation[] or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentSymbolParams
class lsprotocol.types.TextDocumentDocumentSymbolResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
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)
Parameters:
language: str

A language id, like typescript .

pattern: Optional[str]

A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.

scheme: Optional[str]

A Uri {@link Uri.scheme scheme}, like file or untitled.

class lsprotocol.types.TextDocumentFilter_Type2(scheme, language=None, pattern=None)
Parameters:
language: Optional[str]

A language id, like typescript .

pattern: Optional[str]

A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.

scheme: str

A Uri {@link Uri.scheme scheme}, like file or untitled.

class lsprotocol.types.TextDocumentFilter_Type3(pattern, language=None, scheme=None)
Parameters:
language: Optional[str]

A language id, like typescript .

pattern: str

A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.

scheme: Optional[str]

A Uri {@link Uri.scheme scheme}, like file or untitled.

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 type FoldingRangeList or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: FoldingRangeParams
class lsprotocol.types.TextDocumentFoldingRangeResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[FoldingRange]]
class lsprotocol.types.TextDocumentFormattingRequest(id, params, method='textDocument/formatting', jsonrpc='2.0')

A request to format a whole document.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentFormattingParams
class lsprotocol.types.TextDocumentFormattingResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[TextEdit]]
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 type Hover or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: HoverParams
class lsprotocol.types.TextDocumentHoverResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Hover]
class lsprotocol.types.TextDocumentIdentifier(uri)

A literal to identify a text document in the client.

Parameters:

uri (str) –

uri: str

The text document’s uri.

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 type Definition or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ImplementationParams
class lsprotocol.types.TextDocumentImplementationResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[Location, List[Location], List[LocationLink]]]
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 type InlayHint InlayHint[] or a Thenable that resolves to such.

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: InlayHintParams
class lsprotocol.types.TextDocumentInlayHintResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[InlayHint]]
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 type InlineCompletion InlineCompletion[] or a Thenable that resolves to such.

LSP v3.18.0 @proposed

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: InlineCompletionParams
class lsprotocol.types.TextDocumentInlineCompletionResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

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 type InlineValue InlineValue[] or a Thenable that resolves to such.

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: InlineValueParams
class lsprotocol.types.TextDocumentInlineValueResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[Union[InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression]]]
class lsprotocol.types.TextDocumentItem(uri, language_id, version, text)

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

Parameters:
  • uri (str) –

  • language_id (str) –

  • version (int) –

  • text (str) –

language_id: str

The text document’s language identifier.

text: str

The content of the opened text document.

uri: str

The text document’s uri.

version: int

The version number of this document (it will increase after each change, including undo/redo).

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: LinkedEditingRangeParams
class lsprotocol.types.TextDocumentLinkedEditingRangeResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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[]} or null .

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: MonikerParams
class lsprotocol.types.TextDocumentMonikerResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[Moniker]]
class lsprotocol.types.TextDocumentOnTypeFormattingRequest(id, params, method='textDocument/onTypeFormatting', jsonrpc='2.0')

A request to format a document on type.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentOnTypeFormattingParams
class lsprotocol.types.TextDocumentOnTypeFormattingResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[TextEdit]]
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:
position: Position

The position inside the text document.

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CallHierarchyPrepareParams
class lsprotocol.types.TextDocumentPrepareCallHierarchyResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: PrepareRenameParams
class lsprotocol.types.TextDocumentPrepareRenameResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[Range, PrepareRenameResult_Type1, PrepareRenameResult_Type2]]
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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: TypeHierarchyPrepareParams
class lsprotocol.types.TextDocumentPrepareTypeHierarchyResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
jsonrpc: str
method: str

The method to be invoked.

params: PublishDiagnosticsParams
class lsprotocol.types.TextDocumentRangeFormattingRequest(id, params, method='textDocument/rangeFormatting', jsonrpc='2.0')

A request to format a range in a document.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentRangeFormattingParams
class lsprotocol.types.TextDocumentRangeFormattingResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[TextEdit]]
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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DocumentRangesFormattingParams
class lsprotocol.types.TextDocumentRangesFormattingResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[TextEdit]]
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 type Location Location[] or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ReferenceParams
class lsprotocol.types.TextDocumentReferencesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[Location]]
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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: RenameParams
class lsprotocol.types.TextDocumentRenameResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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]]]

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.

include_text: Optional[bool]

The client is supposed to include the content on save.

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 type SelectionRange SelectionRange[] or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: SelectionRangeParams
class lsprotocol.types.TextDocumentSelectionRangeResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[SelectionRange]]
class lsprotocol.types.TextDocumentSemanticTokensFullDeltaRequest(id, params, method='textDocument/semanticTokens/full/delta', jsonrpc='2.0')

LSP v3.16.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: SemanticTokensDeltaParams
class lsprotocol.types.TextDocumentSemanticTokensFullDeltaResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[SemanticTokens, SemanticTokensDelta]]
class lsprotocol.types.TextDocumentSemanticTokensFullRequest(id, params, method='textDocument/semanticTokens/full', jsonrpc='2.0')

LSP v3.16.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: SemanticTokensParams
class lsprotocol.types.TextDocumentSemanticTokensFullResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[SemanticTokens]
class lsprotocol.types.TextDocumentSemanticTokensRangeRequest(id, params, method='textDocument/semanticTokens/range', jsonrpc='2.0')

LSP v3.16.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: SemanticTokensRangeParams
class lsprotocol.types.TextDocumentSemanticTokensRangeResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[SemanticTokens]
class lsprotocol.types.TextDocumentSignatureHelpRequest(id, params, method='textDocument/signatureHelp', jsonrpc='2.0')
Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: SignatureHelpParams
class lsprotocol.types.TextDocumentSignatureHelpResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[SignatureHelp]
class lsprotocol.types.TextDocumentSyncClientCapabilities(dynamic_registration=None, will_save=None, will_save_wait_until=None, did_save=None)
Parameters:
did_save: Optional[bool]

The client supports did save notifications.

dynamic_registration: Optional[bool]

Whether text document synchronization supports dynamic registration.

will_save: Optional[bool]

The client supports sending will save notifications.

will_save_wait_until: Optional[bool]

The client supports sending a will save request and waits for a response providing text edits which will be applied to the document before it is saved.

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.

will_save: Optional[bool]

If present will save notifications are sent to the server. If omitted the notification should not be sent.

will_save_wait_until: Optional[bool]

If present will save wait until requests are sent to the server. If omitted the request 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 type Definition or a Thenable that resolves to such.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: TypeDefinitionParams
class lsprotocol.types.TextDocumentTypeDefinitionResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Union[Location, List[Location], List[LocationLink]]]
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:
jsonrpc: str
method: str

The method to be invoked.

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: WillSaveTextDocumentParams
class lsprotocol.types.TextDocumentWillSaveWaitUntilResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[TextEdit]]
class lsprotocol.types.TextEdit(range, new_text)

A text edit applicable to a text document.

Parameters:
new_text: str

The string to be inserted. For delete operations use an empty string.

range: Range

The range of the text document to be manipulated. To insert text into a document create a range where start === end.

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

Parameters:
dynamic_registration: Optional[bool]

Whether implementation supports dynamic registration. If this is set to true the client supports the new TypeDefinitionRegistrationOptions return value for the corresponding server capability as well.

The client supports additional metadata in the form of definition links.

Since 3.14.0

class lsprotocol.types.TypeDefinitionOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
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.

position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
class lsprotocol.types.TypeHierarchyClientCapabilities(dynamic_registration=None)

LSP v3.17.0

Parameters:

dynamic_registration (Optional[bool]) –

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.

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.

detail: Optional[str]

More detail for this item, e.g. the signature of a function.

kind: SymbolKind

The kind of this item.

name: str

The name of this item.

range: Range

The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.

selection_range: Range

The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the {@link TypeHierarchyItem.range range }.

tags: Optional[List[SymbolTag]]

Tags for this item.

uri: str

The resource identifier of this item.

class lsprotocol.types.TypeHierarchyOptions(work_done_progress=None)

Type hierarchy options used during static registration.

LSP v3.17.0

Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
class lsprotocol.types.TypeHierarchyPrepareParams(text_document, position, work_done_token=None)

The parameter of a textDocument/prepareTypeHierarchy request.

LSP v3.17.0

Parameters:
position: Position

The position inside the text document.

text_document: TextDocumentIdentifier

The text document.

work_done_token: Optional[Union[int, str]]

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

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]]]

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.

work_done_progress: Optional[bool]
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
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.

work_done_token: Optional[Union[int, str]]

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

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: TypeHierarchySubtypesParams
class lsprotocol.types.TypeHierarchySubtypesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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
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.

work_done_token: Optional[Union[int, str]]

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

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: TypeHierarchySupertypesParams
class lsprotocol.types.TypeHierarchySupertypesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

Parameters:
  • result_id (str) –

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

result_id: str

A result id which will be sent on the next diagnostic request for the same document.

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.

Parameters:
  • id (str) –

  • method (str) –

id: str

The id used to unregister the request or notification. Usually an id provided during the register request.

method: str

The method to unregister for.

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

Parameters:
  • version (int) –

  • uri (str) –

uri: str

The notebook document’s uri.

version: int

The version number of this notebook document.

class lsprotocol.types.VersionedTextDocumentIdentifier(version, uri)

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

Parameters:
  • version (int) –

  • uri (str) –

uri: str

The text document’s uri.

version: int

The version number of this 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:
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_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:
jsonrpc: str
method: str

The method to be invoked.

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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ShowDocumentParams
class lsprotocol.types.WindowShowDocumentResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
jsonrpc: str
method: str

The method to be invoked.

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ShowMessageRequestParams
class lsprotocol.types.WindowShowMessageRequestResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
jsonrpc: str
method: str

The method to be invoked.

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: WorkDoneProgressCreateParams
class lsprotocol.types.WindowWorkDoneProgressCreateResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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.

kind: str
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].

title: str

Mandatory title of the progress operation. Used to briefly inform about the kind of operation being performed.

Examples: “Indexing” or “Linking dependencies”.

class lsprotocol.types.WorkDoneProgressCancelParams(token)
Parameters:

token (Union[int, str]) –

token: Union[int, str]

The token to be used to report progress.

class lsprotocol.types.WorkDoneProgressCreateParams(token)
Parameters:

token (Union[int, str]) –

token: Union[int, str]

The token to be used to report progress.

class lsprotocol.types.WorkDoneProgressEnd(kind='end', message=None)
Parameters:
kind: str
message: Optional[str]

Optional, a final message indicating to for example indicate the outcome of the operation.

class lsprotocol.types.WorkDoneProgressOptions(work_done_progress=None)
Parameters:

work_done_progress (Optional[bool]) –

work_done_progress: Optional[bool]
class lsprotocol.types.WorkDoneProgressParams(work_done_token=None)
Parameters:

work_done_token (Optional[Union[int, str]]) –

work_done_token: Optional[Union[int, str]]

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

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.

kind: str
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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ApplyWorkspaceEditParams
class lsprotocol.types.WorkspaceApplyEditResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
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.

configuration: Optional[bool]

The client supports workspace/configuration requests.

LSP v3.6.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.

workspace_folders: Optional[bool]

The client has support for workspace folders.

LSP v3.6.0

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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceCodeLensRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ConfigurationParams
class lsprotocol.types.WorkspaceConfigurationResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: List[Optional[Any]]
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:
identifier: Optional[str]

The additional identifier provided during registration.

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.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.WorkspaceDiagnosticRefreshRequest(id, params=None, method='workspace/diagnostic/refresh', jsonrpc='2.0')

The diagnostic refresh request definition.

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceDiagnosticRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
class lsprotocol.types.WorkspaceDiagnosticReport(items)

A workspace diagnostic report.

LSP v3.17.0

Parameters:

items (List[Union[WorkspaceFullDocumentDiagnosticReport, WorkspaceUnchangedDocumentDiagnosticReport]]) –

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]]) –

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:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: WorkspaceDiagnosticParams
class lsprotocol.types.WorkspaceDiagnosticResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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:
jsonrpc: str
method: str

The method to be invoked.

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 over changes 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:
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

changes: Optional[Dict[str, List[TextEdit]]]

Holds changes to existing resources.

document_changes: Optional[List[Union[TextDocumentEdit, CreateFile, RenameFile, DeleteFile]]]

Depending on the client capability workspace.workspaceEdit.resourceOperations document changes are either an array of TextDocumentEdit 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 above TextDocumentEdit 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 plain TextEdit 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:
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

document_changes: Optional[bool]

The client supports versioned document changes in WorkspaceEdit s

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)
Parameters:

groups_on_label (Optional[bool]) –

groups_on_label: Optional[bool]

Whether the client groups edits with equal labels into tree nodes, for instance all edits labelled with “Changes in Strings” would be a tree node.

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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: ExecuteCommandParams
class lsprotocol.types.WorkspaceExecuteCommandResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[Any]
class lsprotocol.types.WorkspaceFolder(uri, name)

A workspace folder inside a client.

Parameters:
  • uri (str) –

  • name (str) –

name: str

The name of the workspace folder. Used to refer to this workspace folder in the user interface.

uri: str

The associated URI for this workspace folder.

class lsprotocol.types.WorkspaceFoldersChangeEvent(added, removed)

The workspace folder change event.

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

supported: Optional[bool]

The server has support for workspace folders

class lsprotocol.types.WorkspaceFoldingRangeRefreshRequest(id, params=None, method='workspace/foldingRange/refresh', jsonrpc='2.0')

LSP v3.18.0 @proposed

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceFoldingRangeRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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.

kind: str

A full document diagnostic report.

result_id: Optional[str]

An optional result id. If provided it will be sent on the next diagnostic request for the same document.

uri: str

The URI for which diagnostic information is reported.

version: Optional[int]

The version number for which the diagnostics are reported. If the document is not marked as open null can be provided.

class lsprotocol.types.WorkspaceInlayHintRefreshRequest(id, params=None, method='workspace/inlayHint/refresh', jsonrpc='2.0')

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceInlayHintRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
class lsprotocol.types.WorkspaceInlineValueRefreshRequest(id, params=None, method='workspace/inlineValue/refresh', jsonrpc='2.0')

LSP v3.17.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceInlineValueRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
class lsprotocol.types.WorkspaceSemanticTokensRefreshRequest(id, params=None, method='workspace/semanticTokens/refresh', jsonrpc='2.0')

LSP v3.16.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceSemanticTokensRefreshResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: None
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.

name: str

The name of this symbol.

tags: Optional[List[SymbolTag]]

Tags for this symbol.

LSP v3.16.0

class lsprotocol.types.WorkspaceSymbolClientCapabilities(dynamic_registration=None, symbol_kind=None, tag_support=None, resolve_support=None)

Client capabilities for a WorkspaceSymbolRequest.

Parameters:
dynamic_registration: Optional[bool]

Symbol request supports dynamic registration.

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)
Parameters:

properties (List[str]) –

properties: List[str]

The properties that a client can resolve lazily. Usually location.range

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)
Parameters:

value_set (List[SymbolTag]) –

value_set: List[SymbolTag]

The tags supported by the client.

class lsprotocol.types.WorkspaceSymbolLocationType1(uri)
Parameters:

uri (str) –

uri: str
class lsprotocol.types.WorkspaceSymbolOptions(resolve_provider=None, work_done_progress=None)

Server capabilities for a WorkspaceSymbolRequest.

Parameters:
resolve_provider: Optional[bool]

The server provides support to resolve additional information for a workspace symbol.

LSP v3.17.0

work_done_progress: Optional[bool]
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.

query: str

A query string to filter symbols by. Clients may send an empty string here to request all symbols.

work_done_token: Optional[Union[int, str]]

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

class lsprotocol.types.WorkspaceSymbolRegistrationOptions(resolve_provider=None, work_done_progress=None)

Registration options for a WorkspaceSymbolRequest.

Parameters:
resolve_provider: Optional[bool]

The server provides support to resolve additional information for a workspace symbol.

LSP v3.17.0

work_done_progress: Optional[bool]
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 type SymbolInformation 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 .

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: WorkspaceSymbol
class lsprotocol.types.WorkspaceSymbolResolveResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: WorkspaceSymbol
class lsprotocol.types.WorkspaceSymbolResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

Parameters:
kind: str

A document diagnostic report indicating no changes to the last result. A server can only return unchanged if result ids are provided.

result_id: str

A result id which will be sent on the next diagnostic request for the same document.

uri: str

The URI for which diagnostic information is reported.

version: Optional[int]

The version number for which the diagnostics are reported. If the document is not marked as open null can be 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 the WorkspaceEdit can not manipulate the content of the file to be created.

LSP v3.16.0

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: CreateFilesParams
class lsprotocol.types.WorkspaceWillCreateFilesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: DeleteFilesParams
class lsprotocol.types.WorkspaceWillDeleteFilesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: RenameFilesParams
class lsprotocol.types.WorkspaceWillRenameFilesResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
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.

Parameters:
id: Union[int, str]

The request id.

jsonrpc: str
method: str

The method to be invoked.

params: None
class lsprotocol.types.WorkspaceWorkspaceFoldersResponse(id, result=None, jsonrpc='2.0')
Parameters:
id: Optional[Union[int, str]]

The request id.

jsonrpc: str
result: Optional[List[WorkspaceFolder]]
lsprotocol.types.is_keyword_class(cls)

Returns true if the class has a property that may be python keyword.

Parameters:

cls (type) –

Return type:

bool

lsprotocol.types.is_special_class(cls)

Returns true if the class or its properties require special handling.

Parameters:

cls (type) –

Return type:

bool

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.

Parameters:
  • cls (type) –

  • property_name (str) –

Return type:

bool

lsprotocol.types.message_direction(method)

Returns message direction clientToServer, serverToClient or both.

Parameters:

method (str) –

Return type:

str

lsprotocol.types.Declaration

The declaration of a symbol representation as one or many Location locations.

alias of Union[Location, List[Location]]

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.

alias of Union[Location, List[Location]]

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

alias of Optional[Any]

lsprotocol.types.LSPArray

LSP arrays. LSP v3.17.0

alias of List[LSPAny]

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 the fileName 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]