Clients
- class pygls.lsp.client.BaseLanguageClient(name, version, protocol_cls=<class 'pygls.protocol.language_server.LanguageServerProtocol'>, converter_factory=<function default_converter>, **kwargs)
-
- call_hierarchy_incoming_calls(params, callback=None)
Make a callHierarchy/incomingCalls request.
A request to resolve the incoming calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
params (CallHierarchyIncomingCallsParams) –
callback (Optional[Callable[[Optional[List[CallHierarchyIncomingCall]]], None]]) –
- Return type:
Future
- async call_hierarchy_incoming_calls_async(params)
Make a callHierarchy/incomingCalls request.
A request to resolve the incoming calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
params (CallHierarchyIncomingCallsParams) –
- Return type:
- call_hierarchy_outgoing_calls(params, callback=None)
Make a callHierarchy/outgoingCalls request.
A request to resolve the outgoing calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
params (CallHierarchyOutgoingCallsParams) –
callback (Optional[Callable[[Optional[List[CallHierarchyOutgoingCall]]], None]]) –
- Return type:
Future
- async call_hierarchy_outgoing_calls_async(params)
Make a callHierarchy/outgoingCalls request.
A request to resolve the outgoing calls for a given
CallHierarchyItem
.LSP v3.16.0
- Parameters:
params (CallHierarchyOutgoingCallsParams) –
- Return type:
- cancel_request(params)
Send a $/cancelRequest notification.
- Parameters:
params (CancelParams) –
- Return type:
None
- code_action_resolve(params, callback=None)
Make a codeAction/resolve request.
Request to resolve additional information for a given code action.The request’s parameter is of type
CodeAction
the response is of typeCodeAction
or a Thenable that resolves to such.- Parameters:
params (CodeAction) –
callback (Optional[Callable[[CodeAction], None]]) –
- Return type:
Future
- async code_action_resolve_async(params)
Make a codeAction/resolve request.
Request to resolve additional information for a given code action.The request’s parameter is of type
CodeAction
the response is of typeCodeAction
or a Thenable that resolves to such.- Parameters:
params (CodeAction) –
- Return type:
- code_lens_resolve(params, callback=None)
Make a codeLens/resolve request.
A request to resolve a command for a given code lens.
- async code_lens_resolve_async(params)
Make a codeLens/resolve request.
A request to resolve a command for a given code lens.
- completion_item_resolve(params, callback=None)
Make a completionItem/resolve request.
Request to resolve additional information for a given completion item.The request’s parameter is of type
CompletionItem
the response is of typeCompletionItem
or a Thenable that resolves to such.- Parameters:
params (CompletionItem) –
callback (Optional[Callable[[CompletionItem], None]]) –
- Return type:
Future
- async completion_item_resolve_async(params)
Make a completionItem/resolve request.
Request to resolve additional information for a given completion item.The request’s parameter is of type
CompletionItem
the response is of typeCompletionItem
or a Thenable that resolves to such.- Parameters:
params (CompletionItem) –
- Return type:
- document_link_resolve(params, callback=None)
Make a documentLink/resolve request.
Request to resolve additional information for a given document link. The request’s parameter is of type
DocumentLink
the response is of typeDocumentLink
or a Thenable that resolves to such.- Parameters:
params (DocumentLink) –
callback (Optional[Callable[[DocumentLink], None]]) –
- Return type:
Future
- async document_link_resolve_async(params)
Make a documentLink/resolve request.
Request to resolve additional information for a given document link. The request’s parameter is of type
DocumentLink
the response is of typeDocumentLink
or a Thenable that resolves to such.- Parameters:
params (DocumentLink) –
- Return type:
- exit(params)
Send a exit notification.
The exit event is sent from the client to the server to ask the server to exit its process.
- Parameters:
params (None) –
- Return type:
None
- initialize(params, callback=None)
Make a initialize request.
The initialize request is sent from the client to the server. It is sent once as the request after starting up the server. The requests parameter is of type
InitializeParams
the response if of typeInitializeResult
of a Thenable that resolves to such.- Parameters:
params (InitializeParams) –
callback (Optional[Callable[[InitializeResult], None]]) –
- Return type:
Future
- async initialize_async(params)
Make a initialize request.
The initialize request is sent from the client to the server. It is sent once as the request after starting up the server. The requests parameter is of type
InitializeParams
the response if of typeInitializeResult
of a Thenable that resolves to such.- Parameters:
params (InitializeParams) –
- Return type:
- initialized(params)
Send a initialized notification.
The initialized notification is sent from the client to the server after the client is fully initialized and the server is allowed to send requests from the server to the client.
- Parameters:
params (InitializedParams) –
- Return type:
None
- inlay_hint_resolve(params, callback=None)
Make a inlayHint/resolve request.
A request to resolve additional properties for an inlay hint. The request’s parameter is of type
InlayHint
, the response is of typeInlayHint
or a Thenable that resolves to such.LSP v3.17.0
- async inlay_hint_resolve_async(params)
Make a inlayHint/resolve request.
A request to resolve additional properties for an inlay hint. The request’s parameter is of type
InlayHint
, the response is of typeInlayHint
or a Thenable that resolves to such.LSP v3.17.0
- notebook_document_did_change(params)
Send a notebookDocument/didChange notification.
- Parameters:
params (DidChangeNotebookDocumentParams) –
- Return type:
None
- notebook_document_did_close(params)
Send a notebookDocument/didClose notification.
A notification sent when a notebook closes.
LSP v3.17.0
- Parameters:
params (DidCloseNotebookDocumentParams) –
- Return type:
None
- notebook_document_did_open(params)
Send a notebookDocument/didOpen notification.
A notification sent when a notebook opens.
LSP v3.17.0
- Parameters:
params (DidOpenNotebookDocumentParams) –
- Return type:
None
- notebook_document_did_save(params)
Send a notebookDocument/didSave notification.
A notification sent when a notebook document is saved.
LSP v3.17.0
- Parameters:
params (DidSaveNotebookDocumentParams) –
- Return type:
None
- progress(params)
Send a $/progress notification.
- Parameters:
params (ProgressParams) –
- Return type:
None
- set_trace(params)
Send a $/setTrace notification.
- Parameters:
params (SetTraceParams) –
- Return type:
None
- shutdown(params, callback=None)
Make a shutdown request.
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.
- async shutdown_async(params)
Make a shutdown request.
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:
params (None) –
- Return type:
None
- text_document_code_action(params, callback=None)
Make a textDocument/codeAction request.
A request to provide commands for the given text document and range.
- Parameters:
params (CodeActionParams) –
callback (Optional[Callable[[Optional[List[Union[Command, CodeAction]]]], None]]) –
- Return type:
Future
- async text_document_code_action_async(params)
Make a textDocument/codeAction request.
A request to provide commands for the given text document and range.
- Parameters:
params (CodeActionParams) –
- Return type:
- text_document_code_lens(params, callback=None)
Make a textDocument/codeLens request.
A request to provide code lens for the given text document.
- async text_document_code_lens_async(params)
Make a textDocument/codeLens request.
A request to provide code lens for the given text document.
- Parameters:
params (CodeLensParams) –
- Return type:
- text_document_color_presentation(params, callback=None)
Make a textDocument/colorPresentation request.
A request to list all presentation for a color. The request’s parameter is of type
ColorPresentationParams
the response is of typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- Parameters:
params (ColorPresentationParams) –
callback (Optional[Callable[[List[ColorPresentation]], None]]) –
- Return type:
Future
- async text_document_color_presentation_async(params)
Make a textDocument/colorPresentation request.
A request to list all presentation for a color. The request’s parameter is of type
ColorPresentationParams
the response is of typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- Parameters:
params (ColorPresentationParams) –
- Return type:
- text_document_completion(params, callback=None)
Make a textDocument/completion request.
Request to request completion at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeCompletionItem CompletionItem[]
or {@link CompletionList} or a Thenable that resolves to such.The request can delay the computation of the {@link CompletionItem.detail
detail
} and {@link CompletionItem.documentationdocumentation
} properties to the completionItem/resolve request. However, properties that are needed for the initial sorting and filtering, likesortText
,filterText
, insertText, and textEdit, must not be changed during resolve.- Parameters:
params (CompletionParams) –
callback (Optional[Callable[[Optional[Union[List[CompletionItem], CompletionList]]], None]]) –
- Return type:
Future
- async text_document_completion_async(params)
Make a textDocument/completion request.
Request to request completion at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeCompletionItem CompletionItem[]
or {@link CompletionList} or a Thenable that resolves to such.The request can delay the computation of the {@link CompletionItem.detail
detail
} and {@link CompletionItem.documentationdocumentation
} properties to the completionItem/resolve request. However, properties that are needed for the initial sorting and filtering, likesortText
,filterText
, insertText, and textEdit, must not be changed during resolve.- Parameters:
params (CompletionParams) –
- Return type:
- text_document_declaration(params, callback=None)
Make a textDocument/declaration request.
A request to resolve the type definition locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDeclaration
or a typed array of {@link DeclarationLink} or a Thenable that resolves to such.- Parameters:
params (DeclarationParams) –
callback (Optional[Callable[[Optional[Union[Location, List[Location], List[LocationLink]]]], None]]) –
- Return type:
Future
- async text_document_declaration_async(params)
Make a textDocument/declaration request.
A request to resolve the type definition locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDeclaration
or a typed array of {@link DeclarationLink} or a Thenable that resolves to such.- Parameters:
params (DeclarationParams) –
- Return type:
Optional[Union[Location, List[Location], List[LocationLink]]]
- text_document_definition(params, callback=None)
Make a textDocument/definition request.
A request to resolve the definition location of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of either typeDefinition
or a typed array ofDefinitionLink
or a Thenable that resolves to such.- Parameters:
params (DefinitionParams) –
callback (Optional[Callable[[Optional[Union[Location, List[Location], List[LocationLink]]]], None]]) –
- Return type:
Future
- async text_document_definition_async(params)
Make a textDocument/definition request.
A request to resolve the definition location of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of either typeDefinition
or a typed array ofDefinitionLink
or a Thenable that resolves to such.- Parameters:
params (DefinitionParams) –
- Return type:
Optional[Union[Location, List[Location], List[LocationLink]]]
- text_document_diagnostic(params, callback=None)
Make a textDocument/diagnostic request.
The document diagnostic request definition.
LSP v3.17.0
- Parameters:
params (DocumentDiagnosticParams) –
callback (Optional[Callable[[Union[RelatedFullDocumentDiagnosticReport, RelatedUnchangedDocumentDiagnosticReport]], None]]) –
- Return type:
Future
- async text_document_diagnostic_async(params)
Make a textDocument/diagnostic request.
The document diagnostic request definition.
LSP v3.17.0
- Parameters:
params (DocumentDiagnosticParams) –
- Return type:
Union[RelatedFullDocumentDiagnosticReport, RelatedUnchangedDocumentDiagnosticReport]
- text_document_did_change(params)
Send a textDocument/didChange notification.
The document change notification is sent from the client to the server to signal changes to a text document.
- Parameters:
params (DidChangeTextDocumentParams) –
- Return type:
None
- text_document_did_close(params)
Send a textDocument/didClose notification.
The document close notification is sent from the client to the server when the document got closed in the client. The document’s truth now exists where the document’s uri points to (e.g. if the document’s uri is a file uri the truth now exists on disk). As with the open notification the close notification is about managing the document’s content. Receiving a close notification doesn’t mean that the document was open in an editor before. A close notification requires a previous open notification to be sent.
- Parameters:
params (DidCloseTextDocumentParams) –
- Return type:
None
- text_document_did_open(params)
Send a textDocument/didOpen notification.
The document open notification is sent from the client to the server to signal newly opened text documents. The document’s truth is now managed by the client and the server must not try to read the document’s truth using the document’s uri. Open in this sense means it is managed by the client. It doesn’t necessarily mean that its content is presented in an editor. An open notification must not be sent more than once without a corresponding close notification send before. This means open and close notification must be balanced and the max open count is one.
- Parameters:
params (DidOpenTextDocumentParams) –
- Return type:
None
- text_document_did_save(params)
Send a textDocument/didSave notification.
The document save notification is sent from the client to the server when the document got saved in the client.
- Parameters:
params (DidSaveTextDocumentParams) –
- Return type:
None
- text_document_document_color(params, callback=None)
Make a textDocument/documentColor request.
A request to list all color symbols found in a given text document. The request’s parameter is of type
DocumentColorParams
the response is of typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- Parameters:
params (DocumentColorParams) –
callback (Optional[Callable[[List[ColorInformation]], None]]) –
- Return type:
Future
- async text_document_document_color_async(params)
Make a textDocument/documentColor request.
A request to list all color symbols found in a given text document. The request’s parameter is of type
DocumentColorParams
the response is of typeColorInformation ColorInformation[]
or a Thenable that resolves to such.- Parameters:
params (DocumentColorParams) –
- Return type:
- text_document_document_highlight(params, callback=None)
Make a textDocument/documentHighlight request.
Request to resolve a
DocumentHighlight
for a given text document position. The request’s parameter is of typeTextDocumentPosition
the request response is an array of typeDocumentHighlight
or a Thenable that resolves to such.- Parameters:
params (DocumentHighlightParams) –
callback (Optional[Callable[[Optional[List[DocumentHighlight]]], None]]) –
- Return type:
Future
- async text_document_document_highlight_async(params)
Make a textDocument/documentHighlight request.
Request to resolve a
DocumentHighlight
for a given text document position. The request’s parameter is of typeTextDocumentPosition
the request response is an array of typeDocumentHighlight
or a Thenable that resolves to such.- Parameters:
params (DocumentHighlightParams) –
- Return type:
- text_document_document_link(params, callback=None)
Make a textDocument/documentLink request.
A request to provide document links
- Parameters:
params (DocumentLinkParams) –
callback (Optional[Callable[[Optional[List[DocumentLink]]], None]]) –
- Return type:
Future
- async text_document_document_link_async(params)
Make a textDocument/documentLink request.
A request to provide document links
- Parameters:
params (DocumentLinkParams) –
- Return type:
- text_document_document_symbol(params, callback=None)
Make a textDocument/documentSymbol request.
A request to list all symbols found in a given text document. The request’s parameter is of type
TextDocumentIdentifier
the response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- Parameters:
params (DocumentSymbolParams) –
callback (Optional[Callable[[Optional[Union[List[SymbolInformation], List[DocumentSymbol]]]], None]]) –
- Return type:
Future
- async text_document_document_symbol_async(params)
Make a textDocument/documentSymbol request.
A request to list all symbols found in a given text document. The request’s parameter is of type
TextDocumentIdentifier
the response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- Parameters:
params (DocumentSymbolParams) –
- Return type:
Optional[Union[List[SymbolInformation], List[DocumentSymbol]]]
- text_document_folding_range(params, callback=None)
Make a textDocument/foldingRange request.
A request to provide folding ranges in a document. The request’s parameter is of type
FoldingRangeParams
, the response is of typeFoldingRangeList
or a Thenable that resolves to such.- Parameters:
params (FoldingRangeParams) –
callback (Optional[Callable[[Optional[List[FoldingRange]]], None]]) –
- Return type:
Future
- async text_document_folding_range_async(params)
Make a textDocument/foldingRange request.
A request to provide folding ranges in a document. The request’s parameter is of type
FoldingRangeParams
, the response is of typeFoldingRangeList
or a Thenable that resolves to such.- Parameters:
params (FoldingRangeParams) –
- Return type:
- text_document_formatting(params, callback=None)
Make a textDocument/formatting request.
A request to format a whole document.
- async text_document_formatting_async(params)
Make a textDocument/formatting request.
A request to format a whole document.
- Parameters:
params (DocumentFormattingParams) –
- Return type:
- text_document_hover(params, callback=None)
Make a textDocument/hover request.
Request to request hover information at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeHover
or a Thenable that resolves to such.- Parameters:
params (HoverParams) –
- Return type:
Future
- async text_document_hover_async(params)
Make a textDocument/hover request.
Request to request hover information at a given text document position. The request’s parameter is of type
TextDocumentPosition
the response is of typeHover
or a Thenable that resolves to such.- Parameters:
params (HoverParams) –
- Return type:
- text_document_implementation(params, callback=None)
Make a textDocument/implementation request.
A request to resolve the implementation locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDefinition
or a Thenable that resolves to such.- Parameters:
params (ImplementationParams) –
callback (Optional[Callable[[Optional[Union[Location, List[Location], List[LocationLink]]]], None]]) –
- Return type:
Future
- async text_document_implementation_async(params)
Make a textDocument/implementation request.
A request to resolve the implementation locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDefinition
or a Thenable that resolves to such.- Parameters:
params (ImplementationParams) –
- Return type:
Optional[Union[Location, List[Location], List[LocationLink]]]
- text_document_inlay_hint(params, callback=None)
Make a textDocument/inlayHint request.
A request to provide inlay hints in a document. The request’s parameter is of type
InlayHintsParams
, the response is of typeInlayHint InlayHint[]
or a Thenable that resolves to such.LSP v3.17.0
- async text_document_inlay_hint_async(params)
Make a textDocument/inlayHint request.
A request to provide inlay hints in a document. The request’s parameter is of type
InlayHintsParams
, the response is of typeInlayHint InlayHint[]
or a Thenable that resolves to such.LSP v3.17.0
- Parameters:
params (InlayHintParams) –
- Return type:
- text_document_inline_completion(params, callback=None)
Make a textDocument/inlineCompletion request.
A request to provide inline completions in a document. The request’s parameter is of type
InlineCompletionParams
, the response is of typeInlineCompletion InlineCompletion[]
or a Thenable that resolves to such.LSP v3.18.0 @proposed
- Parameters:
params (InlineCompletionParams) –
callback (Optional[Callable[[Optional[Union[InlineCompletionList, List[InlineCompletionItem]]]], None]]) –
- Return type:
Future
- async text_document_inline_completion_async(params)
Make a textDocument/inlineCompletion request.
A request to provide inline completions in a document. The request’s parameter is of type
InlineCompletionParams
, the response is of typeInlineCompletion InlineCompletion[]
or a Thenable that resolves to such.LSP v3.18.0 @proposed
- Parameters:
params (InlineCompletionParams) –
- Return type:
Optional[Union[InlineCompletionList, List[InlineCompletionItem]]]
- text_document_inline_value(params, callback=None)
Make a textDocument/inlineValue request.
A request to provide inline values in a document. The request’s parameter is of type
InlineValueParams
, the response is of typeInlineValue InlineValue[]
or a Thenable that resolves to such.LSP v3.17.0
- Parameters:
params (InlineValueParams) –
callback (Optional[Callable[[Optional[List[Union[InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression]]]], None]]) –
- Return type:
Future
- async text_document_inline_value_async(params)
Make a textDocument/inlineValue request.
A request to provide inline values in a document. The request’s parameter is of type
InlineValueParams
, the response is of typeInlineValue InlineValue[]
or a Thenable that resolves to such.LSP v3.17.0
- Parameters:
params (InlineValueParams) –
- Return type:
Optional[List[Union[InlineValueText, InlineValueVariableLookup, InlineValueEvaluatableExpression]]]
- text_document_linked_editing_range(params, callback=None)
Make a textDocument/linkedEditingRange request.
A request to provide ranges that can be edited together.
LSP v3.16.0
- Parameters:
params (LinkedEditingRangeParams) –
callback (Optional[Callable[[Optional[LinkedEditingRanges]], None]]) –
- Return type:
Future
- async text_document_linked_editing_range_async(params)
Make a textDocument/linkedEditingRange request.
A request to provide ranges that can be edited together.
LSP v3.16.0
- Parameters:
params (LinkedEditingRangeParams) –
- Return type:
- text_document_moniker(params, callback=None)
Make a textDocument/moniker request.
A request to get the moniker of a symbol at a given text document position. The request parameter is of type
TextDocumentPositionParams
. The response is of type {@link Moniker Moniker[]} ornull
.
- async text_document_moniker_async(params)
Make a textDocument/moniker request.
A request to get the moniker of a symbol at a given text document position. The request parameter is of type
TextDocumentPositionParams
. The response is of type {@link Moniker Moniker[]} ornull
.- Parameters:
params (MonikerParams) –
- Return type:
- text_document_on_type_formatting(params, callback=None)
Make a textDocument/onTypeFormatting request.
A request to format a document on type.
- async text_document_on_type_formatting_async(params)
Make a textDocument/onTypeFormatting request.
A request to format a document on type.
- Parameters:
params (DocumentOnTypeFormattingParams) –
- Return type:
- text_document_prepare_call_hierarchy(params, callback=None)
Make a textDocument/prepareCallHierarchy request.
A request to result a
CallHierarchyItem
in a document at a given position. Can be used as an input to an incoming or outgoing call hierarchy.LSP v3.16.0
- Parameters:
params (CallHierarchyPrepareParams) –
callback (Optional[Callable[[Optional[List[CallHierarchyItem]]], None]]) –
- Return type:
Future
- async text_document_prepare_call_hierarchy_async(params)
Make a textDocument/prepareCallHierarchy request.
A request to result a
CallHierarchyItem
in a document at a given position. Can be used as an input to an incoming or outgoing call hierarchy.LSP v3.16.0
- Parameters:
params (CallHierarchyPrepareParams) –
- Return type:
- text_document_prepare_rename(params, callback=None)
Make a textDocument/prepareRename request.
A request to test and perform the setup necessary for a rename.
LSP v3.16 - support for default behavior
- Parameters:
params (PrepareRenameParams) –
callback (Optional[Callable[[Optional[Union[Range, PrepareRenameResult_Type1, PrepareRenameResult_Type2]]], None]]) –
- Return type:
Future
- async text_document_prepare_rename_async(params)
Make a textDocument/prepareRename request.
A request to test and perform the setup necessary for a rename.
LSP v3.16 - support for default behavior
- Parameters:
params (PrepareRenameParams) –
- Return type:
Optional[Union[Range, PrepareRenameResult_Type1, PrepareRenameResult_Type2]]
- text_document_prepare_type_hierarchy(params, callback=None)
Make a textDocument/prepareTypeHierarchy request.
A request to result a
TypeHierarchyItem
in a document at a given position. Can be used as an input to a subtypes or supertypes type hierarchy.LSP v3.17.0
- Parameters:
params (TypeHierarchyPrepareParams) –
callback (Optional[Callable[[Optional[List[TypeHierarchyItem]]], None]]) –
- Return type:
Future
- async text_document_prepare_type_hierarchy_async(params)
Make a textDocument/prepareTypeHierarchy request.
A request to result a
TypeHierarchyItem
in a document at a given position. Can be used as an input to a subtypes or supertypes type hierarchy.LSP v3.17.0
- Parameters:
params (TypeHierarchyPrepareParams) –
- Return type:
- text_document_range_formatting(params, callback=None)
Make a textDocument/rangeFormatting request.
A request to format a range in a document.
- async text_document_range_formatting_async(params)
Make a textDocument/rangeFormatting request.
A request to format a range in a document.
- Parameters:
params (DocumentRangeFormattingParams) –
- Return type:
- text_document_ranges_formatting(params, callback=None)
Make a textDocument/rangesFormatting request.
A request to format ranges in a document.
LSP v3.18.0 @proposed
- async text_document_ranges_formatting_async(params)
Make a textDocument/rangesFormatting request.
A request to format ranges in a document.
LSP v3.18.0 @proposed
- Parameters:
params (DocumentRangesFormattingParams) –
- Return type:
- text_document_references(params, callback=None)
Make a textDocument/references request.
A request to resolve project-wide references for the symbol denoted by the given text document position. The request’s parameter is of type
ReferenceParams
the response is of typeLocation Location[]
or a Thenable that resolves to such.
- async text_document_references_async(params)
Make a textDocument/references request.
A request to resolve project-wide references for the symbol denoted by the given text document position. The request’s parameter is of type
ReferenceParams
the response is of typeLocation Location[]
or a Thenable that resolves to such.- Parameters:
params (ReferenceParams) –
- Return type:
- text_document_rename(params, callback=None)
Make a textDocument/rename request.
A request to rename a symbol.
- Parameters:
params (RenameParams) –
callback (Optional[Callable[[Optional[WorkspaceEdit]], None]]) –
- Return type:
Future
- async text_document_rename_async(params)
Make a textDocument/rename request.
A request to rename a symbol.
- Parameters:
params (RenameParams) –
- Return type:
- text_document_selection_range(params, callback=None)
Make a textDocument/selectionRange request.
A request to provide selection ranges in a document. The request’s parameter is of type
SelectionRangeParams
, the response is of typeSelectionRange SelectionRange[]
or a Thenable that resolves to such.- Parameters:
params (SelectionRangeParams) –
callback (Optional[Callable[[Optional[List[SelectionRange]]], None]]) –
- Return type:
Future
- async text_document_selection_range_async(params)
Make a textDocument/selectionRange request.
A request to provide selection ranges in a document. The request’s parameter is of type
SelectionRangeParams
, the response is of typeSelectionRange SelectionRange[]
or a Thenable that resolves to such.- Parameters:
params (SelectionRangeParams) –
- Return type:
- text_document_semantic_tokens_full(params, callback=None)
Make a textDocument/semanticTokens/full request.
LSP v3.16.0
- Parameters:
params (SemanticTokensParams) –
callback (Optional[Callable[[Optional[SemanticTokens]], None]]) –
- Return type:
Future
- async text_document_semantic_tokens_full_async(params)
Make a textDocument/semanticTokens/full request.
LSP v3.16.0
- Parameters:
params (SemanticTokensParams) –
- Return type:
- text_document_semantic_tokens_full_delta(params, callback=None)
Make a textDocument/semanticTokens/full/delta request.
LSP v3.16.0
- Parameters:
params (SemanticTokensDeltaParams) –
callback (Optional[Callable[[Optional[Union[SemanticTokens, SemanticTokensDelta]]], None]]) –
- Return type:
Future
- async text_document_semantic_tokens_full_delta_async(params)
Make a textDocument/semanticTokens/full/delta request.
LSP v3.16.0
- Parameters:
params (SemanticTokensDeltaParams) –
- Return type:
- text_document_semantic_tokens_range(params, callback=None)
Make a textDocument/semanticTokens/range request.
LSP v3.16.0
- Parameters:
params (SemanticTokensRangeParams) –
callback (Optional[Callable[[Optional[SemanticTokens]], None]]) –
- Return type:
Future
- async text_document_semantic_tokens_range_async(params)
Make a textDocument/semanticTokens/range request.
LSP v3.16.0
- Parameters:
params (SemanticTokensRangeParams) –
- Return type:
- text_document_signature_help(params, callback=None)
Make a textDocument/signatureHelp request.
- Parameters:
params (SignatureHelpParams) –
callback (Optional[Callable[[Optional[SignatureHelp]], None]]) –
- Return type:
Future
- async text_document_signature_help_async(params)
Make a textDocument/signatureHelp request.
- Parameters:
params (SignatureHelpParams) –
- Return type:
- text_document_type_definition(params, callback=None)
Make a textDocument/typeDefinition request.
A request to resolve the type definition locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDefinition
or a Thenable that resolves to such.- Parameters:
params (TypeDefinitionParams) –
callback (Optional[Callable[[Optional[Union[Location, List[Location], List[LocationLink]]]], None]]) –
- Return type:
Future
- async text_document_type_definition_async(params)
Make a textDocument/typeDefinition request.
A request to resolve the type definition locations of a symbol at a given text document position. The request’s parameter is of type
TextDocumentPositionParams
the response is of typeDefinition
or a Thenable that resolves to such.- Parameters:
params (TypeDefinitionParams) –
- Return type:
Optional[Union[Location, List[Location], List[LocationLink]]]
- text_document_will_save(params)
Send a textDocument/willSave notification.
A document will save notification is sent from the client to the server before the document is actually saved.
- Parameters:
params (WillSaveTextDocumentParams) –
- Return type:
None
- text_document_will_save_wait_until(params, callback=None)
Make a textDocument/willSaveWaitUntil request.
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.
- async text_document_will_save_wait_until_async(params)
Make a textDocument/willSaveWaitUntil request.
A document will save request is sent from the client to the server before the document is actually saved. The request can return an array of TextEdits which will be applied to the text document before it is saved. Please note that clients might drop results if computing the text edits took too long or if a server constantly fails on this request. This is done to keep the save fast and reliable.
- Parameters:
params (WillSaveTextDocumentParams) –
- Return type:
- type_hierarchy_subtypes(params, callback=None)
Make a typeHierarchy/subtypes request.
A request to resolve the subtypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
params (TypeHierarchySubtypesParams) –
callback (Optional[Callable[[Optional[List[TypeHierarchyItem]]], None]]) –
- Return type:
Future
- async type_hierarchy_subtypes_async(params)
Make a typeHierarchy/subtypes request.
A request to resolve the subtypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
params (TypeHierarchySubtypesParams) –
- Return type:
- type_hierarchy_supertypes(params, callback=None)
Make a typeHierarchy/supertypes request.
A request to resolve the supertypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
params (TypeHierarchySupertypesParams) –
callback (Optional[Callable[[Optional[List[TypeHierarchyItem]]], None]]) –
- Return type:
Future
- async type_hierarchy_supertypes_async(params)
Make a typeHierarchy/supertypes request.
A request to resolve the supertypes for a given
TypeHierarchyItem
.LSP v3.17.0
- Parameters:
params (TypeHierarchySupertypesParams) –
- Return type:
- window_work_done_progress_cancel(params)
Send a window/workDoneProgress/cancel notification.
The
window/workDoneProgress/cancel
notification is sent from the client to the server to cancel a progress initiated on the server side.- Parameters:
params (WorkDoneProgressCancelParams) –
- Return type:
None
- workspace_diagnostic(params, callback=None)
Make a workspace/diagnostic request.
The workspace diagnostic request definition.
LSP v3.17.0
- Parameters:
params (WorkspaceDiagnosticParams) –
callback (Optional[Callable[[WorkspaceDiagnosticReport], None]]) –
- Return type:
Future
- async workspace_diagnostic_async(params)
Make a workspace/diagnostic request.
The workspace diagnostic request definition.
LSP v3.17.0
- Parameters:
params (WorkspaceDiagnosticParams) –
- Return type:
- workspace_did_change_configuration(params)
Send a workspace/didChangeConfiguration notification.
The configuration change notification is sent from the client to the server when the client’s configuration has changed. The notification contains the changed configuration as defined by the language client.
- Parameters:
params (DidChangeConfigurationParams) –
- Return type:
None
- workspace_did_change_watched_files(params)
Send a workspace/didChangeWatchedFiles notification.
The watched files notification is sent from the client to the server when the client detects changes to file watched by the language client.
- Parameters:
params (DidChangeWatchedFilesParams) –
- Return type:
None
- workspace_did_change_workspace_folders(params)
Send a workspace/didChangeWorkspaceFolders notification.
The
workspace/didChangeWorkspaceFolders
notification is sent from the client to the server when the workspace folder configuration changes.- Parameters:
params (DidChangeWorkspaceFoldersParams) –
- Return type:
None
- workspace_did_create_files(params)
Send a workspace/didCreateFiles notification.
The did create files notification is sent from the client to the server when files were created from within the client.
LSP v3.16.0
- Parameters:
params (CreateFilesParams) –
- Return type:
None
- workspace_did_delete_files(params)
Send a workspace/didDeleteFiles notification.
The will delete files request is sent from the client to the server before files are actually deleted as long as the deletion is triggered from within the client.
LSP v3.16.0
- Parameters:
params (DeleteFilesParams) –
- Return type:
None
- workspace_did_rename_files(params)
Send a workspace/didRenameFiles notification.
The did rename files notification is sent from the client to the server when files were renamed from within the client.
LSP v3.16.0
- Parameters:
params (RenameFilesParams) –
- Return type:
None
- workspace_execute_command(params, callback=None)
Make a workspace/executeCommand request.
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:
params (ExecuteCommandParams) –
- Return type:
Future
- async workspace_execute_command_async(params)
Make a workspace/executeCommand request.
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:
params (ExecuteCommandParams) –
- Return type:
- workspace_symbol(params, callback=None)
Make a workspace/symbol request.
A request to list project-wide symbols matching the query string given by the
WorkspaceSymbolParams
. The response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- LSP v3.17.0 - support for WorkspaceSymbol in the returned data. Clients
need to advertise support for WorkspaceSymbols via the client capability
workspace.symbol.resolveSupport
.
- Parameters:
params (WorkspaceSymbolParams) –
callback (Optional[Callable[[Optional[Union[List[SymbolInformation], List[WorkspaceSymbol]]]], None]]) –
- Return type:
Future
- async workspace_symbol_async(params)
Make a workspace/symbol request.
A request to list project-wide symbols matching the query string given by the
WorkspaceSymbolParams
. The response is of typeSymbolInformation SymbolInformation[]
or a Thenable that resolves to such.- LSP v3.17.0 - support for WorkspaceSymbol in the returned data. Clients
need to advertise support for WorkspaceSymbols via the client capability
workspace.symbol.resolveSupport
.
- Parameters:
params (WorkspaceSymbolParams) –
- Return type:
Optional[Union[List[SymbolInformation], List[WorkspaceSymbol]]]
- workspace_symbol_resolve(params, callback=None)
Make a workspaceSymbol/resolve request.
A request to resolve the range inside the workspace symbol’s location.
LSP v3.17.0
- Parameters:
params (WorkspaceSymbol) –
callback (Optional[Callable[[WorkspaceSymbol], None]]) –
- Return type:
Future
- async workspace_symbol_resolve_async(params)
Make a workspaceSymbol/resolve request.
A request to resolve the range inside the workspace symbol’s location.
LSP v3.17.0
- Parameters:
params (WorkspaceSymbol) –
- Return type:
- workspace_will_create_files(params, callback=None)
Make a workspace/willCreateFiles request.
The will create files request is sent from the client to the server before files are actually created as long as the creation is triggered from within the client.
The request can return a
WorkspaceEdit
which will be applied to workspace before the files are created. Hence theWorkspaceEdit
can not manipulate the content of the file to be created.LSP v3.16.0
- Parameters:
params (CreateFilesParams) –
callback (Optional[Callable[[Optional[WorkspaceEdit]], None]]) –
- Return type:
Future
- async workspace_will_create_files_async(params)
Make a workspace/willCreateFiles request.
The will create files request is sent from the client to the server before files are actually created as long as the creation is triggered from within the client.
The request can return a
WorkspaceEdit
which will be applied to workspace before the files are created. Hence theWorkspaceEdit
can not manipulate the content of the file to be created.LSP v3.16.0
- Parameters:
params (CreateFilesParams) –
- Return type:
- workspace_will_delete_files(params, callback=None)
Make a workspace/willDeleteFiles request.
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:
params (DeleteFilesParams) –
callback (Optional[Callable[[Optional[WorkspaceEdit]], None]]) –
- Return type:
Future
- async workspace_will_delete_files_async(params)
Make a workspace/willDeleteFiles request.
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:
params (DeleteFilesParams) –
- Return type:
- workspace_will_rename_files(params, callback=None)
Make a workspace/willRenameFiles request.
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:
params (RenameFilesParams) –
callback (Optional[Callable[[Optional[WorkspaceEdit]], None]]) –
- Return type:
Future
- async workspace_will_rename_files_async(params)
Make a workspace/willRenameFiles request.
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:
params (RenameFilesParams) –
- Return type:
- class pygls.client.JsonRPCClient(protocol_cls=<class 'pygls.protocol.json_rpc.JsonRPCProtocol'>, converter_factory=<function default_converter>)
Base JSON-RPC client.
- Parameters:
protocol_cls (Type[JsonRPCProtocol]) –
converter_factory (Callable[[], Converter]) –
- feature(feature_name, options=None)
Decorator used to register LSP features.
Example
import logging from pygls.client import JsonRPCClient ls = JsonRPCClient() @ls.feature('window/logMessage') def completions(ls, params): logging.info("%s", params.message)
- report_server_error(error, source)
Called when the server does something unexpected e.g. respond with malformed JSON.