From d9b1935a92f11fab92f2bb57ef5c02401c1badfe Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 22 May 2023 09:34:02 -0700 Subject: [PATCH] LSP update adds new TextDocument InlineCompletion request --- .../dotnet/dotnet_special_classes.py | 4 +- generator-plugins/python/utils.py | 11 +- generator-plugins/rust/rust_structs.py | 8 +- generator/lsp.json | 320 +++ packages/python/lsprotocol/types.py | 2222 ++++++++--------- packages/python/lsprotocol/validators.py | 3 +- packages/rust/lsprotocol/src/lib.rs | 242 +- tests/python/common/jsonrpc.py | 4 +- tests/python/test_cattrs_special_cases.py | 9 +- 9 files changed, 1573 insertions(+), 1250 deletions(-) diff --git a/generator-plugins/dotnet/dotnet_special_classes.py b/generator-plugins/dotnet/dotnet_special_classes.py index 4fe5234..97d5cde 100644 --- a/generator-plugins/dotnet/dotnet_special_classes.py +++ b/generator-plugins/dotnet/dotnet_special_classes.py @@ -17,7 +17,7 @@ def generate_special_classes(spec: model.LSPModel, types: TypeData) -> None: - """Generate code for special classes in LSP""" + """Generate code for special classes in LSP.""" for special_class in SPECIAL_CLASSES: for struct_def in spec.structures + spec.typeAliases: if struct_def.name == special_class: @@ -27,7 +27,7 @@ def generate_special_classes(spec: model.LSPModel, types: TypeData) -> None: def generate_special_class( struct_def: model.Structure, spec: model.LSPModel, types: TypeData ) -> Dict[str, str]: - """Generate code for a special class""" + """Generate code for a special class.""" lines: List[str] = [] if struct_def.name == "LSPObject": diff --git a/generator-plugins/python/utils.py b/generator-plugins/python/utils.py index 96aeb30..f69af69 100644 --- a/generator-plugins/python/utils.py +++ b/generator-plugins/python/utils.py @@ -63,8 +63,8 @@ def _generate_field_validator( def _to_class_name(lsp_method_name: str) -> str: - """Convert from LSP method name (e.g., textDocument/didSave) to python - class name (e.g., TextDocumentDidSave)""" + """Convert from LSP method name (e.g., textDocument/didSave) to python class name + (e.g., TextDocumentDidSave)""" name = lsp_method_name[2:] if lsp_method_name.startswith("$/") else lsp_method_name name = name.replace("/", "_") name = METHOD_NAME_RE_1.sub(r"\1_\2", name) @@ -77,8 +77,8 @@ def lines_to_str(lines: Union[Sequence[str], List[str]]) -> str: def _sanitize_comment(text: str) -> str: - """LSP spec comments can contain newlines or characters that should not be - used or can cause issues with python code clean them up.""" + """LSP spec comments can contain newlines or characters that should not be used or + can cause issues with python code clean them up.""" return text.replace("\r", "").replace("\n", "") @@ -137,8 +137,7 @@ def _capitalized_item_name(original: str) -> str: def _get_indented_documentation( documentation: Optional[str], indent: str = "" ) -> Optional[str]: - """Clean up doc string from LSP model and word wrap with correct indent - level.""" + """Clean up doc string from LSP model and word wrap with correct indent level.""" doc = ( indent.join(documentation.splitlines(keepends=True)) if documentation else None ) diff --git a/generator-plugins/rust/rust_structs.py b/generator-plugins/rust/rust_structs.py index c2fc015..571cd62 100644 --- a/generator-plugins/rust/rust_structs.py +++ b/generator-plugins/rust/rust_structs.py @@ -440,7 +440,9 @@ def generate_response( types.add_type_info(response_def, response_def.name, lines) -def generate_partial_result(request_def: model.Request, types: TypeData) -> None: +def generate_partial_result( + request_def: model.Request, types: TypeData, spec: model.LSPModel +) -> None: if not request_def.partialResult: return @@ -448,7 +450,9 @@ def generate_partial_result(request_def: model.Request, types: TypeData) -> None return -def generate_registration_options(request_def: model.Request, types: TypeData) -> None: +def generate_registration_options( + request_def: model.Request, types: TypeData, spec: model.LSPModel +) -> None: if not request_def.registrationOptions: return diff --git a/generator/lsp.json b/generator/lsp.json index cb7b199..7746def 100644 --- a/generator/lsp.json +++ b/generator/lsp.json @@ -975,6 +975,48 @@ "documentation": "The diagnostic refresh request definition.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "method": "textDocument/inlineCompletion", + "result": { + "kind": "or", + "items": [ + { + "kind": "reference", + "name": "InlineCompletionList" + }, + { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + { + "kind": "base", + "name": "null" + } + ] + }, + "messageDirection": "clientToServer", + "params": { + "kind": "reference", + "name": "InlineCompletionParams" + }, + "partialResult": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + "registrationOptions": { + "kind": "reference", + "name": "InlineCompletionRegistrationOptions" + }, + "documentation": "A request to provide inline completions in a document. The request's parameter is of\ntype {@link InlineCompletionParams}, the response is of type\n{@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "method": "client/registerCapability", "result": { @@ -4035,6 +4077,128 @@ "documentation": "The params sent in a close notebook document notification.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "InlineCompletionParams", + "properties": [ + { + "name": "context", + "type": { + "kind": "reference", + "name": "InlineCompletionContext" + }, + "documentation": "Additional information about the context in which inline completions were\nrequested." + } + ], + "extends": [ + { + "kind": "reference", + "name": "TextDocumentPositionParams" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressParams" + } + ], + "documentation": "A parameter literal used in inline completion requests.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionList", + "properties": [ + { + "name": "items", + "type": { + "kind": "array", + "element": { + "kind": "reference", + "name": "InlineCompletionItem" + } + }, + "documentation": "The inline completion items" + } + ], + "documentation": "Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionItem", + "properties": [ + { + "name": "insertText", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "string" + }, + { + "kind": "reference", + "name": "StringValue" + } + ] + }, + "documentation": "The text to replace the range with. Must be set." + }, + { + "name": "filterText", + "type": { + "kind": "base", + "name": "string" + }, + "optional": true, + "documentation": "A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used." + }, + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "optional": true, + "documentation": "The range to replace. Must begin and end on the same line." + }, + { + "name": "command", + "type": { + "kind": "reference", + "name": "Command" + }, + "optional": true, + "documentation": "An optional {@link Command} that is executed *after* inserting this completion." + } + ], + "documentation": "An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionRegistrationOptions", + "properties": [], + "extends": [ + { + "kind": "reference", + "name": "InlineCompletionOptions" + }, + { + "kind": "reference", + "name": "TextDocumentRegistrationOptions" + } + ], + "mixins": [ + { + "kind": "reference", + "name": "StaticRegistrationOptions" + } + ], + "documentation": "Inline completion options used during static or dynamic registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "RegistrationParams", "properties": [ @@ -7594,6 +7758,68 @@ "documentation": "A literal to identify a notebook document in the client.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "InlineCompletionContext", + "properties": [ + { + "name": "triggerKind", + "type": { + "kind": "reference", + "name": "InlineCompletionTriggerKind" + }, + "documentation": "Describes how the inline completion was triggered." + }, + { + "name": "selectedCompletionInfo", + "type": { + "kind": "reference", + "name": "SelectedCompletionInfo" + }, + "optional": true, + "documentation": "Provides information about the currently selected item in the autocomplete widget if it is visible." + } + ], + "documentation": "Provides information about the context in which an inline completion was requested.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "StringValue", + "properties": [ + { + "name": "kind", + "type": { + "kind": "stringLiteral", + "value": "snippet" + }, + "documentation": "The kind of string value." + }, + { + "name": "value", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The snippet string." + } + ], + "documentation": "A string value used as a snippet is a template which allows to insert text\nand to control the editor cursor when insertion happens.\n\nA snippet can define tab stops and placeholders with `$1`, `$2`\nand `${3:foo}`. `$0` defines the final tab stop, it defaults to\nthe end of the snippet. Variables are defined with `$name` and\n`${name:default value}`.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, + { + "name": "InlineCompletionOptions", + "mixins": [ + { + "kind": "reference", + "name": "WorkDoneProgressOptions" + } + ], + "properties": [], + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "Registration", "properties": [ @@ -8398,6 +8624,26 @@ "documentation": "The server has support for pull model diagnostics.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "inlineCompletionProvider", + "type": { + "kind": "or", + "items": [ + { + "kind": "base", + "name": "boolean" + }, + { + "kind": "reference", + "name": "InlineCompletionOptions" + } + ] + }, + "optional": true, + "documentation": "Inline completion options used during static registration.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "workspace", "type": { @@ -9671,6 +9917,30 @@ "documentation": "A change describing how to move a `NotebookCell`\narray from state S to S'.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "SelectedCompletionInfo", + "properties": [ + { + "name": "range", + "type": { + "kind": "reference", + "name": "Range" + }, + "documentation": "The range that will be replaced if this completion item is accepted." + }, + { + "name": "text", + "type": { + "kind": "base", + "name": "string" + }, + "documentation": "The text the range will be replaced with if this completion is accepted." + } + ], + "documentation": "Describes the currently selected completion item.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "ClientCapabilities", "properties": [ @@ -10606,6 +10876,17 @@ "optional": true, "documentation": "Capabilities specific to the diagnostic pull model.\n\n@since 3.17.0", "since": "3.17.0" + }, + { + "name": "inlineCompletion", + "type": { + "kind": "reference", + "name": "InlineCompletionClientCapabilities" + }, + "optional": true, + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true } ], "documentation": "Text document specific client capabilities." @@ -12430,6 +12711,23 @@ "documentation": "Client capabilities specific to diagnostic pull requests.\n\n@since 3.17.0", "since": "3.17.0" }, + { + "name": "InlineCompletionClientCapabilities", + "properties": [ + { + "name": "dynamicRegistration", + "type": { + "kind": "base", + "name": "boolean" + }, + "optional": true, + "documentation": "Whether implementation supports dynamic registration for inline completion providers." + } + ], + "documentation": "Client capabilities specific to inline completions.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "NotebookDocumentSyncClientCapabilities", "properties": [ @@ -13424,6 +13722,28 @@ ], "documentation": "Describes the content type that a client supports in various\nresult literals like `Hover`, `ParameterInfo` or `CompletionItem`.\n\nPlease note that `MarkupKinds` must not start with a `$`. This kinds\nare reserved for internal usage." }, + { + "name": "InlineCompletionTriggerKind", + "type": { + "kind": "base", + "name": "uinteger" + }, + "values": [ + { + "name": "Invoked", + "value": 0, + "documentation": "Completion was triggered explicitly by a user gesture." + }, + { + "name": "Automatic", + "value": 1, + "documentation": "Completion was triggered automatically while editing." + } + ], + "documentation": "Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.\n\n@since 3.18.0\n@proposed", + "since": "3.18.0", + "proposed": true + }, { "name": "PositionEncodingKind", "type": { diff --git a/packages/python/lsprotocol/types.py b/packages/python/lsprotocol/types.py index b81958d..fe427cf 100644 --- a/packages/python/lsprotocol/types.py +++ b/packages/python/lsprotocol/types.py @@ -20,8 +20,8 @@ @enum.unique class SemanticTokenTypes(str, enum.Enum): - """A set of predefined token types. This set is not fixed an clients can - specify additional token types via the corresponding client capabilities. + """A set of predefined token types. This set is not fixed an clients can specify + additional token types via the corresponding client capabilities. @since 3.16.0 """ @@ -31,8 +31,8 @@ class SemanticTokenTypes(str, enum.Enum): 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. + Acts as a fallback for types which can't be mapped to a specific type like class or + enum. """ Class = "class" Enum = "enum" @@ -61,9 +61,8 @@ class SemanticTokenTypes(str, enum.Enum): @enum.unique class SemanticTokenModifiers(str, enum.Enum): - """A set of predefined token modifiers. This set is not fixed an clients - can specify additional token types via the corresponding client - capabilities. + """A set of predefined token modifiers. This set is not fixed an clients can specify + additional token types via the corresponding client capabilities. @since 3.16.0 """ @@ -104,39 +103,38 @@ class ErrorCodes(int, enum.Enum): InvalidParams = -32602 InternalError = -32603 ServerNotInitialized = -32002 - """Error code indicating that a server received a notification or request - before the server has received the `initialize` request.""" + """Error code indicating that a server received a notification or request before the + server has received the `initialize` request.""" UnknownErrorCode = -32001 class LSPErrorCodes(int, enum.Enum): 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. + """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. @since 3.17.0 """ # Since: 3.17.0 ServerCancelled = -32802 - """The server cancelled the request. This error code should only be used - for requests that explicitly support being server cancellable. + """The server cancelled the request. This error code should only be used for + requests that explicitly support being server cancellable. @since 3.17.0 """ # Since: 3.17.0 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. + """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. + 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.""" + """The client has canceled a request and a server as detected the cancel.""" @enum.unique @@ -228,8 +226,8 @@ class MonikerKind(str, enum.Enum): Export = "export" """The moniker represents a symbol that is exported from 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, ...)""" + """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, ...)""" @enum.unique @@ -262,14 +260,13 @@ class MessageType(int, enum.Enum): @enum.unique class TextDocumentSyncKind(int, enum.Enum): - """Defines how the host (editor) should sync document changes to the - language server.""" + """Defines how the host (editor) should sync document changes to the language + server.""" None_ = 0 """Documents should not be synced at all.""" Full = 1 - """Documents are synced by always sending the full content of the - document.""" + """Documents are synced by always sending the full content of the document.""" Incremental = 2 """Documents are synced by sending the full content on open. @@ -282,8 +279,8 @@ class TextDocumentSaveReason(int, enum.Enum): """Represents reasons why a text document is saved.""" Manual = 1 - """Manually triggered, e.g. by the user pressing save, by starting - debugging, or by an API call.""" + """Manually triggered, e.g. by the user pressing save, by starting debugging, or by + an API call.""" AfterDelay = 2 """Automatic after a delay.""" FocusOut = 3 @@ -336,8 +333,8 @@ class CompletionItemTag(int, enum.Enum): @enum.unique class InsertTextFormat(int, enum.Enum): - """Defines whether the insert text in a completion item should be - interpreted as plain text or a snippet.""" + """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.""" @@ -356,8 +353,7 @@ class InsertTextFormat(int, enum.Enum): @enum.unique class InsertTextMode(int, enum.Enum): - """How whitespace and indentation is handled during completion item - insertion. + """How whitespace and indentation is handled during completion item insertion. @since 3.16.0 """ @@ -366,14 +362,13 @@ class InsertTextMode(int, enum.Enum): 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. + 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. """ 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. + """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><3tabs>foo. Accepting a multi line completion item is indented using 2 tabs and all @@ -467,11 +462,11 @@ class TraceValues(str, enum.Enum): @enum.unique class MarkupKind(str, enum.Enum): - """Describes the content type that a client supports in various result - literals like `Hover`, `ParameterInfo` or `CompletionItem`. + """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. + Please note that `MarkupKinds` must not start with a `$`. This kinds are reserved + for internal usage. """ PlainText = "plaintext" @@ -551,14 +546,13 @@ class DiagnosticTag(int, enum.Enum): Unnecessary = 1 """Unused or unnecessary code. - Clients are allowed to render diagnostics with this tag faded out - instead of having an error squiggle. + Clients are allowed to render diagnostics with this tag faded out instead of having + an error squiggle. """ Deprecated = 2 """Deprecated or obsolete code. - Clients are allowed to rendered diagnostics with this tag strike - through. + Clients are allowed to rendered diagnostics with this tag strike through. """ @@ -567,8 +561,8 @@ class CompletionTriggerKind(int, enum.Enum): """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.""" + """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`.""" @@ -589,8 +583,8 @@ class SignatureHelpTriggerKind(int, enum.Enum): TriggerCharacter = 2 """Signature help was triggered by a trigger character.""" ContentChange = 3 - """Signature help was triggered by the cursor moving or by the document - content changing.""" + """Signature help was triggered by the cursor moving or by the document content + changing.""" @enum.unique @@ -602,20 +596,18 @@ class CodeActionTriggerKind(int, enum.Enum): # Since: 3.17.0 Invoked = 1 - """Code actions were explicitly requested by the user or by an - extension.""" + """Code actions were explicitly requested by the user or by an extension.""" 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. + This typically happens when current selection in a file changes, but can also be + triggered when file content changes. """ @enum.unique class FileOperationPatternKind(str, enum.Enum): - """A pattern kind describing if a glob pattern matches a file a folder or - both. + """A pattern kind describing if a glob pattern matches a file a folder or both. @since 3.16.0 """ @@ -654,23 +646,23 @@ class ResourceOperationKind(str, enum.Enum): @enum.unique class FailureHandlingKind(str, enum.Enum): Abort = "abort" - """Applying the workspace change is simply aborted if one of the changes - provided fails. + """Applying the workspace change is simply aborted if one of the changes provided + fails. All operations executed before the failing operation stay executed. """ Transactional = "transactional" """All operations are executed transactional. - That means they either all succeed or no changes at all are applied - to the workspace. + That means they either all succeed or no changes at all are applied to the + workspace. """ TextOnlyTransactional = "textOnlyTransactional" - """If the workspace edit contains only textual file changes they are - executed transactional. + """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. + If resource changes (create, rename or delete file) are part of the change the + failure handling strategy is abort. """ Undo = "undo" """The client tries to undo the operations already executed. @@ -682,8 +674,8 @@ class FailureHandlingKind(str, enum.Enum): @enum.unique class PrepareSupportDefaultBehavior(int, enum.Enum): Identifier = 1 - """The client's default behavior is to select the identifier according the - to language's syntax rule.""" + """The client's default behavior is to select the identifier according the to + language's syntax rule.""" @enum.unique @@ -700,20 +692,19 @@ class TokenFormat(str, enum.Enum): Definition = Union["Location", List["Location"]] -"""The definition of a symbol represented as one or many {@link Location -locations}. For most programming languages there is only one location at which -a symbol is defined. +"""The definition of a symbol represented as one or many {@link 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. +Servers should prefer returning `DefinitionLink` over `Definition` if supported by the +client. """ DefinitionLink = Union["LocationLink", "LocationLink"] """Information about where a symbol is defined. -Provides additional metadata over normal {@link Location location} -definitions, including the range of the defining symbol +Provides additional metadata over normal {@link Location location} definitions, +including the range of the defining symbol """ @@ -726,10 +717,9 @@ class TokenFormat(str, enum.Enum): LSPAny = Union[Any, None] -"""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. +"""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. @since 3.17.0 """ @@ -744,11 +734,11 @@ class TokenFormat(str, enum.Enum): DeclarationLink = Union["LocationLink", "LocationLink"] """Information about where a symbol is declared. -Provides additional metadata over normal {@link Location location} -declarations, including the range of the declaring symbol. +Provides additional metadata over normal {@link Location location} declarations, +including the range of the declaring symbol. -Servers should prefer returning `DeclarationLink` over `Declaration` if -supported by the client. +Servers should prefer returning `DeclarationLink` over `Declaration` if supported by the +client. """ @@ -770,10 +760,10 @@ class TokenFormat(str, enum.Enum): DocumentDiagnosticReport = Union[ "RelatedFullDocumentDiagnosticReport", "RelatedUnchangedDocumentDiagnosticReport" ] -"""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. +"""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. @since 3.17.0 """ @@ -800,7 +790,8 @@ class PrepareRenameResult_Type2: DocumentSelector = List["DocumentFilter"] """A document selector is the combination of one or many document filters. -@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**/tsconfig.json' }]`; +@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', +pattern: '**/tsconfig.json' }]`; The use of a string as a document filter is deprecated @since 3.16.0. """ @@ -811,8 +802,7 @@ class PrepareRenameResult_Type2: ChangeAnnotationIdentifier = str -"""An identifier to refer to a change annotation stored with a workspace -edit.""" +"""An identifier to refer to a change annotation stored with a workspace edit.""" WorkspaceDocumentDiagnosticReport = Union[ @@ -854,8 +844,7 @@ class TextDocumentContentChangeEvent_Type2: ] """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. +If only a text is provided it is considered to be the full content of the document. """ @@ -867,12 +856,11 @@ class MarkedString_Type1: MarkedString = Union[str, "MarkedString_Type1"] -"""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. +"""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: ```${language} @@ -885,8 +873,7 @@ class MarkedString_Type1: DocumentFilter = Union["TextDocumentFilter", "NotebookCellTextDocumentFilter"] -"""A document filter describes a top level text document or a notebook cell -document. +"""A document filter describes a top level text document or a notebook cell document. @since 3.17.0 - proposed support for NotebookCellTextDocumentFilter. """ @@ -959,9 +946,8 @@ class TextDocumentFilter_Type3: "TextDocumentFilter_Type1", "TextDocumentFilter_Type2", "TextDocumentFilter_Type3" ] """A document filter denotes a document by different properties like the {@link -TextDocument.languageId language}, the {@link Uri.scheme scheme} of its -resource, or a glob-pattern that is applied to the {@link TextDocument.fileName -path}. +TextDocument.languageId language}, the {@link Uri.scheme scheme} of its resource, or a +glob-pattern that is applied to the {@link TextDocument.fileName path}. Glob patterns can have the following syntax: - `*` to match one or more characters in a path segment @@ -1038,9 +1024,8 @@ class NotebookDocumentFilter_Type3: "NotebookDocumentFilter_Type2", "NotebookDocumentFilter_Type3", ] -"""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) +"""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) @since 3.17.0 """ @@ -1065,8 +1050,8 @@ class NotebookDocumentFilter_Type3: @attrs.define class TextDocumentPositionParams: - """A parameter literal used in requests to pass a text document and a - position inside that document.""" + """A parameter literal used in requests to pass a text document and a position + inside that document.""" text_document: "TextDocumentIdentifier" = attrs.field() """The text document.""" @@ -1106,8 +1091,7 @@ class ImplementationParams: @attrs.define class Location: - """Represents a location inside a resource, such as a line inside a text - file.""" + """Represents a location inside a resource, such as a line inside a text file.""" uri: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -1131,8 +1115,7 @@ class TextDocumentRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ @@ -1162,8 +1145,7 @@ class StaticRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1174,8 +1156,7 @@ class ImplementationRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -1189,8 +1170,7 @@ class ImplementationRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1225,8 +1205,7 @@ class TypeDefinitionRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -1240,8 +1219,7 @@ class TypeDefinitionRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1261,8 +1239,7 @@ class WorkspaceFolder: @attrs.define class DidChangeWorkspaceFoldersParams: - """The parameters of a `workspace/didChangeWorkspaceFolders` - notification.""" + """The parameters of a `workspace/didChangeWorkspaceFolders` notification.""" event: "WorkspaceFoldersChangeEvent" = attrs.field() """The actual workspace folder change event.""" @@ -1316,8 +1293,7 @@ class DocumentColorRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -1331,8 +1307,7 @@ class DocumentColorRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1365,23 +1340,23 @@ class ColorPresentation: label: str = attrs.field(validator=attrs.validators.instance_of(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. + 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"] = attrs.field(default=None) - """An {@link TextEdit edit} which is applied to a document when selecting - this presentation for the color. + """An {@link TextEdit edit} which is applied to a document when selecting this + presentation for the color. When `falsy` the {@link ColorPresentation.label label} is used. """ additional_text_edits: Optional[List["TextEdit"]] = attrs.field(default=None) - """An optional array of additional {@link TextEdit text edits} that are - applied when selecting this color presentation. + """An optional array of additional {@link TextEdit text edits} that are applied when + selecting this color presentation. - Edits must not overlap with the main {@link - ColorPresentation.textEdit edit} nor with themselves. + Edits must not overlap with the main {@link ColorPresentation.textEdit edit} nor + with themselves. """ @@ -1404,25 +1379,22 @@ class FoldingRangeParams: class FoldingRange: """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. + 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. """ start_line: int = attrs.field(validator=validators.uinteger_validator) """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. + 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. """ end_line: int = attrs.field(validator=validators.uinteger_validator) """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. + 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. """ start_character: Optional[int] = attrs.field( @@ -1444,18 +1416,16 @@ class FoldingRange: kind: Optional[Union[FoldingRangeKind, str]] = attrs.field(default=None) """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 {@link FoldingRangeKind} for an - enumeration of standardized kinds. + The kind is used to categorize folding ranges and used by commands like 'Fold all + comments'. See {@link FoldingRangeKind} for an enumeration of standardized kinds. """ collapsed_text: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """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. + """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. @since 3.17.0 """ @@ -1477,8 +1447,7 @@ class FoldingRangeRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -1492,8 +1461,7 @@ class FoldingRangeRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1533,8 +1501,7 @@ class DeclarationRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ id: Optional[str] = attrs.field( @@ -1543,8 +1510,7 @@ class DeclarationRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1570,8 +1536,7 @@ class SelectionRangeParams: class SelectionRange: """A selection range represents a part of a selection hierarchy. - A selection range may have a parent selection range that contains - it. + A selection range may have a parent selection range that contains it. """ range: "Range" = attrs.field() @@ -1604,8 +1569,7 @@ class SelectionRangeRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ id: Optional[str] = attrs.field( @@ -1614,8 +1578,7 @@ class SelectionRangeRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1652,8 +1615,8 @@ class CallHierarchyPrepareParams: @attrs.define class CallHierarchyItem: - """Represents programming constructs like functions or constructors in the - context of call hierarchy. + """Represents programming constructs like functions or constructors in the context + of call hierarchy. @since 3.16.0 """ @@ -1670,12 +1633,12 @@ class CallHierarchyItem: """The resource identifier of this item.""" range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing - whitespace but everything else, e.g. comments and code.""" + """The range enclosing this symbol not including leading/trailing whitespace but + everything else, e.g. comments and code.""" selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this symbol is being - picked, e.g. the name of a function. + """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`}. """ @@ -1690,8 +1653,8 @@ class CallHierarchyItem: """More detail for this item, e.g. the signature of a function.""" data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a call hierarchy prepare - and incoming calls or outgoing calls requests.""" + """A data entry field that is preserved between a call hierarchy prepare and + incoming calls or outgoing calls requests.""" @attrs.define @@ -1723,8 +1686,7 @@ class CallHierarchyRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -1738,8 +1700,7 @@ class CallHierarchyRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1777,8 +1738,8 @@ class CallHierarchyIncomingCall: from_ranges: List["Range"] = attrs.field() """The ranges at which the calls appear. - This is relative to the caller denoted by {@link - CallHierarchyIncomingCall.from `this.from`}. + This is relative to the caller denoted by {@link CallHierarchyIncomingCall.from + `this.from`}. """ @@ -1803,8 +1764,8 @@ class CallHierarchyOutgoingCallsParams: @attrs.define class CallHierarchyOutgoingCall: - """Represents an outgoing call, e.g. calling a getter from a method or a - method from a constructor etc. + """Represents an outgoing call, e.g. calling a getter from a method or a method from + a constructor etc. @since 3.16.0 """ @@ -1855,10 +1816,9 @@ class SemanticTokens: ) """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. + 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. """ @@ -1890,8 +1850,7 @@ class SemanticTokensOptions: """The legend used by the server.""" range: Optional[Union[bool, Any]] = attrs.field(default=None) - """Server supports providing semantic tokens for a specific range of a - document.""" + """Server supports providing semantic tokens for a specific range of a document.""" full: Optional[Union[bool, "SemanticTokensOptionsFullType1"]] = attrs.field( default=None @@ -1927,13 +1886,11 @@ class SemanticTokensRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ range: Optional[Union[bool, Any]] = attrs.field(default=None) - """Server supports providing semantic tokens for a specific range of a - document.""" + """Server supports providing semantic tokens for a specific range of a document.""" full: Optional[ Union[bool, "SemanticTokensRegistrationOptionsFullType1"] @@ -1951,8 +1908,7 @@ class SemanticTokensRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -1968,8 +1924,8 @@ class SemanticTokensDeltaParams: previous_result_id: str = attrs.field(validator=attrs.validators.instance_of(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. + The result Id can either point to a full response or a delta response depending on + what was received last. """ work_done_token: Optional[ProgressToken] = attrs.field(default=None) @@ -1987,8 +1943,7 @@ class SemanticTokensDelta: # Since: 3.16.0 edits: List["SemanticTokensEdit"] = attrs.field() - """The semantic token edits to transform a previous result into a new - result.""" + """The semantic token edits to transform a previous result into a new result.""" result_id: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), @@ -2051,18 +2006,17 @@ class ShowDocumentParams: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """An optional property to indicate whether the editor showing the document - should take focus or not. + """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. + Clients might ignore this property if an external program is started. """ selection: Optional["Range"] = attrs.field(default=None) """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. + Clients might ignore the property if an external program is started or the file is + not a text file. """ @@ -2103,19 +2057,18 @@ class LinkedEditingRanges: ranges: List["Range"] = attrs.field() """A list of ranges that can be edited together. - The ranges must have identical length and contain identical text - content. The ranges cannot overlap. + The ranges must have identical length and contain identical text content. The ranges + cannot overlap. """ word_pattern: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """An optional word pattern (regular expression) that describes valid - contents for the given ranges. + """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. + If no pattern is provided, the client configuration's word pattern will be used. """ @@ -2134,8 +2087,7 @@ class LinkedEditingRangeRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -2149,15 +2101,14 @@ class LinkedEditingRangeRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @attrs.define class CreateFilesParams: - """The parameters sent in notifications/requests for user-initiated - creation of files. + """The parameters sent in notifications/requests for user-initiated creation of + files. @since 3.16.0 """ @@ -2170,10 +2121,10 @@ class CreateFilesParams: @attrs.define class WorkspaceEdit: - """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. + """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 @@ -2194,26 +2145,25 @@ class WorkspaceEdit: document_changes: Optional[ List[Union["TextDocumentEdit", "CreateFile", "RenameFile", "DeleteFile"]] ] = attrs.field(default=None) - """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. + """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. + `workspace.workspaceEdit.resourceOperations` then only plain `TextEdit`s using the + `changes` property are supported. """ change_annotations: Optional[ Dict[ChangeAnnotationIdentifier, "ChangeAnnotation"] ] = attrs.field(default=None) - """A map of change annotations that can be referenced in - `AnnotatedTextEdit`s or create, rename and delete file / folder operations. + """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`. @@ -2237,8 +2187,8 @@ class FileOperationRegistrationOptions: @attrs.define class RenameFilesParams: - """The parameters sent in notifications/requests for user-initiated renames - of files. + """The parameters sent in notifications/requests for user-initiated renames of + files. @since 3.16.0 """ @@ -2248,15 +2198,14 @@ class RenameFilesParams: files: List["FileRename"] = attrs.field() """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. + When a folder is renamed, only the folder will be included, and not its children. """ @attrs.define class DeleteFilesParams: - """The parameters sent in notifications/requests for user-initiated deletes - of files. + """The parameters sent in notifications/requests for user-initiated deletes of + files. @since 3.16.0 """ @@ -2301,8 +2250,8 @@ class Moniker: identifier: str = attrs.field(validator=attrs.validators.instance_of(str)) """The identifier of the moniker. - The value is opaque in LSIF however schema owners are allowed to - define the structure if they want. + The value is opaque in LSIF however schema owners are allowed to define the + structure if they want. """ unique: UniquenessLevel = attrs.field() @@ -2327,8 +2276,7 @@ class MonikerRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -2372,12 +2320,12 @@ class TypeHierarchyItem: """The resource identifier of this item.""" range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing - whitespace but everything else, e.g. comments and code.""" + """The range enclosing this symbol not including leading/trailing whitespace but + everything else, e.g. comments and code.""" selection_range: "Range" = attrs.field() - """The range that should be selected and revealed when this symbol is being - picked, e.g. the name of a function. + """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`}. """ @@ -2392,12 +2340,11 @@ class TypeHierarchyItem: """More detail for this item, e.g. the signature of a function.""" data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a type hierarchy prepare - and supertypes or subtypes requests. + """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. + It could also be used to identify the type hierarchy in the server, helping improve + the performance on resolving supertypes and subtypes. """ @@ -2430,8 +2377,7 @@ class TypeHierarchyRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -2445,8 +2391,7 @@ class TypeHierarchyRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -2545,8 +2490,7 @@ class InlineValueRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ id: Optional[str] = attrs.field( @@ -2555,8 +2499,7 @@ class InlineValueRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -2592,8 +2535,8 @@ class InlayHint: """The position of this hint.""" label: Union[str, List["InlayHintLabelPart"]] = attrs.field() - """The label of this hint. A human readable string or an array of - InlayHintLabelPart label parts. + """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. """ @@ -2601,16 +2544,15 @@ class InlayHint: kind: Optional[InlayHintKind] = attrs.field(default=None) """The kind of this hint. - Can be omitted in which case the client should fall back to a - reasonable default. + Can be omitted in which case the client should fall back to a reasonable default. """ text_edits: Optional[List["TextEdit"]] = attrs.field(default=None) """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. + *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"]] = attrs.field(default=None) @@ -2656,8 +2598,8 @@ class InlayHintOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for an - inlay hint item.""" + """The server provides support to resolve additional information for an inlay hint + item.""" work_done_progress: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -2678,8 +2620,8 @@ class InlayHintRegistrationOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for an - inlay hint item.""" + """The server provides support to resolve additional information for an inlay hint + item.""" work_done_progress: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -2691,8 +2633,7 @@ class InlayHintRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ id: Optional[str] = attrs.field( @@ -2701,8 +2642,7 @@ class InlayHintRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -2776,11 +2716,11 @@ class DiagnosticOptions: inter_file_dependencies: bool = attrs.field( validator=attrs.validators.instance_of(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. + """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. + Inter file dependencies are common for most programming languages and typically + uncommon for linters. """ workspace_diagnostics: bool = attrs.field( @@ -2792,8 +2732,7 @@ class DiagnosticOptions: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """An optional identifier under which the diagnostics are managed by the - client.""" + """An optional identifier under which the diagnostics are managed by the client.""" work_done_progress: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -2813,11 +2752,11 @@ class DiagnosticRegistrationOptions: inter_file_dependencies: bool = attrs.field( validator=attrs.validators.instance_of(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. + """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. + Inter file dependencies are common for most programming languages and typically + uncommon for linters. """ workspace_diagnostics: bool = attrs.field( @@ -2830,16 +2769,14 @@ class DiagnosticRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ identifier: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """An optional identifier under which the diagnostics are managed by the - client.""" + """An optional identifier under which the diagnostics are managed by the client.""" work_done_progress: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -2852,8 +2789,7 @@ class DiagnosticRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -2867,8 +2803,7 @@ class WorkspaceDiagnosticParams: # Since: 3.17.0 previous_result_ids: List["PreviousResultId"] = attrs.field() - """The currently known diagnostic reports with their previous result - ids.""" + """The currently known diagnostic reports with their previous result ids.""" identifier: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), @@ -2936,9 +2871,9 @@ class DidChangeNotebookDocumentParams: notebook_document: "VersionedNotebookDocumentIdentifier" = attrs.field() """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. + 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. """ change: "NotebookDocumentChangeEvent" = attrs.field() @@ -2984,8 +2919,8 @@ class DidCloseNotebookDocumentParams: """The notebook document that got closed.""" cell_text_documents: List["TextDocumentIdentifier"] = attrs.field() - """The text documents that represent the content of a notebook cell that - got closed.""" + """The text documents that represent the content of a notebook cell that got + closed.""" @attrs.define @@ -3020,8 +2955,8 @@ class _InitializeParams: process_id: Optional[Union[int, None]] = attrs.field(default=None) """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. + Is `null` if the process has not been started by another process. If the parent + process is not alive then the server should exit. """ client_info: Optional["InitializeParamsClientInfoType"] = attrs.field(default=None) @@ -3035,8 +2970,8 @@ class _InitializeParams: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """The locale the client is currently showing the user interface in. This - must not necessarily be the locale of the operating system. + """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) @@ -3052,8 +2987,8 @@ class _InitializeParams: """ root_uri: Optional[Union[str, None]] = attrs.field(default=None) - """The rootUri of the workspace. Is null if no folder is open. If both - `rootPath` and `rootUri` are set `rootUri` wins. + """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. """ @@ -3095,8 +3030,8 @@ class InitializeParams: process_id: Optional[Union[int, None]] = attrs.field(default=None) """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. + Is `null` if the process has not been started by another process. If the parent + process is not alive then the server should exit. """ client_info: Optional["InitializeParamsClientInfoType"] = attrs.field(default=None) @@ -3110,8 +3045,8 @@ class InitializeParams: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """The locale the client is currently showing the user interface in. This - must not necessarily be the locale of the operating system. + """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) @@ -3127,8 +3062,8 @@ class InitializeParams: """ root_uri: Optional[Union[str, None]] = attrs.field(default=None) - """The rootUri of the workspace. Is null if no folder is open. If both - `rootPath` and `rootUri` are set `rootUri` wins. + """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. """ @@ -3191,10 +3126,9 @@ class InitializeError: """The data type of the ResponseError if the initialize request fails.""" retry: bool = attrs.field(validator=attrs.validators.instance_of(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.""" + """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.""" @attrs.define @@ -3279,16 +3213,16 @@ class DidChangeTextDocumentParams: text_document: "VersionedTextDocumentIdentifier" = attrs.field() """The document that did change. - The version number points to the version after all provided content - changes have been applied. + The version number points to the version after all provided content changes have + been applied. """ content_changes: List[TextDocumentContentChangeEvent] = attrs.field() - """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'. + """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 @@ -3300,8 +3234,7 @@ class DidChangeTextDocumentParams: @attrs.define class TextDocumentChangeRegistrationOptions: - """Describe options to be used when registered for text document change - events.""" + """Describe options to be used when registered for text document change events.""" sync_kind: TextDocumentSyncKind = attrs.field() """How documents are synced to the server.""" @@ -3311,8 +3244,7 @@ class TextDocumentChangeRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ @@ -3337,8 +3269,7 @@ class DidSaveTextDocumentParams: ) """Optional the content when saved. - Depends on the includeText value when the save notification was - requested. + Depends on the includeText value when the save notification was requested. """ @@ -3362,8 +3293,7 @@ class TextDocumentSaveRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ include_text: Optional[bool] = attrs.field( @@ -3411,8 +3341,7 @@ class DidChangeWatchedFilesParams: @attrs.define class DidChangeWatchedFilesRegistrationOptions: - """Describe options to be used when registered for text document change - events.""" + """Describe options to be used when registered for text document change events.""" watchers: List["FileSystemWatcher"] = attrs.field() """The watchers to register.""" @@ -3431,8 +3360,7 @@ class PublishDiagnosticsParams: version: Optional[int] = attrs.field( validator=attrs.validators.optional(validators.integer_validator), default=None ) - """Optional the version number of the document the diagnostics are - published for. + """Optional the version number of the document the diagnostics are published for. @since 3.15.0 """ @@ -3452,9 +3380,8 @@ class CompletionParams: context: Optional["CompletionContext"] = attrs.field(default=None) """The completion context. - This is only available it the client specifies to send this using - the client capability `textDocument.completion.contextSupport === - true` + This is only available it the client specifies to send this using the client + capability `textDocument.completion.contextSupport === true` """ work_done_token: Optional[ProgressToken] = attrs.field(default=None) @@ -3467,17 +3394,17 @@ class CompletionParams: @attrs.define class CompletionItem: - """A completion item represents a text snippet that is proposed to complete - text that is being typed.""" + """A completion item represents a text snippet that is proposed to complete text + that is being typed.""" label: str = attrs.field(validator=attrs.validators.instance_of(str)) """The label of this completion item. - The label property is also by default the text that is inserted when - selecting this completion. + 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. + If label details are provided the label itself should be an unqualified name of the + completion item. """ label_details: Optional["CompletionItemLabelDetails"] = attrs.field(default=None) @@ -3504,8 +3431,8 @@ class CompletionItem: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """A human-readable string with additional information about this item, - like type or symbol information.""" + """A human-readable string with additional information about this item, like type or + symbol information.""" documentation: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) """A human-readable string that represents a doc-comment.""" @@ -3525,9 +3452,9 @@ class CompletionItem: ) """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. + *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] = attrs.field( @@ -3552,30 +3479,27 @@ class CompletionItem: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """A string that should be inserted into a document when selecting this - completion. When `falsy` the {@link CompletionItem.label label} is used. + """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` 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. + 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` 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] = attrs.field(default=None) - """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`. + """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`. + Please note that the insertTextFormat doesn't apply to `additionalTextEdits`. """ insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """How whitespace and indentation is handled during completion item - insertion. If not provided the clients default value depends on the + """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. @since 3.16.0 @@ -3585,9 +3509,9 @@ class CompletionItem: text_edit: Optional[Union[TextEdit, "InsertReplaceEdit"]] = attrs.field( default=None ) - """An {@link TextEdit edit} which is applied to a document when selecting - this completion. When an edit is provided the value of {@link - CompletionItem.insertText insertText} is ignored. + """An {@link TextEdit edit} which is applied to a document when selecting this + completion. When an edit is provided the value of {@link CompletionItem.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 @@ -3612,8 +3536,8 @@ class CompletionItem: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """The edit text used if the completion item is part of a CompletionList - and CompletionList defines an item default for the text edit range. + """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`. @@ -3626,37 +3550,34 @@ class CompletionItem: # Since: 3.17.0 additional_text_edits: Optional[List[TextEdit]] = attrs.field(default=None) - """An optional array of additional {@link TextEdit text edits} that are - applied when selecting this completion. Edits must not overlap (including - the same insert position) with the main {@link CompletionItem.textEdit - edit} nor with themselves. + """An optional array of additional {@link TextEdit text edits} that are applied when + selecting this completion. Edits must not overlap (including the same insert + position) with the main {@link CompletionItem.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). + 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). """ commit_characters: Optional[List[str]] = attrs.field(default=None) - """An optional set of characters that when pressed while this completion is - active will accept it first and then type that character. + """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. """ command: Optional["Command"] = attrs.field(default=None) - """An optional {@link Command command} that is executed *after* inserting - this completion. + """An optional {@link Command command} that is executed *after* inserting this + completion. - *Note* that - additional modifications to the current document should be described with the - {@link CompletionItem.additionalTextEdits additionalTextEdits}-property. + *Note* that additional modifications to the current document should be described + with the {@link CompletionItem.additionalTextEdits additionalTextEdits}-property. """ data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a completion item between a - {@link CompletionRequest} and a {@link CompletionResolveRequest}.""" + """A data entry field that is preserved on a completion item between a {@link + CompletionRequest} and a {@link CompletionResolveRequest}.""" @attrs.define @@ -3712,11 +3633,10 @@ class CompletionList: presented in the editor.""" is_incomplete: bool = attrs.field(validator=attrs.validators.instance_of(bool)) - """This list it not complete. Further typing results in recomputing this - list. + """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. + Recomputed lists have all their items replaced (not appended) in the incomplete + completion sessions. """ items: List[CompletionItem] = attrs.field() @@ -3725,10 +3645,10 @@ class CompletionList: item_defaults: Optional["CompletionListItemDefaultsType"] = attrs.field( default=None ) - """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. + """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. @@ -3749,8 +3669,7 @@ class CompletionOptionsCompletionItemType: default=None, ) """The server has support for completion item label details (see also - `CompletionItemLabelDetails`) when receiving a completion item in a resolve - call. + `CompletionItemLabelDetails`) when receiving a completion item in a resolve call. @since 3.17.0 """ @@ -3762,23 +3681,21 @@ class CompletionOptions: """Completion options.""" trigger_characters: Optional[List[str]] = attrs.field(default=None) - """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. + """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`. + If code complete should automatically be trigger on characters not being valid + inside an identifier (for example `.` in JavaScript) list them in + `triggerCharacters`. """ all_commit_characters: Optional[List[str]] = attrs.field(default=None) - """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.completion - Item.commitCharactersSupport` + """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.completion Item.commitCharactersSupport` If a server provides both `allCommitCharacters` and commit characters on an individual completion item the ones on the completion item win. @@ -3791,14 +3708,13 @@ class CompletionOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a - completion item.""" + """The server provides support to resolve additional information for a completion + item.""" completion_item: Optional["CompletionOptionsCompletionItemType"] = attrs.field( default=None ) - """The server supports the following `CompletionItem` specific - capabilities. + """The server supports the following `CompletionItem` specific capabilities. @since 3.17.0 """ @@ -3817,8 +3733,7 @@ class CompletionRegistrationOptionsCompletionItemType: default=None, ) """The server has support for completion item label details (see also - `CompletionItemLabelDetails`) when receiving a completion item in a resolve - call. + `CompletionItemLabelDetails`) when receiving a completion item in a resolve call. @since 3.17.0 """ @@ -3834,28 +3749,25 @@ class CompletionRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ trigger_characters: Optional[List[str]] = attrs.field(default=None) - """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. + """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`. + If code complete should automatically be trigger on characters not being valid + inside an identifier (for example `.` in JavaScript) list them in + `triggerCharacters`. """ all_commit_characters: Optional[List[str]] = attrs.field(default=None) - """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.completion - Item.commitCharactersSupport` + """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.completion Item.commitCharactersSupport` If a server provides both `allCommitCharacters` and commit characters on an individual completion item the ones on the completion item win. @@ -3868,14 +3780,13 @@ class CompletionRegistrationOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a - completion item.""" + """The server provides support to resolve additional information for a completion + item.""" completion_item: Optional[ "CompletionRegistrationOptionsCompletionItemType" ] = attrs.field(default=None) - """The server supports the following `CompletionItem` specific - capabilities. + """The server supports the following `CompletionItem` specific capabilities. @since 3.17.0 """ @@ -3909,8 +3820,8 @@ class Hover: """The hover's content.""" range: Optional["Range"] = attrs.field(default=None) - """An optional range inside the text document that is used to visualize the - hover, e.g. by changing the background color.""" + """An optional range inside the text document that is used to visualize the hover, + e.g. by changing the background color.""" @attrs.define @@ -3932,8 +3843,7 @@ class HoverRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -3953,9 +3863,9 @@ class SignatureHelpParams: """The position inside the text document.""" context: Optional["SignatureHelpContext"] = attrs.field(default=None) - """The signature help context. This is only available if the client - specifies to send this using the client capability - `textDocument.signatureHelp.contextSupport === true` + """The signature help context. This is only available if the client specifies to + send this using the client capability `textDocument.signatureHelp.contextSupport === + true` @since 3.15.0 """ @@ -3969,8 +3879,7 @@ class SignatureHelpParams: class SignatureHelp: """Signature help represents the signature of something callable. - There can be multiple signature but only one active and only one - active parameter. + There can be multiple signature but only one active and only one active parameter. """ signatures: List["SignatureInformation"] = attrs.field() @@ -3980,14 +3889,14 @@ class SignatureHelp: validator=attrs.validators.optional(validators.uinteger_validator), default=None ) """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. + `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. + 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. + In future version of the protocol this property might become mandatory to better + express this. """ active_parameter: Optional[int] = attrs.field( @@ -3996,11 +3905,10 @@ class SignatureHelp: """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. + `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. """ @@ -4036,8 +3944,7 @@ class SignatureHelpRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ trigger_characters: Optional[List[str]] = attrs.field(default=None) @@ -4096,8 +4003,7 @@ class DefinitionRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -4145,8 +4051,7 @@ class ReferenceRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -4175,19 +4080,18 @@ class DocumentHighlightParams: @attrs.define class DocumentHighlight: - """A document highlight is a range inside a text document which deserves - special attention. + """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. + Usually a document highlight is visualized by changing the background color of its + range. """ range: "Range" = attrs.field() """The range this highlight applies to.""" kind: Optional[DocumentHighlightKind] = attrs.field(default=None) - """The highlight kind, default is {@link DocumentHighlightKind.Text - text}.""" + """The highlight kind, default is {@link DocumentHighlightKind.Text text}.""" @attrs.define @@ -4209,8 +4113,7 @@ class DocumentHighlightRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -4257,27 +4160,25 @@ class BaseSymbolInformation: ) """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. + 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. """ @attrs.define class SymbolInformation: - """Represents information about programming constructs like variables, - classes, interfaces etc.""" + """Represents information about programming constructs like variables, classes, + interfaces etc.""" location: Location = attrs.field() - """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 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. + 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 = attrs.field(validator=attrs.validators.instance_of(str)) @@ -4308,16 +4209,15 @@ class SymbolInformation: ) """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. + 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. """ @attrs.define class DocumentSymbol: - """Represents programming constructs like variables, classes, interfaces - etc. + """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 @@ -4328,24 +4228,24 @@ class DocumentSymbol: name: str = attrs.field(validator=attrs.validators.instance_of(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. + Will be displayed in the user interface and therefore must not be an empty string or + a string only consisting of white spaces. """ kind: SymbolKind = attrs.field() """The kind of this symbol.""" range: "Range" = attrs.field() - """The range enclosing this symbol not including leading/trailing - whitespace but everything else like comments. + """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. + 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" = attrs.field() - """The range that should be selected and revealed when this symbol is being - picked, e.g the name of a function. + """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`. """ @@ -4384,8 +4284,8 @@ class DocumentSymbolOptions: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """A human-readable string that is shown when multiple outlines trees are - shown for the same document. + """A human-readable string that is shown when multiple outlines trees are shown for + the same document. @since 3.16.0 """ @@ -4406,16 +4306,15 @@ class DocumentSymbolRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ label: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """A human-readable string that is shown when multiple outlines trees are - shown for the same document. + """A human-readable string that is shown when multiple outlines trees are shown for + the same document. @since 3.16.0 """ @@ -4452,9 +4351,9 @@ class CodeActionParams: class Command: """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. + 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. """ title: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -4478,12 +4377,11 @@ class CodeActionDisabledType: @attrs.define class CodeAction: - """A code action represents a change that can be performed in code, e.g. to - fix a problem or to refactor code. + """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. + A CodeAction must set either `edit` and/or a `command`. If both are supplied, the + `edit` is applied first, then the `command` is executed. """ title: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -4502,8 +4400,8 @@ class CodeAction: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Marks this as a preferred action. Preferred actions are used by the - `auto fix` command and can be targeted by keybindings. + """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. @@ -4537,8 +4435,8 @@ class CodeAction: command: Optional[Command] = attrs.field(default=None) """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. + If a code action provides an edit and a command, first the edit is executed and then + the command. """ data: Optional[LSPAny] = attrs.field(default=None) @@ -4559,16 +4457,15 @@ class CodeActionOptions: ) """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. + 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] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a code - action. + """The server provides support to resolve additional information for a code action. @since 3.16.0 """ @@ -4589,8 +4486,7 @@ class CodeActionRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ code_action_kinds: Optional[List[Union[CodeActionKind, str]]] = attrs.field( @@ -4598,16 +4494,15 @@ class CodeActionRegistrationOptions: ) """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. + 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] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a code - action. + """The server provides support to resolve additional information for a code action. @since 3.16.0 """ @@ -4654,9 +4549,8 @@ class WorkspaceSymbol: # Since: 3.17.0 location: Union[Location, "WorkspaceSymbolLocationType1"] = attrs.field() - """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`. + """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. """ @@ -4668,8 +4562,8 @@ class WorkspaceSymbol: """The kind of this symbol.""" data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a workspace symbol between a - workspace symbol request and a workspace symbol resolve request.""" + """A data entry field that is preserved on a workspace symbol between a workspace + symbol request and a workspace symbol resolve request.""" tags: Optional[List[SymbolTag]] = attrs.field(default=None) """Tags for this symbol. @@ -4684,9 +4578,9 @@ class WorkspaceSymbol: ) """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. + 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. """ @@ -4698,8 +4592,8 @@ class WorkspaceSymbolOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a - workspace symbol. + """The server provides support to resolve additional information for a workspace + symbol. @since 3.17.0 """ @@ -4719,8 +4613,8 @@ class WorkspaceSymbolRegistrationOptions: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The server provides support to resolve additional information for a - workspace symbol. + """The server provides support to resolve additional information for a workspace + symbol. @since 3.17.0 """ @@ -4749,13 +4643,11 @@ class CodeLensParams: @attrs.define class CodeLens: - """A code lens represents a {@link Command command} that should be shown - along with source text, like the number of references, a way to run tests, - etc. + """A code lens represents a {@link 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. + 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. """ range: "Range" = attrs.field() @@ -4768,9 +4660,8 @@ class CodeLens: """The command this code lens represents.""" data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved on a code lens item between a - {@link CodeLensRequest} and a [CodeLensResolveRequest] - (#CodeLensResolveRequest)""" + """A data entry field that is preserved on a code lens item between a {@link + CodeLensRequest} and a [CodeLensResolveRequest] (#CodeLensResolveRequest)""" @attrs.define @@ -4798,8 +4689,7 @@ class CodeLensRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ resolve_provider: Optional[bool] = attrs.field( @@ -4831,8 +4721,8 @@ class DocumentLinkParams: @attrs.define class DocumentLink: - """A document link is a range in a text document that links to an internal - or external resource, like another text document or a web site.""" + """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.""" range: "Range" = attrs.field() """The range this link applies to.""" @@ -4890,8 +4780,7 @@ class DocumentLinkRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ resolve_provider: Optional[bool] = attrs.field( @@ -4939,8 +4828,7 @@ class DocumentFormattingRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -4985,8 +4873,7 @@ class DocumentRangeFormattingRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ work_done_progress: Optional[bool] = attrs.field( @@ -5005,17 +4892,16 @@ class DocumentOnTypeFormattingParams: position: "Position" = attrs.field() """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. + This is not necessarily the exact position where the character denoted by the + property `ch` got typed. """ ch: str = attrs.field(validator=attrs.validators.instance_of(str)) - """The character that has been typed that triggered the formatting on type - request. + """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). + 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" = attrs.field() @@ -5049,8 +4935,7 @@ class DocumentOnTypeFormattingRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ more_trigger_character: Optional[List[str]] = attrs.field(default=None) @@ -5070,8 +4955,8 @@ class RenameParams: new_name: str = attrs.field(validator=attrs.validators.instance_of(str)) """The new name of the symbol. - If the given name is not valid the request must return a {@link - ResponseError} with an appropriate message set. + If the given name is not valid the request must return a {@link ResponseError} with + an appropriate message set. """ work_done_token: Optional[ProgressToken] = attrs.field(default=None) @@ -5107,8 +4992,7 @@ class RenameRegistrationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ prepare_provider: Optional[bool] = attrs.field( @@ -5192,8 +5076,8 @@ class ApplyWorkspaceEditParams: ) """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. + This label is presented in the user interface for example on an undo stack to undo + the workspace edit. """ @@ -5215,26 +5099,26 @@ class ApplyWorkspaceEditResult: ) """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. + This may be used by the server for diagnostic logging or to provide a suitable error + for a request that triggered the edit. """ failed_change: Optional[int] = attrs.field( validator=attrs.validators.optional(validators.uinteger_validator), default=None ) - """Depending on the client's failure handling strategy `failedChange` might - contain the index of the change that failed. + """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. + This property is only available if the client signals a `failureHandlingStrategy` in + its client capabilities. """ @attrs.define class WorkDoneProgressBegin: title: str = attrs.field(validator=attrs.validators.instance_of(str)) - """Mandatory title of the progress operation. Used to briefly inform about - the kind of operation being performed. + """Mandatory title of the progress operation. Used to briefly inform about the kind + of operation being performed. Examples: "Indexing" or "Linking dependencies". """ @@ -5245,19 +5129,18 @@ class WorkDoneProgressBegin: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Controls if a cancel button should show to allow the user to cancel the - long running operation. + """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. + Clients that don't support cancellation are allowed to ignore the setting. """ message: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """Optional, more detailed associated progress message. Contains - complementary information to the `title`. + """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. @@ -5266,13 +5149,12 @@ class WorkDoneProgressBegin: percentage: Optional[int] = attrs.field( validator=attrs.validators.optional(validators.uinteger_validator), default=None ) - """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. + """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]. + The value should be steadily rising. Clients are free to ignore values that are not + following this rule. The value range is [0, 100]. """ @@ -5288,16 +5170,16 @@ class WorkDoneProgressReport: ) """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. + Clients that don't support cancellation or don't support controlling the button's + enablement state are allowed to ignore the property. """ message: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """Optional, more detailed associated progress message. Contains - complementary information to the `title`. + """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. @@ -5306,12 +5188,12 @@ class WorkDoneProgressReport: percentage: Optional[int] = attrs.field( validator=attrs.validators.optional(validators.uinteger_validator), default=None ) - """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. + """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] + The value should be steadily rising. Clients are free to ignore values that are not + following this rule. The value range is [0, 100] """ @@ -5323,8 +5205,8 @@ class WorkDoneProgressEnd: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """Optional, a final message indicating to for example indicate the outcome - of the operation.""" + """Optional, a final message indicating to for example indicate the outcome of the + operation.""" @attrs.define @@ -5361,8 +5243,8 @@ class ProgressParams: class LocationLink: """Represents the connection of two locations. - Provides additional metadata over normal {@link Location locations}, - including an origin range. + Provides additional metadata over normal {@link Location locations}, including an + origin range. """ target_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -5371,32 +5253,29 @@ class LocationLink: target_range: "Range" = attrs.field() """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. + 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" = attrs.field() - """The range that should be selected and revealed when this link is being - followed, e.g the name of a function. + """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` + Must be contained by the `targetRange`. See also `DocumentSymbol#range` """ origin_selection_range: Optional["Range"] = attrs.field(default=None) """Span of the origin of this link. - Used as the underlined span for mouse interaction. Defaults to the - word range at the definition position. + Used as the underlined span for mouse interaction. Defaults to the word range at the + definition position. """ @attrs.define class Range: - """A range in a text document expressed as (zero-based) start and end - positions. + """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. @@ -5512,19 +5391,18 @@ class Position: line: int = attrs.field(validator=validators.uinteger_validator) """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. + 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. """ character: int = attrs.field(validator=validators.uinteger_validator) """Character offset on a line in a document (zero-based). - The meaning of this offset is determined by the negotiated - `PositionEncodingKind`. + 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. + If the character value is greater than the line length it defaults back to the line + length. """ def __eq__(self, o: object) -> bool: @@ -5574,11 +5452,10 @@ class FileCreate: class TextDocumentEdit: """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. + 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. """ text_document: "OptionalVersionedTextDocumentIdentifier" = attrs.field() @@ -5699,8 +5576,8 @@ class ChangeAnnotation: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """A flag which indicates that user confirmation is needed before applying - the change.""" + """A flag which indicates that user confirmation is needed before applying the + change.""" description: Optional[str] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(str)), @@ -5712,8 +5589,8 @@ class ChangeAnnotation: @attrs.define class FileOperationFilter: - """A filter to describe in which file operation requests or notifications - the server is interested in receiving. + """A filter to describe in which file operation requests or notifications the server + is interested in receiving. @since 3.16.0 """ @@ -5740,8 +5617,7 @@ class FileRename: # Since: 3.16.0 old_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A file:// URI for the original location of the file/folder being - renamed.""" + """A file:// URI for the original location of the file/folder being renamed.""" new_uri: str = attrs.field(validator=attrs.validators.instance_of(str)) """A file:// URI for the new location of the file/folder being renamed.""" @@ -5772,8 +5648,8 @@ class InlineValueContext: stopped_location: Range = attrs.field() """The document range where execution has stopped. - Typically the end position of the range denotes the line where the - inline values are shown. + Typically the end position of the range denotes the line where the inline values are + shown. """ @@ -5795,10 +5671,9 @@ class InlineValueText: @attrs.define class InlineValueVariableLookup: - """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. + """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. @since 3.17.0 """ @@ -5808,8 +5683,7 @@ class InlineValueVariableLookup: range: Range = attrs.field() """The document range for which the inline value applies. - The range is used to extract the variable name from the underlying - document. + The range is used to extract the variable name from the underlying document. """ case_sensitive_lookup: bool = attrs.field( @@ -5826,10 +5700,9 @@ class InlineValueVariableLookup: @attrs.define class InlineValueEvaluatableExpression: - """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. + """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. @since 3.17.0 """ @@ -5839,8 +5712,8 @@ class InlineValueEvaluatableExpression: range: Range = attrs.field() """The document range for which the inline value applies. - The range is used to extract the evaluatable expression from the - underlying document. + The range is used to extract the evaluatable expression from the underlying + document. """ expression: Optional[str] = attrs.field( @@ -5852,8 +5725,8 @@ class InlineValueEvaluatableExpression: @attrs.define class InlayHintLabelPart: - """An inlay hint label part allows for interactive and composite labels of - inlay hints. + """An inlay hint label part allows for interactive and composite labels of inlay + hints. @since 3.17.0 """ @@ -5866,8 +5739,8 @@ class InlayHintLabelPart: tooltip: Optional[Union[str, "MarkupContent"]] = attrs.field(default=None) """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. + Depending on the client capability `inlayHint.resolveSupport` clients might resolve + this property late using the resolve request. """ location: Optional[Location] = attrs.field(default=None) @@ -5886,16 +5759,16 @@ class InlayHintLabelPart: command: Optional[Command] = attrs.field(default=None) """An optional command for this label part. - Depending on the client capability `inlayHint.resolveSupport` - clients might resolve this property late using the resolve request. + Depending on the client capability `inlayHint.resolveSupport` clients might resolve + this property late using the resolve request. """ @attrs.define class MarkupContent: - """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. + """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 @@ -5946,8 +5819,7 @@ class FullDocumentDiagnosticReport: ) """An optional result id. - If provided it will be sent on the next diagnostic request for the - same document. + If provided it will be sent on the next diagnostic request for the same document. """ @@ -5969,11 +5841,10 @@ class RelatedFullDocumentDiagnosticReport: Union[FullDocumentDiagnosticReport, "UnchangedDocumentDiagnosticReport"], ] ] = attrs.field(default=None) - """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. + """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. @since 3.17.0 """ @@ -5988,15 +5859,13 @@ class RelatedFullDocumentDiagnosticReport: ) """An optional result id. - If provided it will be sent on the next diagnostic request for the - same document. + If provided it will be sent on the next diagnostic request for the same document. """ @attrs.define class UnchangedDocumentDiagnosticReport: - """A diagnostic report indicating that the last returned report is still - accurate. + """A diagnostic report indicating that the last returned report is still accurate. @since 3.17.0 """ @@ -6004,8 +5873,8 @@ class UnchangedDocumentDiagnosticReport: # Since: 3.17.0 result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next diagnostic request for the - same document.""" + """A result id which will be sent on the next diagnostic request for the same + document.""" kind: str = attrs.field( validator=attrs.validators.in_(["unchanged"]), default="unchanged" @@ -6026,19 +5895,18 @@ class RelatedUnchangedDocumentDiagnosticReport: # Since: 3.17.0 result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next diagnostic request for the - same document.""" + """A result id which will be sent on the next diagnostic request for the same + document.""" related_documents: Optional[ Dict[ str, Union[FullDocumentDiagnosticReport, UnchangedDocumentDiagnosticReport] ] ] = attrs.field(default=None) - """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. + """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. @since 3.17.0 """ @@ -6202,8 +6070,7 @@ class NotebookDocumentIdentifier: @attrs.define class Registration: - """General parameters to register for a notification or to register a - provider.""" + """General parameters to register for a notification or to register a provider.""" id: str = attrs.field(validator=attrs.validators.instance_of(str)) """The id used to register the request. @@ -6244,8 +6111,7 @@ class ServerCapabilitiesWorkspaceType: # Since: 3.6.0 file_operations: Optional["FileOperationOptions"] = attrs.field(default=None) - """The server is interested in notifications/requests for operations on - files. + """The server is interested in notifications/requests for operations on files. @since 3.16.0 """ @@ -6259,8 +6125,8 @@ class ServerCapabilities: position_encoding: Optional[Union[PositionEncodingKind, str]] = attrs.field( default=None ) - """The position encoding the server picked from the encodings offered by - the client via the client capability `general.positionEncodings`. + """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'. @@ -6276,8 +6142,8 @@ class ServerCapabilities: ] = attrs.field(default=None) """Defines how text documents are synced. - Is either a detailed structure defining each notification or for - backwards compatibility the TextDocumentSyncKind number. + Is either a detailed structure defining each notification or for backwards + compatibility the TextDocumentSyncKind number. """ notebook_document_sync: Optional[ @@ -6338,9 +6204,8 @@ class ServerCapabilities: ) """The server provides code actions. - CodeActionOptions may only be specified if the client states that it - supports `codeActionLiteralSupport` in its initial `initialize` - request. + CodeActionOptions may only be specified if the client states that it supports + `codeActionLiteralSupport` in its initial `initialize` request. """ code_lens_provider: Optional[CodeLensOptions] = attrs.field(default=None) @@ -6377,8 +6242,8 @@ class ServerCapabilities: rename_provider: Optional[Union[bool, RenameOptions]] = attrs.field(default=None) """The server provides rename support. - RenameOptions may only be specified if the client states that it - supports `prepareSupport` in its initial `initialize` request. + RenameOptions may only be specified if the client states that it supports + `prepareSupport` in its initial `initialize` request. """ folding_range_provider: Optional[ @@ -6477,8 +6342,7 @@ class ServerCapabilities: @attrs.define class VersionedTextDocumentIdentifier: - """A text document identifier to denote a specific version of a text - document.""" + """A text document identifier to denote a specific version of a text document.""" version: int = attrs.field(validator=validators.integer_validator) """The version number of this document.""" @@ -6501,8 +6365,7 @@ class FileEvent: @attrs.define class FileSystemWatcher: glob_pattern: GlobPattern = attrs.field() - """The glob pattern to watch. See {@link GlobPattern glob pattern} for more - detail. + """The glob pattern to watch. See {@link GlobPattern glob pattern} for more detail. @since 3.17.0 support for relative patterns. """ @@ -6511,8 +6374,8 @@ class FileSystemWatcher: kind: Optional[Union[WatchKind, int]] = attrs.field(default=None) """The kind of events of interest. - If omitted it defaults to WatchKind.Create | WatchKind.Change | - WatchKind.Delete which is 7. + If omitted it defaults to WatchKind.Create | WatchKind.Change | WatchKind.Delete + which is 7. """ @@ -6535,16 +6398,16 @@ class Diagnostic: severity: Optional[DiagnosticSeverity] = attrs.field(default=None) """The diagnostic's severity. - Can be omitted. If omitted it is up to the client to interpret - diagnostics as error, warning, info or hint. + Can be omitted. If omitted it is up to the client to interpret diagnostics as error, + warning, info or hint. """ code: Optional[Union[int, str]] = attrs.field(default=None) """The diagnostic's code, which usually appear in the user interface.""" code_description: Optional["CodeDescription"] = attrs.field(default=None) - """An optional property to describe the error code. Requires the code field - (above) to be present/not null. + """An optional property to describe the error code. Requires the code field (above) + to be present/not null. @since 3.16.0 """ @@ -6570,13 +6433,12 @@ class Diagnostic: related_information: Optional[List["DiagnosticRelatedInformation"]] = attrs.field( default=None ) - """An array of related diagnostic information, e.g. when symbol-names - within a scope collide all definitions can be marked via this property.""" + """An array of related diagnostic information, e.g. when symbol-names within a scope + collide all definitions can be marked via this property.""" data: Optional[LSPAny] = attrs.field(default=None) - """A data entry field that is preserved between a - `textDocument/publishDiagnostics` notification and - `textDocument/codeAction` request. + """A data entry field that is preserved between a `textDocument/publishDiagnostics` + notification and `textDocument/codeAction` request. @since 3.16.0 """ @@ -6585,8 +6447,8 @@ class Diagnostic: @attrs.define class CompletionContext: - """Contains additional information about the context in which a completion - request is triggered.""" + """Contains additional information about the context in which a completion request + is triggered.""" trigger_kind: CompletionTriggerKind = attrs.field() """How the completion was triggered.""" @@ -6595,11 +6457,9 @@ class CompletionContext: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """The trigger character (a single character) that has trigger code - complete. + """The trigger character (a single character) that has trigger code complete. - Is undefined if `triggerKind !== - CompletionTriggerKind.TriggerCharacter` + Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter` """ @@ -6616,8 +6476,8 @@ class CompletionItemLabelDetails: validator=attrs.validators.optional(attrs.validators.instance_of(str)), default=None, ) - """An optional string which is rendered less prominently directly after - {@link CompletionItem.label label}, without any spacing. + """An optional string which is rendered less prominently directly after {@link + CompletionItem.label label}, without any spacing. Should be used for function signatures and type annotations. """ @@ -6654,8 +6514,8 @@ class InsertReplaceEdit: @attrs.define class SignatureHelpContext: - """Additional information about the context in which a signature help - request was triggered. + """Additional information about the context in which a signature help request was + triggered. @since 3.15.0 """ @@ -6668,9 +6528,9 @@ class SignatureHelpContext: is_retrigger: bool = attrs.field(validator=attrs.validators.instance_of(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. + 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] = attrs.field( @@ -6679,16 +6539,14 @@ class SignatureHelpContext: ) """Character that caused signature help to be triggered. - This is undefined when `triggerKind !== - SignatureHelpTriggerKind.TriggerCharacter` + This is undefined when `triggerKind !== SignatureHelpTriggerKind.TriggerCharacter` """ active_signature_help: Optional[SignatureHelp] = attrs.field(default=None) """The currently active `SignatureHelp`. - The `activeSignatureHelp` has its `SignatureHelp.activeSignature` - field updated based on the user navigating through available - signatures. + The `activeSignatureHelp` has its `SignatureHelp.activeSignature` field updated + based on the user navigating through available signatures. """ @@ -6696,8 +6554,8 @@ class SignatureHelpContext: class SignatureInformation: """Represents the signature of something callable. - A signature can have a label, like a function-name, a doc-comment, - and a set of parameters. + A signature can have a label, like a function-name, a doc-comment, and a set of + parameters. """ label: str = attrs.field(validator=attrs.validators.instance_of(str)) @@ -6729,8 +6587,7 @@ class SignatureInformation: @attrs.define class ReferenceContext: - """Value-object that contains additional information when requesting - references.""" + """Value-object that contains additional information when requesting references.""" include_declaration: bool = attrs.field( validator=attrs.validators.instance_of(bool) @@ -6740,25 +6597,24 @@ class ReferenceContext: @attrs.define class CodeActionContext: - """Contains additional diagnostic information about the context in which a - {@link CodeActionProvider.provideCodeActions code action} is run.""" + """Contains additional diagnostic information about the context in which a {@link + CodeActionProvider.provideCodeActions code action} is run.""" diagnostics: List[Diagnostic] = attrs.field() - """An array of diagnostics known on the client side overlapping the range - provided to the `textDocument/codeAction` request. + """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. + 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]]] = attrs.field(default=None) """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. + Actions not of this kind are filtered out by the client before being shown. So + servers can omit computing them. """ trigger_kind: Optional[CodeActionTriggerKind] = attrs.field(default=None) @@ -6825,8 +6681,8 @@ class SemanticTokensLegend: @attrs.define class OptionalVersionedTextDocumentIdentifier: - """A text document identifier to optionally denote a specific version of a - text document.""" + """A text document identifier to optionally denote a specific version of a text + document.""" uri: str = attrs.field(validator=attrs.validators.instance_of(str)) """The text document's uri.""" @@ -6834,11 +6690,10 @@ class OptionalVersionedTextDocumentIdentifier: version: Optional[Union[int, None]] = attrs.field(default=None) """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). + 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). """ @@ -6926,8 +6781,8 @@ class DeleteFileOptions: @attrs.define class FileOperationPattern: - """A pattern to describe in which file operation requests or notifications - the server is interested in receiving. + """A pattern to describe in which file operation requests or notifications the + server is interested in receiving. @since 3.16.0 """ @@ -6985,15 +6840,13 @@ class WorkspaceFullDocumentDiagnosticReport: ) """An optional result id. - If provided it will be sent on the next diagnostic request for the - same document. + If provided it will be sent on the next diagnostic request for the same document. """ @attrs.define class WorkspaceUnchangedDocumentDiagnosticReport: - """An unchanged document diagnostic report for a workspace diagnostic - result. + """An unchanged document diagnostic report for a workspace diagnostic result. @since 3.17.0 """ @@ -7004,8 +6857,8 @@ class WorkspaceUnchangedDocumentDiagnosticReport: """The URI for which diagnostic information is reported.""" result_id: str = attrs.field(validator=attrs.validators.instance_of(str)) - """A result id which will be sent on the next diagnostic request for the - same document.""" + """A result id which will be sent on the next diagnostic request for the same + document.""" version: Optional[Union[int, None]] = attrs.field(default=None) """The version number for which the diagnostics are reported. @@ -7053,8 +6906,7 @@ class NotebookCell: @attrs.define class NotebookCellArrayChange: - """A change describing how to move a `NotebookCell` array from state S to - S'. + """A change describing how to move a `NotebookCell` array from state S to S'. @since 3.17.0 """ @@ -7158,8 +7010,8 @@ class NotebookDocumentSyncOptionsNotebookSelectorType1CellsType: @attrs.define class NotebookDocumentSyncOptionsNotebookSelectorType1: notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string value is provided it matches - against the notebook type. + """The notebook to be synced If a string value is provided it matches against the + notebook type. '*' matches every notebook. """ @@ -7183,8 +7035,8 @@ class NotebookDocumentSyncOptionsNotebookSelectorType2: """The cells of the matching notebook to be synced.""" notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string value is provided it matches - against the notebook type. + """The notebook to be synced If a string value is provided it matches against the + notebook type. '*' matches every notebook. """ @@ -7192,8 +7044,7 @@ class NotebookDocumentSyncOptionsNotebookSelectorType2: @attrs.define class NotebookDocumentSyncOptions: - """Options specific to a notebook plus its cells to be synced to the - server. + """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 @@ -7235,8 +7086,8 @@ class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1CellsType: @attrs.define class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType1: notebook: Union[str, NotebookDocumentFilter] = attrs.field() - """The notebook to be synced If a string value is provided it matches - against the notebook type. + """The notebook to be synced If a string value is provided it matches against the + notebook type. '*' matches every notebook. """ @@ -7260,8 +7111,8 @@ class NotebookDocumentSyncRegistrationOptionsNotebookSelectorType2: """The cells of the matching notebook to be synced.""" notebook: Optional[Union[str, NotebookDocumentFilter]] = attrs.field(default=None) - """The notebook to be synced If a string value is provided it matches - against the notebook type. + """The notebook to be synced If a string value is provided it matches against the + notebook type. '*' matches every notebook. """ @@ -7299,8 +7150,7 @@ class NotebookDocumentSyncRegistrationOptions: ) """The id used to register the request. - The id can be used to deregister the request again. See also - Registration#id. + The id can be used to deregister the request again. See also Registration#id. """ @@ -7313,13 +7163,11 @@ class WorkspaceFoldersServerCapabilities: """The server has support for workspace folders.""" change_notifications: Optional[Union[str, bool]] = attrs.field(default=None) - """Whether the server wants to receive workspace folder change - notifications. + """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. + 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. """ @@ -7345,8 +7193,7 @@ class FileOperationOptions: """The server is interested in receiving willRenameFiles requests.""" did_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) - """The server is interested in receiving didDeleteFiles file - notifications.""" + """The server is interested in receiving didDeleteFiles file notifications.""" will_delete: Optional[FileOperationRegistrationOptions] = attrs.field(default=None) """The server is interested in receiving willDeleteFiles file requests.""" @@ -7369,8 +7216,8 @@ class CodeDescription: class DiagnosticRelatedInformation: """Represents a related message and source code location for a diagnostic. - This should be used to point to code locations that cause or related - to a diagnostics, e.g when duplicating a symbol in a scope. + 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. """ location: Location = attrs.field() @@ -7390,12 +7237,13 @@ class ParameterInformation: label: Union[str, Tuple[int, int]] = attrs.field() """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. + 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`. + *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`. """ documentation: Optional[Union[str, MarkupContent]] = attrs.field(default=None) @@ -7407,8 +7255,8 @@ class ParameterInformation: @attrs.define class NotebookCellTextDocumentFilter: - """A notebook cell text document filter denotes a cell text document by - different properties. + """A notebook cell text document filter denotes a cell text document by different + properties. @since 3.17.0 """ @@ -7418,8 +7266,8 @@ class NotebookCellTextDocumentFilter: notebook: Union[str, NotebookDocumentFilter] = attrs.field() """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. + If a string value is provided it matches against the notebook type. '*' matches + every notebook. """ language: Optional[str] = attrs.field( @@ -7428,8 +7276,8 @@ class NotebookCellTextDocumentFilter: ) """A language id like `python`. - Will be matched against the language id of the notebook cell - document. '*' matches every language. + Will be matched against the language id of the notebook cell document. '*' matches + every language. """ @@ -7452,8 +7300,8 @@ class FileOperationPatternOptions: @attrs.define class ExecutionSummary: execution_order: int = attrs.field(validator=validators.uinteger_validator) - """A strict monotonically increasing value indicating the execution order - of a cell inside a notebook.""" + """A strict monotonically increasing value indicating the execution order of a cell + inside a notebook.""" success: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -7470,8 +7318,8 @@ class WorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client supports applying batch edits to the workspace by supporting - the request 'workspace/applyEdit'.""" + """The client supports applying batch edits to the workspace by supporting the + request 'workspace/applyEdit'.""" workspace_edit: Optional["WorkspaceEditClientCapabilities"] = attrs.field( default=None @@ -7481,14 +7329,12 @@ class WorkspaceClientCapabilities: did_change_configuration: Optional[ "DidChangeConfigurationClientCapabilities" ] = attrs.field(default=None) - """Capabilities specific to the `workspace/didChangeConfiguration` - notification.""" + """Capabilities specific to the `workspace/didChangeConfiguration` notification.""" did_change_watched_files: Optional[ "DidChangeWatchedFilesClientCapabilities" ] = attrs.field(default=None) - """Capabilities specific to the `workspace/didChangeWatchedFiles` - notification.""" + """Capabilities specific to the `workspace/didChangeWatchedFiles` notification.""" symbol: Optional["WorkspaceSymbolClientCapabilities"] = attrs.field(default=None) """Capabilities specific to the `workspace/symbol` request.""" @@ -7521,8 +7367,7 @@ class WorkspaceClientCapabilities: semantic_tokens: Optional[ "SemanticTokensWorkspaceClientCapabilities" ] = attrs.field(default=None) - """Capabilities specific to the semantic token requests scoped to the - workspace. + """Capabilities specific to the semantic token requests scoped to the workspace. @since 3.16.0. """ @@ -7540,8 +7385,8 @@ class WorkspaceClientCapabilities: file_operations: Optional["FileOperationClientCapabilities"] = attrs.field( default=None ) - """The client has support for file notifications/requests for user - operations on files. + """The client has support for file notifications/requests for user operations on + files. Since 3.16.0 """ @@ -7549,8 +7394,7 @@ class WorkspaceClientCapabilities: inline_value: Optional["InlineValueWorkspaceClientCapabilities"] = attrs.field( default=None ) - """Capabilities specific to the inline values requests scoped to the - workspace. + """Capabilities specific to the inline values requests scoped to the workspace. @since 3.17.0. """ @@ -7559,8 +7403,7 @@ class WorkspaceClientCapabilities: inlay_hint: Optional["InlayHintWorkspaceClientCapabilities"] = attrs.field( default=None ) - """Capabilities specific to the inlay hint requests scoped to the - workspace. + """Capabilities specific to the inlay hint requests scoped to the workspace. @since 3.17.0. """ @@ -7569,8 +7412,7 @@ class WorkspaceClientCapabilities: diagnostics: Optional["DiagnosticWorkspaceClientCapabilities"] = attrs.field( default=None ) - """Capabilities specific to the diagnostic requests scoped to the - workspace. + """Capabilities specific to the diagnostic requests scoped to the workspace. @since 3.17.0. """ @@ -7631,8 +7473,7 @@ class TextDocumentClientCapabilities: document_highlight: Optional["DocumentHighlightClientCapabilities"] = attrs.field( default=None ) - """Capabilities specific to the `textDocument/documentHighlight` - request.""" + """Capabilities specific to the `textDocument/documentHighlight` request.""" document_symbol: Optional["DocumentSymbolClientCapabilities"] = attrs.field( default=None @@ -7699,8 +7540,7 @@ class TextDocumentClientCapabilities: publish_diagnostics: Optional["PublishDiagnosticsClientCapabilities"] = attrs.field( default=None ) - """Capabilities specific to the `textDocument/publishDiagnostics` - notification.""" + """Capabilities specific to the `textDocument/publishDiagnostics` notification.""" call_hierarchy: Optional["CallHierarchyClientCapabilities"] = attrs.field( default=None @@ -7790,8 +7630,8 @@ class WindowClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """It indicates whether the client supports server initiated progress using - the `window/workDoneProgress/create` request. + """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 @@ -7827,8 +7667,8 @@ class GeneralClientCapabilitiesStaleRequestSupportType: """The client will actively cancel the request.""" retry_on_content_modified: List[str] = attrs.field() - """The list of requests for which the client will retry the request if it - receives a response with error code `ContentModified`""" + """The list of requests for which the client will retry the request if it receives a + response with error code `ContentModified`""" @attrs.define @@ -7843,9 +7683,9 @@ class GeneralClientCapabilities: stale_request_support: Optional[ "GeneralClientCapabilitiesStaleRequestSupportType" ] = attrs.field(default=None) - """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). + """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). @since 3.17.0 """ @@ -7870,9 +7710,9 @@ class GeneralClientCapabilities: position_encodings: Optional[List[Union[PositionEncodingKind, str]]] = attrs.field( default=None ) - """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. + """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 @@ -7893,9 +7733,9 @@ class GeneralClientCapabilities: @attrs.define class RelativePattern: - """A relative pattern is a helper to construct glob patterns that are - matched relatively to a base URI. The common value for a `baseUri` is a - workspace folder root, but it can be another absolute URI as well. + """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. @since 3.17.0 """ @@ -7903,8 +7743,8 @@ class RelativePattern: # Since: 3.17.0 base_uri: Union[WorkspaceFolder, str] = attrs.field() - """A workspace folder or a base URI to which this pattern will be matched - against relatively.""" + """A workspace folder or a base URI to which this pattern will be matched against + relatively.""" pattern: Pattern = attrs.field() """The actual glob pattern;""" @@ -7916,9 +7756,8 @@ class WorkspaceEditClientCapabilitiesChangeAnnotationSupportType: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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.""" + """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.""" @attrs.define @@ -7932,16 +7771,15 @@ class WorkspaceEditClientCapabilities: resource_operations: Optional[List[ResourceOperationKind]] = attrs.field( default=None ) - """The resource operations the client supports. Clients should at least - support 'create', 'rename' and 'delete' files and folders. + """The resource operations the client supports. Clients should at least support + 'create', 'rename' and 'delete' files and folders. @since 3.13.0 """ # Since: 3.13.0 failure_handling: Optional[FailureHandlingKind] = attrs.field(default=None) - """The failure handling strategy of a client if applying the workspace edit - fails. + """The failure handling strategy of a client if applying the workspace edit fails. @since 3.13.0 """ @@ -7951,9 +7789,9 @@ class WorkspaceEditClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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. + """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. @since 3.16.0 """ @@ -7962,8 +7800,8 @@ class WorkspaceEditClientCapabilities: change_annotation_support: Optional[ "WorkspaceEditClientCapabilitiesChangeAnnotationSupportType" ] = attrs.field(default=None) - """Whether the client in general supports change annotations on text edits, - create file, rename file and delete file changes. + """Whether the client in general supports change annotations on text edits, create + file, rename file and delete file changes. @since 3.16.0 """ @@ -7987,16 +7825,16 @@ class DidChangeWatchedFilesClientCapabilities: ) """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. + Please note that the current protocol doesn't support static configuration for file + changes from the server side. """ relative_pattern_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client has support for {@link RelativePattern relative - pattern} or not. + """Whether the client has support for {@link RelativePattern relative pattern} or + not. @since 3.17.0 """ @@ -8006,13 +7844,12 @@ class DidChangeWatchedFilesClientCapabilities: @attrs.define class WorkspaceSymbolClientCapabilitiesSymbolKindType: value_set: Optional[List[SymbolKind]] = attrs.field(default=None) - """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. + """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. + 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. """ @@ -8044,14 +7881,13 @@ class WorkspaceSymbolClientCapabilities: symbol_kind: Optional[ "WorkspaceSymbolClientCapabilitiesSymbolKindType" ] = attrs.field(default=None) - """Specific capabilities for the `SymbolKind` in the `workspace/symbol` - request.""" + """Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.""" tag_support: Optional[ "WorkspaceSymbolClientCapabilitiesTagSupportType" ] = attrs.field(default=None) - """The client supports tags on `SymbolInformation`. Clients supporting tags - have to handle unknown tags gracefully. + """The client supports tags on `SymbolInformation`. Clients supporting tags have to + handle unknown tags gracefully. @since 3.16.0 """ @@ -8060,9 +7896,8 @@ class WorkspaceSymbolClientCapabilities: resolve_support: Optional[ "WorkspaceSymbolClientCapabilitiesResolveSupportType" ] = attrs.field(default=None) - """The client support partial workspace symbols. The client will send the - request `workspaceSymbol/resolve` to the server to resolve additional - properties. + """The client support partial workspace symbols. The client will send the request + `workspaceSymbol/resolve` to the server to resolve additional properties. @since 3.17.0 """ @@ -8090,13 +7925,13 @@ class SemanticTokensWorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client implementation supports a refresh request sent from - the server to the client. + """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. + 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. """ @@ -8110,20 +7945,19 @@ class CodeLensWorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client implementation supports a refresh request sent from - the server to the client. + """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. + 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. """ @attrs.define class FileOperationClientCapabilities: - """Capabilities relating to events from file operations by the user in the - client. + """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. @@ -8190,13 +8024,13 @@ class InlineValueWorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client implementation supports a refresh request sent from - the server to the client. + """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. + 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. """ @@ -8213,13 +8047,13 @@ class InlayHintWorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client implementation supports a refresh request sent from - the server to the client. + """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. + 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. """ @@ -8236,13 +8070,13 @@ class DiagnosticWorkspaceClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client implementation supports a refresh request sent from - the server to the client. + """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. + 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. """ @@ -8265,8 +8099,7 @@ class TextDocumentSyncClientCapabilities: default=None, ) """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.""" + providing text edits which will be applied to the document before it is saved.""" did_save: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -8300,10 +8133,9 @@ class CompletionClientCapabilitiesCompletionItemType: ) """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. + 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. """ commit_characters_support: Optional[bool] = attrs.field( @@ -8313,8 +8145,7 @@ class CompletionClientCapabilitiesCompletionItemType: """Client supports commit characters on a completion item.""" documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. + """Client supports the following content formats for the documentation property. The order describes the preferred format of the client. """ @@ -8334,10 +8165,9 @@ class CompletionClientCapabilitiesCompletionItemType: tag_support: Optional[ "CompletionClientCapabilitiesCompletionItemTypeTagSupportType" ] = attrs.field(default=None) - """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. + """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. @since 3.15.0 """ @@ -8347,8 +8177,8 @@ class CompletionClientCapabilitiesCompletionItemType: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Client support insert replace edit to control different behavior if a - completion item is inserted in the text or should replace text. + """Client support insert replace edit to control different behavior if a completion + item is inserted in the text or should replace text. @since 3.16.0 """ @@ -8357,9 +8187,9 @@ class CompletionClientCapabilitiesCompletionItemType: resolve_support: Optional[ "CompletionClientCapabilitiesCompletionItemTypeResolveSupportType" ] = attrs.field(default=None) - """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. + """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. @since 3.16.0 """ @@ -8368,8 +8198,8 @@ class CompletionClientCapabilitiesCompletionItemType: insert_text_mode_support: Optional[ "CompletionClientCapabilitiesCompletionItemTypeInsertTextModeSupportType" ] = attrs.field(default=None) - """The client supports the `insertTextMode` property on a completion item - to override the whitespace handling mode as defined by the client (see + """The client supports the `insertTextMode` property on a completion item to + override the whitespace handling mode as defined by the client (see `insertTextMode`). @since 3.16.0 @@ -8391,13 +8221,12 @@ class CompletionClientCapabilitiesCompletionItemType: @attrs.define class CompletionClientCapabilitiesCompletionItemKindType: value_set: Optional[List[CompletionItemKind]] = attrs.field(default=None) - """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. + """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. + 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. """ @@ -8428,17 +8257,15 @@ class CompletionClientCapabilities: completion_item: Optional[ "CompletionClientCapabilitiesCompletionItemType" ] = attrs.field(default=None) - """The client supports the following `CompletionItem` specific - capabilities.""" + """The client supports the following `CompletionItem` specific capabilities.""" completion_item_kind: Optional[ "CompletionClientCapabilitiesCompletionItemKindType" ] = attrs.field(default=None) insert_text_mode: Optional[InsertTextMode] = attrs.field(default=None) - """Defines how the client handles whitespace and indentation when accepting - a completion item that uses multi line text in either `insertText` or - `textEdit`. + """Defines how the client handles whitespace and indentation when accepting a + completion item that uses multi line text in either `insertText` or `textEdit`. @since 3.17.0 """ @@ -8454,8 +8281,7 @@ class CompletionClientCapabilities: completion_list: Optional[ "CompletionClientCapabilitiesCompletionListType" ] = attrs.field(default=None) - """The client supports the following `CompletionList` specific - capabilities. + """The client supports the following `CompletionList` specific capabilities. @since 3.17.0 """ @@ -8483,8 +8309,7 @@ class SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformatio validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client supports processing label offsets instead of a simple label - string. + """The client supports processing label offsets instead of a simple label string. @since 3.14.0 """ @@ -8494,8 +8319,7 @@ class SignatureHelpClientCapabilitiesSignatureInformationTypeParameterInformatio @attrs.define class SignatureHelpClientCapabilitiesSignatureInformationType: documentation_format: Optional[List[MarkupKind]] = attrs.field(default=None) - """Client supports the following content formats for the documentation - property. + """Client supports the following content formats for the documentation property. The order describes the preferred format of the client. """ @@ -8509,8 +8333,8 @@ class SignatureHelpClientCapabilitiesSignatureInformationType: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client supports the `activeParameter` property on - `SignatureInformation` literal. + """The client supports the `activeParameter` property on `SignatureInformation` + literal. @since 3.16.0 """ @@ -8530,17 +8354,15 @@ class SignatureHelpClientCapabilities: signature_information: Optional[ "SignatureHelpClientCapabilitiesSignatureInformationType" ] = attrs.field(default=None) - """The client supports the following `SignatureInformation` specific - properties.""" + """The client supports the following `SignatureInformation` specific properties.""" context_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) """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`. + `textDocument/signatureHelp` request. A client that opts into contextSupport will + also support the `retriggerCharacters` on `SignatureHelpOptions`. @since 3.15.0 """ @@ -8560,16 +8382,15 @@ class DeclarationClientCapabilities: """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. + `DeclarationRegistrationOptions` return value for the corresponding server + capability as well. """ link_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client supports additional metadata in the form of declaration - links.""" + """The client supports additional metadata in the form of declaration links.""" @attrs.define @@ -8604,8 +8425,8 @@ class TypeDefinitionClientCapabilities: """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. + `TypeDefinitionRegistrationOptions` return value for the corresponding server + capability as well. """ link_support: Optional[bool] = attrs.field( @@ -8631,8 +8452,8 @@ class ImplementationClientCapabilities: """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. + `ImplementationRegistrationOptions` return value for the corresponding server + capability as well. """ link_support: Optional[bool] = attrs.field( @@ -8671,13 +8492,12 @@ class DocumentHighlightClientCapabilities: @attrs.define class DocumentSymbolClientCapabilitiesSymbolKindType: value_set: Optional[List[SymbolKind]] = attrs.field(default=None) - """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. + """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. + 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. """ @@ -8700,8 +8520,8 @@ class DocumentSymbolClientCapabilities: symbol_kind: Optional[ "DocumentSymbolClientCapabilitiesSymbolKindType" ] = attrs.field(default=None) - """Specific capabilities for the `SymbolKind` in the - `textDocument/documentSymbol` request.""" + """Specific capabilities for the `SymbolKind` in the `textDocument/documentSymbol` + request.""" hierarchical_document_symbol_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), @@ -8713,8 +8533,8 @@ class DocumentSymbolClientCapabilities: "DocumentSymbolClientCapabilitiesTagSupportType" ] = attrs.field(default=None) """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. + `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. Clients + supporting tags have to handle unknown tags gracefully. @since 3.16.0 """ @@ -8724,8 +8544,8 @@ class DocumentSymbolClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client supports an additional label presented in the UI when - registering a document symbol provider. + """The client supports an additional label presented in the UI when registering a + document symbol provider. @since 3.16.0 """ @@ -8737,9 +8557,8 @@ class CodeActionClientCapabilitiesCodeActionLiteralSupportTypeCodeActionKindType value_set: List[Union[CodeActionKind, str]] = attrs.field() """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. + 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. """ @@ -8770,9 +8589,9 @@ class CodeActionClientCapabilities: code_action_literal_support: Optional[ "CodeActionClientCapabilitiesCodeActionLiteralSupportType" ] = attrs.field(default=None) - """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. + """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. @since 3.8.0 """ @@ -8802,8 +8621,8 @@ class CodeActionClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether code action supports the `data` property which is preserved - between a `textDocument/codeAction` and a `codeAction/resolve` request. + """Whether code action supports the `data` property which is preserved between a + `textDocument/codeAction` and a `codeAction/resolve` request. @since 3.16.0 """ @@ -8812,8 +8631,8 @@ class CodeActionClientCapabilities: resolve_support: Optional[ "CodeActionClientCapabilitiesResolveSupportType" ] = attrs.field(default=None) - """Whether the client supports resolving additional code action properties - via a separate `codeAction/resolve` request. + """Whether the client supports resolving additional code action properties via a + separate `codeAction/resolve` request. @since 3.16.0 """ @@ -8823,10 +8642,9 @@ class CodeActionClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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. + """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. @since 3.16.0 """ @@ -8874,8 +8692,8 @@ class DocumentColorClientCapabilities: """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. + `DocumentColorRegistrationOptions` return value for the corresponding server + capability as well. """ @@ -8924,8 +8742,7 @@ class RenameClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Client supports testing for validity of rename operations before - execution. + """Client supports testing for validity of rename operations before execution. @since 3.12.0 """ @@ -8947,10 +8764,9 @@ class RenameClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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. + """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. @since 3.16.0 """ @@ -8962,9 +8778,8 @@ class FoldingRangeClientCapabilitiesFoldingRangeKindType: value_set: Optional[List[Union[FoldingRangeKind, str]]] = attrs.field(default=None) """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. + 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. """ @@ -8974,8 +8789,8 @@ class FoldingRangeClientCapabilitiesFoldingRangeType: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """If set, the client signals that it supports setting collapsedText on - folding ranges to display custom labels instead of the default text. + """If set, the client signals that it supports setting collapsedText on folding + ranges to display custom labels instead of the default text. @since 3.17.0 """ @@ -8988,19 +8803,18 @@ class FoldingRangeClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether implementation supports dynamic registration for folding range - providers. + """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. + `FoldingRangeRegistrationOptions` return value for the corresponding server + capability as well. """ range_limit: Optional[int] = attrs.field( validator=attrs.validators.optional(validators.uinteger_validator), default=None ) - """The maximum number of folding ranges that the client prefers to receive - per document. + """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. """ @@ -9011,8 +8825,8 @@ class FoldingRangeClientCapabilities: ) """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. + If set, client will ignore specified `startCharacter` and `endCharacter` properties + in a FoldingRange. """ folding_range_kind: Optional[ @@ -9044,8 +8858,8 @@ class SelectionRangeClientCapabilities: providers. If this is set to `true` the client supports the new - `SelectionRangeRegistrationOptions` return value for the - corresponding server capability as well. + `SelectionRangeRegistrationOptions` return value for the corresponding server + capability as well. """ @@ -9068,8 +8882,8 @@ class PublishDiagnosticsClientCapabilities: tag_support: Optional[ "PublishDiagnosticsClientCapabilitiesTagSupportType" ] = attrs.field(default=None) - """Client supports the tag property to provide meta data about a - diagnostic. Clients supporting tags have to handle unknown tags gracefully. + """Client supports the tag property to provide meta data about a diagnostic. Clients + supporting tags have to handle unknown tags gracefully. @since 3.15.0 """ @@ -9100,9 +8914,8 @@ class PublishDiagnosticsClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether code action supports the `data` property which is preserved - between a `textDocument/publishDiagnostics` and `textDocument/codeAction` - request. + """Whether code action supports the `data` property which is preserved between a + `textDocument/publishDiagnostics` and `textDocument/codeAction` request. @since 3.16.0 """ @@ -9122,8 +8935,8 @@ class CallHierarchyClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ @@ -9133,21 +8946,21 @@ class SemanticTokensClientCapabilitiesRequestsTypeFullType1: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """The client will send the `textDocument/semanticTokens/full/delta` - request if the server provides a corresponding handler.""" + """The client will send the `textDocument/semanticTokens/full/delta` request if the + server provides a corresponding handler.""" @attrs.define class SemanticTokensClientCapabilitiesRequestsType: range: Optional[Union[bool, Any]] = attrs.field(default=None) - """The client will send the `textDocument/semanticTokens/range` request if - the server provides a corresponding handler.""" + """The client will send the `textDocument/semanticTokens/range` request if the + server provides a corresponding handler.""" full: Optional[ Union[bool, "SemanticTokensClientCapabilitiesRequestsTypeFullType1"] ] = attrs.field(default=None) - """The client will send the `textDocument/semanticTokens/full` request if - the server provides a corresponding handler.""" + """The client will send the `textDocument/semanticTokens/full` request if the server + provides a corresponding handler.""" @attrs.define @@ -9157,16 +8970,15 @@ class SemanticTokensClientCapabilities: # Since: 3.16.0 requests: "SemanticTokensClientCapabilitiesRequestsType" = attrs.field() - """Which requests the client supports and might send to the server - depending on the server's capability. + """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. + 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. """ token_types: List[str] = attrs.field() @@ -9185,8 +8997,8 @@ class SemanticTokensClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ overlapping_token_support: Optional[bool] = attrs.field( @@ -9205,9 +9017,9 @@ class SemanticTokensClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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. + """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. @since 3.17.0 """ @@ -9217,10 +9029,10 @@ class SemanticTokensClientCapabilities: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """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. + """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. @@ -9246,8 +9058,8 @@ class LinkedEditingRangeClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ @@ -9266,9 +9078,8 @@ class MonikerClientCapabilities: ) """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. + If this is set to `true` the client supports the new `MonikerRegistrationOptions` + return value for the corresponding server capability as well. """ @@ -9285,8 +9096,8 @@ class TypeHierarchyClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ @@ -9331,8 +9142,7 @@ class InlayHintClientCapabilities: resolve_support: Optional[ "InlayHintClientCapabilitiesResolveSupportType" ] = attrs.field(default=None) - """Indicates which properties a client can resolve lazily on an inlay - hint.""" + """Indicates which properties a client can resolve lazily on an inlay hint.""" @attrs.define @@ -9351,16 +9161,15 @@ class DiagnosticClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ related_document_support: Optional[bool] = attrs.field( validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the clients supports related documents for document diagnostic - pulls.""" + """Whether the clients supports related documents for document diagnostic pulls.""" @attrs.define @@ -9379,8 +9188,8 @@ class NotebookDocumentSyncClientCapabilities: """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. + `(TextDocumentRegistrationOptions & StaticRegistrationOptions)` return value for the + corresponding server capability as well. """ execution_summary_support: Optional[bool] = attrs.field( @@ -9396,8 +9205,8 @@ class ShowMessageRequestClientCapabilitiesMessageActionItemType: validator=attrs.validators.optional(attrs.validators.instance_of(bool)), default=None, ) - """Whether the client supports additional attributes which are preserved - and send back to the server in the request's response.""" + """Whether the client supports additional attributes which are preserved and send + back to the server in the request's response.""" @attrs.define @@ -9480,8 +9289,7 @@ class TextDocumentColorPresentationOptions: ) """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. + If set to null the document selector provided on the client side will be used. """ @@ -9492,8 +9300,8 @@ class ResponseError: message: str = attrs.field(validator=attrs.validators.instance_of(str)) """A string providing a short description of the error.""" data: Optional[LSPAny] = attrs.field(default=None) - """A primitive or structured value that contains additional information - about the error. + """A primitive or structured value that contains additional information about the + error. Can be omitted. """ @@ -9510,12 +9318,12 @@ class ResponseErrorMessage: @attrs.define class TextDocumentImplementationRequest: - """A request to resolve the implementation locations of a symbol at a given - text document position. + """A request to resolve the implementation locations of a symbol at a given text + document position. The request's parameter is of type [TextDocumentPositionParams] - (#TextDocumentPositionParams) the response is of type {@link - Definition} or a Thenable that resolves to such. + (#TextDocumentPositionParams) the response is of type {@link Definition} or a + Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -9536,12 +9344,12 @@ class TextDocumentImplementationResponse: @attrs.define class TextDocumentTypeDefinitionRequest: - """A request to resolve the type definition locations of a symbol at a - given text document position. + """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] - (#TextDocumentPositionParams) the response is of type {@link - Definition} or a Thenable that resolves to such. + (#TextDocumentPositionParams) the response is of type {@link Definition} or a + Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -9562,8 +9370,8 @@ class TextDocumentTypeDefinitionResponse: @attrs.define class WorkspaceWorkspaceFoldersRequest: - """The `workspace/workspaceFolders` is sent from the server to the client - to fetch the open workspace folders.""" + """The `workspace/workspaceFolders` is sent from the server to the client to fetch + the open workspace folders.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -9586,15 +9394,14 @@ class WorkspaceWorkspaceFoldersResponse: @attrs.define class WorkspaceConfigurationRequest: - """The 'workspace/configuration' request is sent from the server to the - client to fetch a certain configuration setting. + """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. + 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. """ id: Union[int, str] = attrs.field() @@ -9617,9 +9424,9 @@ class WorkspaceConfigurationResponse: class TextDocumentDocumentColorRequest: """A request to list all color symbols found in a given text document. - The request's parameter is of type {@link DocumentColorParams} the - response is of type {@link ColorInformation ColorInformation[]} or a - Thenable that resolves to such. + The request's parameter is of type {@link DocumentColorParams} the response is of + type {@link ColorInformation ColorInformation[]} or a Thenable that resolves to + such. """ id: Union[int, str] = attrs.field() @@ -9642,9 +9449,9 @@ class TextDocumentDocumentColorResponse: class TextDocumentColorPresentationRequest: """A request to list all presentation for a color. - The request's parameter is of type {@link ColorPresentationParams} - the response is of type {@link ColorInformation ColorInformation[]} - or a Thenable that resolves to such. + The request's parameter is of type {@link ColorPresentationParams} the response is + of type {@link ColorInformation ColorInformation[]} or a Thenable that resolves to + such. """ id: Union[int, str] = attrs.field() @@ -9667,9 +9474,8 @@ class TextDocumentColorPresentationResponse: class TextDocumentFoldingRangeRequest: """A request to provide folding ranges in a document. - The request's parameter is of type {@link FoldingRangeParams}, the - response is of type {@link FoldingRangeList} or a Thenable that - resolves to such. + The request's parameter is of type {@link FoldingRangeParams}, the response is of + type {@link FoldingRangeList} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -9690,13 +9496,12 @@ class TextDocumentFoldingRangeResponse: @attrs.define class TextDocumentDeclarationRequest: - """A request to resolve the type definition locations of a symbol at a - given text document position. + """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] - (#TextDocumentPositionParams) the response is of type {@link - Declaration} or a typed array of {@link DeclarationLink} or a - Thenable that resolves to such. + (#TextDocumentPositionParams) the response is of type {@link Declaration} or a typed + array of {@link DeclarationLink} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -9719,9 +9524,8 @@ class TextDocumentDeclarationResponse: class TextDocumentSelectionRangeRequest: """A request to provide selection ranges in a document. - The request's parameter is of type {@link SelectionRangeParams}, the - response is of type {@link SelectionRange SelectionRange[]} or a - Thenable that resolves to such. + The request's parameter is of type {@link SelectionRangeParams}, the response is of + type {@link SelectionRange SelectionRange[]} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -9742,8 +9546,8 @@ class TextDocumentSelectionRangeResponse: @attrs.define class WindowWorkDoneProgressCreateRequest: - """The `window/workDoneProgress/create` request is sent from the server to - the client to initiate progress reporting from the server.""" + """The `window/workDoneProgress/create` request is sent from the server to the + client to initiate progress reporting from the server.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -9763,9 +9567,8 @@ class WindowWorkDoneProgressCreateResponse: @attrs.define class TextDocumentPrepareCallHierarchyRequest: - """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. + """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. @since 3.16.0 """ @@ -9914,10 +9717,9 @@ class WorkspaceSemanticTokensRefreshResponse: @attrs.define class WindowShowDocumentRequest: - """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. + """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. @since 3.16.0 """ @@ -9963,9 +9765,8 @@ class TextDocumentLinkedEditingRangeResponse: @attrs.define class WorkspaceWillCreateFilesRequest: - """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 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 @@ -9992,9 +9793,8 @@ class WorkspaceWillCreateFilesResponse: @attrs.define class WorkspaceWillRenameFilesRequest: - """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. + """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. @since 3.16.0 """ @@ -10017,8 +9817,8 @@ class WorkspaceWillRenameFilesResponse: @attrs.define class WorkspaceWillDeleteFilesRequest: - """The did delete files notification is sent from the client to the server - when files were deleted from within the client. + """The did delete files notification is sent from the client to the server when + files were deleted from within the client. @since 3.16.0 """ @@ -10041,11 +9841,10 @@ class WorkspaceWillDeleteFilesResponse: @attrs.define class TextDocumentMonikerRequest: - """A request to get the moniker of a symbol at a given text document - position. + """A request to get the moniker of a symbol at a given text document position. - The request parameter is of type {@link TextDocumentPositionParams}. - The response is of type {@link Moniker Moniker[]} or `null`. + The request parameter is of type {@link TextDocumentPositionParams}. The response is + of type {@link Moniker Moniker[]} or `null`. """ id: Union[int, str] = attrs.field() @@ -10066,9 +9865,8 @@ class TextDocumentMonikerResponse: @attrs.define class TextDocumentPrepareTypeHierarchyRequest: - """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. + """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. @since 3.17.0 """ @@ -10137,9 +9935,9 @@ class TypeHierarchySubtypesResponse: @attrs.define class TextDocumentInlineValueRequest: - """A request to provide inline values in a document. The request's - parameter is of type {@link InlineValueParams}, the response is of type - {@link InlineValue InlineValue[]} or a Thenable that resolves to such. + """A request to provide inline values in a document. The request's parameter is of + type {@link InlineValueParams}, the response is of type {@link InlineValue + InlineValue[]} or a Thenable that resolves to such. @since 3.17.0 """ @@ -10182,9 +9980,9 @@ class WorkspaceInlineValueRefreshResponse: @attrs.define class TextDocumentInlayHintRequest: - """A request to provide inlay hints in a document. The request's parameter - is of type {@link InlayHintsParams}, the response is of type {@link - InlayHint InlayHint[]} or a Thenable that resolves to such. + """A request to provide inlay hints in a document. The request's parameter is of + type {@link InlayHintsParams}, the response is of type {@link InlayHint InlayHint[]} + or a Thenable that resolves to such. @since 3.17.0 """ @@ -10207,9 +10005,9 @@ class TextDocumentInlayHintResponse: @attrs.define class InlayHintResolveRequest: - """A request to resolve additional properties for an inlay hint. The - request's parameter is of type {@link InlayHint}, the response is of type - {@link InlayHint} or a Thenable that resolves to such. + """A request to resolve additional properties for an inlay hint. The request's + parameter is of type {@link InlayHint}, the response is of type {@link InlayHint} or + a Thenable that resolves to such. @since 3.17.0 """ @@ -10321,8 +10119,8 @@ class WorkspaceDiagnosticRefreshResponse: @attrs.define class ClientRegisterCapabilityRequest: - """The `client/registerCapability` request is sent from the server to the - client to register a new capability handler on the client side.""" + """The `client/registerCapability` request is sent from the server to the client to + register a new capability handler on the client side.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -10342,9 +10140,8 @@ class ClientRegisterCapabilityResponse: @attrs.define class ClientUnregisterCapabilityRequest: - """The `client/unregisterCapability` request is sent from the server to the - client to unregister a previously registered capability handler on the - client side.""" + """The `client/unregisterCapability` request is sent from the server to the client + to unregister a previously registered capability handler on the client side.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -10366,10 +10163,9 @@ class ClientUnregisterCapabilityResponse: class InitializeRequest: """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 {@link InitializeParams} the response - if of type {@link InitializeResult} of a Thenable that resolves to - such. + It is sent once as the request after starting up the server. The requests parameter + is of type {@link InitializeParams} the response if of type {@link InitializeResult} + of a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10392,9 +10188,8 @@ class InitializeResponse: class ShutdownRequest: """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. + 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. """ id: Union[int, str] = attrs.field() @@ -10415,8 +10210,8 @@ class ShutdownResponse: @attrs.define class WindowShowMessageRequestRequest: - """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.""" + """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.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -10436,14 +10231,13 @@ class WindowShowMessageRequestResponse: @attrs.define class TextDocumentWillSaveWaitUntilRequest: - """A document will save request is sent from the client to the server - before the document is actually saved. + """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. + 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. """ id: Union[int, str] = attrs.field() @@ -10464,18 +10258,16 @@ class TextDocumentWillSaveWaitUntilResponse: @attrs.define class TextDocumentCompletionRequest: - """Request to request completion at a given text document position. The - request's parameter is of type {@link TextDocumentPosition} the response is - of type {@link CompletionItem CompletionItem[]} or {@link CompletionList} - or a Thenable that resolves to such. + """Request to request completion at a given text document position. The request's + parameter is of type {@link TextDocumentPosition} the response is of type {@link + 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. + 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. """ id: Union[int, str] = attrs.field() @@ -10498,9 +10290,9 @@ class TextDocumentCompletionResponse: @attrs.define class CompletionItemResolveRequest: - """Request to resolve additional information for a given completion - item.The request's parameter is of type {@link CompletionItem} the response - is of type {@link CompletionItem} or a Thenable that resolves to such.""" + """Request to resolve additional information for a given completion item.The + request's parameter is of type {@link CompletionItem} the response is of type {@link + CompletionItem} or a Thenable that resolves to such.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -10522,9 +10314,8 @@ class CompletionItemResolveResponse: class TextDocumentHoverRequest: """Request to request hover information at a given text document position. - The request's parameter is of type {@link TextDocumentPosition} the - response is of type {@link Hover} or a Thenable that resolves to - such. + The request's parameter is of type {@link TextDocumentPosition} the response is of + type {@link Hover} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10563,13 +10354,12 @@ class TextDocumentSignatureHelpResponse: @attrs.define class TextDocumentDefinitionRequest: - """A request to resolve the definition location of a symbol at a given text - document position. + """A request to resolve the definition location of a symbol at a given text document + position. - The request's parameter is of type [TextDocumentPosition] - (#TextDocumentPosition) the response is of either type {@link - Definition} or a typed array of {@link DefinitionLink} or a Thenable - that resolves to such. + The request's parameter is of type [TextDocumentPosition] (#TextDocumentPosition) + the response is of either type {@link Definition} or a typed array of {@link + DefinitionLink} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10590,12 +10380,11 @@ class TextDocumentDefinitionResponse: @attrs.define class TextDocumentReferencesRequest: - """A request to resolve project-wide references for the symbol denoted by - the given text document position. + """A request to resolve project-wide references for the symbol denoted by the given + text document position. - The request's parameter is of type {@link ReferenceParams} the - response is of type {@link Location Location[]} or a Thenable that - resolves to such. + The request's parameter is of type {@link ReferenceParams} the response is of type + {@link Location Location[]} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10619,10 +10408,9 @@ class TextDocumentDocumentHighlightRequest: """Request to resolve a {@link DocumentHighlight} for a given text document position. - The request's parameter is of type [TextDocumentPosition] - (#TextDocumentPosition) the request response is of type - [DocumentHighlight[]] (#DocumentHighlight) or a Thenable that - resolves to such. + The request's parameter is of type [TextDocumentPosition] (#TextDocumentPosition) + the request response is of type [DocumentHighlight[]] (#DocumentHighlight) or a + Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10645,9 +10433,9 @@ class TextDocumentDocumentHighlightResponse: class TextDocumentDocumentSymbolRequest: """A request to list all symbols found in a given text document. - The request's parameter is of type {@link TextDocumentIdentifier} - the response is of type {@link SymbolInformation - SymbolInformation[]} or a Thenable that resolves to such. + The request's parameter is of type {@link TextDocumentIdentifier} the response is of + type {@link SymbolInformation SymbolInformation[]} or a Thenable that resolves to + such. """ id: Union[int, str] = attrs.field() @@ -10690,9 +10478,9 @@ class TextDocumentCodeActionResponse: @attrs.define class CodeActionResolveRequest: - """Request to resolve additional information for a given code action.The - request's parameter is of type {@link CodeAction} the response is of type - {@link CodeAction} or a Thenable that resolves to such.""" + """Request to resolve additional information for a given code action.The request's + parameter is of type {@link CodeAction} the response is of type {@link CodeAction} + or a Thenable that resolves to such.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -10712,9 +10500,9 @@ class CodeActionResolveResponse: @attrs.define class WorkspaceSymbolRequest: - """A request to list project-wide symbols matching the query string given - by the {@link WorkspaceSymbolParams}. The response is of type {@link - SymbolInformation SymbolInformation[]} or a Thenable that resolves to such. + """A request to list project-wide symbols matching the query string given by the + {@link WorkspaceSymbolParams}. The response is of type {@link SymbolInformation + SymbolInformation[]} or a Thenable that resolves to such. @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients need to advertise support for WorkspaceSymbols via the client capability @@ -10849,8 +10637,8 @@ class TextDocumentDocumentLinkResponse: class DocumentLinkResolveRequest: """Request to resolve additional information for a given document link. - The request's parameter is of type {@link DocumentLink} the response - is of type {@link DocumentLink} or a Thenable that resolves to such. + The request's parameter is of type {@link DocumentLink} the response is of type + {@link DocumentLink} or a Thenable that resolves to such. """ id: Union[int, str] = attrs.field() @@ -10976,8 +10764,8 @@ class TextDocumentPrepareRenameResponse: class WorkspaceExecuteCommandRequest: """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. + The request might return a workspace edit which the client will apply to the + workspace. """ id: Union[int, str] = attrs.field() @@ -10998,8 +10786,7 @@ class WorkspaceExecuteCommandResponse: @attrs.define class WorkspaceApplyEditRequest: - """A request sent from the server to the client to modified certain - resources.""" + """A request sent from the server to the client to modified certain resources.""" id: Union[int, str] = attrs.field() """The request id.""" @@ -11019,8 +10806,8 @@ class WorkspaceApplyEditResponse: @attrs.define class WorkspaceDidChangeWorkspaceFoldersNotification: - """The `workspace/didChangeWorkspaceFolders` notification is sent from the - client to the server when the workspace folder configuration changes.""" + """The `workspace/didChangeWorkspaceFolders` notification is sent from the client to + the server when the workspace folder configuration changes.""" params: DidChangeWorkspaceFoldersParams = attrs.field() method: str = attrs.field( @@ -11033,8 +10820,8 @@ class WorkspaceDidChangeWorkspaceFoldersNotification: @attrs.define class WindowWorkDoneProgressCancelNotification: - """The `window/workDoneProgress/cancel` notification is sent from the - client to the server to cancel a progress initiated on the server side.""" + """The `window/workDoneProgress/cancel` notification is sent from the client to the + server to cancel a progress initiated on the server side.""" params: WorkDoneProgressCancelParams = attrs.field() method: str = attrs.field( @@ -11047,8 +10834,8 @@ class WindowWorkDoneProgressCancelNotification: @attrs.define class WorkspaceDidCreateFilesNotification: - """The did create files notification is sent from the client to the server - when files were created from within the client. + """The did create files notification is sent from the client to the server when + files were created from within the client. @since 3.16.0 """ @@ -11064,8 +10851,8 @@ class WorkspaceDidCreateFilesNotification: @attrs.define class WorkspaceDidRenameFilesNotification: - """The did rename files notification is sent from the client to the server - when files were renamed from within the client. + """The did rename files notification is sent from the client to the server when + files were renamed from within the client. @since 3.16.0 """ @@ -11081,9 +10868,8 @@ class WorkspaceDidRenameFilesNotification: @attrs.define class WorkspaceDidDeleteFilesNotification: - """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. + """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. @since 3.16.0 """ @@ -11158,9 +10944,9 @@ class NotebookDocumentDidCloseNotification: @attrs.define class InitializedNotification: - """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.""" + """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.""" params: InitializedParams = attrs.field() method: str = attrs.field( @@ -11173,8 +10959,8 @@ class InitializedNotification: @attrs.define class ExitNotification: - """The exit event is sent from the client to the server to ask the server - to exit its process.""" + """The exit event is sent from the client to the server to ask the server to exit + its process.""" params: Optional[None] = attrs.field(default=None) method: str = attrs.field( @@ -11187,11 +10973,11 @@ class ExitNotification: @attrs.define class WorkspaceDidChangeConfigurationNotification: - """The configuration change notification is sent from the client to the - server when the client's configuration has changed. + """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. + The notification contains the changed configuration as defined by the language + client. """ params: DidChangeConfigurationParams = attrs.field() @@ -11205,8 +10991,8 @@ class WorkspaceDidChangeConfigurationNotification: @attrs.define class WindowShowMessageNotification: - """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.""" + """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.""" params: ShowMessageParams = attrs.field() method: str = attrs.field( @@ -11219,8 +11005,8 @@ class WindowShowMessageNotification: @attrs.define class WindowLogMessageNotification: - """The log message notification is sent from the server to the client to - ask the client to log a particular message.""" + """The log message notification is sent from the server to the client to ask the + client to log a particular message.""" params: LogMessageParams = attrs.field() method: str = attrs.field( @@ -11233,8 +11019,8 @@ class WindowLogMessageNotification: @attrs.define class TelemetryEventNotification: - """The telemetry event notification is sent from the server to the client - to ask the client to log telemetry data.""" + """The telemetry event notification is sent from the server to the client to ask the + client to log telemetry data.""" params: LSPAny = attrs.field() method: str = attrs.field( @@ -11247,16 +11033,15 @@ class TelemetryEventNotification: @attrs.define class TextDocumentDidOpenNotification: - """The document open notification is sent from the client to the server to - signal newly opened text documents. + """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. + 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. """ params: DidOpenTextDocumentParams = attrs.field() @@ -11270,8 +11055,8 @@ class TextDocumentDidOpenNotification: @attrs.define class TextDocumentDidChangeNotification: - """The document change notification is sent from the client to the server - to signal changes to a text document.""" + """The document change notification is sent from the client to the server to signal + changes to a text document.""" params: DidChangeTextDocumentParams = attrs.field() method: str = attrs.field( @@ -11284,15 +11069,14 @@ class TextDocumentDidChangeNotification: @attrs.define class TextDocumentDidCloseNotification: - """The document close notification is sent from the client to the server - when the document got closed in the client. + """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. + 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. """ params: DidCloseTextDocumentParams = attrs.field() @@ -11306,8 +11090,8 @@ class TextDocumentDidCloseNotification: @attrs.define class TextDocumentDidSaveNotification: - """The document save notification is sent from the client to the server - when the document got saved in the client.""" + """The document save notification is sent from the client to the server when the + document got saved in the client.""" params: DidSaveTextDocumentParams = attrs.field() method: str = attrs.field( @@ -11320,8 +11104,8 @@ class TextDocumentDidSaveNotification: @attrs.define class TextDocumentWillSaveNotification: - """A document will save notification is sent from the client to the server - before the document is actually saved.""" + """A document will save notification is sent from the client to the server before + the document is actually saved.""" params: WillSaveTextDocumentParams = attrs.field() method: str = attrs.field( @@ -11334,8 +11118,8 @@ class TextDocumentWillSaveNotification: @attrs.define class WorkspaceDidChangeWatchedFilesNotification: - """The watched files notification is sent from the client to the server - when the client detects changes to file watched by the language client.""" + """The watched files notification is sent from the client to the server when the + client detects changes to file watched by the language client.""" params: DidChangeWatchedFilesParams = attrs.field() method: str = attrs.field( @@ -11348,8 +11132,8 @@ class WorkspaceDidChangeWatchedFilesNotification: @attrs.define class TextDocumentPublishDiagnosticsNotification: - """Diagnostics notification are sent from the server to the client to - signal results of validation runs.""" + """Diagnostics notification are sent from the server to the client to signal results + of validation runs.""" params: PublishDiagnosticsParams = attrs.field() method: str = attrs.field( diff --git a/packages/python/lsprotocol/validators.py b/packages/python/lsprotocol/validators.py index 95cb263..a0f00c7 100644 --- a/packages/python/lsprotocol/validators.py +++ b/packages/python/lsprotocol/validators.py @@ -36,8 +36,7 @@ def uinteger_validator( attribute: "attrs.Attribute[int]", value: Any, ) -> bool: - """Validates that unsigned integer value belongs in the range expected by - LSP.""" + """Validates that unsigned integer value belongs in the range expected by LSP.""" if not isinstance(value, int) or not ( UINTEGER_MIN_VALUE <= value <= UINTEGER_MAX_VALUE ): diff --git a/packages/rust/lsprotocol/src/lib.rs b/packages/rust/lsprotocol/src/lib.rs index 3d9059b..5ca4090 100644 --- a/packages/rust/lsprotocol/src/lib.rs +++ b/packages/rust/lsprotocol/src/lib.rs @@ -208,6 +208,8 @@ pub enum LSPRequestMethods { WorkspaceDiagnostic, #[serde(rename = "workspace/diagnostic/refresh")] WorkspaceDiagnosticRefresh, + #[serde(rename = "textDocument/inlineCompletion")] + TextDocumentInlineCompletion, #[serde(rename = "client/registerCapability")] ClientRegisterCapability, #[serde(rename = "client/unregisterCapability")] @@ -330,10 +332,10 @@ pub enum LSPNotificationMethods { pub enum MessageDirection { #[serde(rename = "serverToClient")] ServerToClient, - #[serde(rename = "clientToServer")] - ClientToServer, #[serde(rename = "both")] Both, + #[serde(rename = "clientToServer")] + ClientToServer, } /// A set of predefined token types. This set is not fixed @@ -927,12 +929,26 @@ pub enum MarkupKind { Markdown, } +/// Describes how an [inline completion provider][InlineCompletionItemProvider] was triggered. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +pub enum InlineCompletionTriggerKind { + /// Completion was triggered explicitly by a user gesture. + Invoked = 0, + + /// Completion was triggered automatically while editing. + Automatic = 1, +} + /// A set of predefined position encoding kinds. /// /// @since 3.17.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] pub enum PositionEncodingKind { - /// Character offsets count UTF-8 code units. + /// Character offsets count UTF-8 code units (e.g. bytes). #[serde(rename = "utf-8")] Utf8, @@ -945,7 +961,7 @@ pub enum PositionEncodingKind { /// Character offsets count UTF-32 code units. /// - /// Implementation note: these are the same as Unicode code points, + /// Implementation note: these are the same as Unicode codepoints, /// so this `PositionEncodingKind` may also be used for an /// encoding-agnostic representation of character offsets. #[serde(rename = "utf-32")] @@ -2028,14 +2044,14 @@ pub struct SemanticTokensRangeParams { pub work_done_token: Option, } -/// Params to show a document. +/// Params to show a resource in the UI. /// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ShowDocumentParams { /// Indicates to show the resource in an external program. - /// To show for example `https://code.visualstudio.com/` + /// To show, for example, `https://code.visualstudio.com/` /// in the default WEB browser set `external` to `true`. pub external: Option, @@ -2051,7 +2067,7 @@ pub struct ShowDocumentParams { /// program is started. pub take_focus: Option, - /// The document uri to show. + /// The uri to show. pub uri: String, } @@ -2631,6 +2647,79 @@ pub struct DidCloseNotebookDocumentParams { pub notebook_document: NotebookDocumentIdentifier, } +/// A parameter literal used in inline completion requests. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionParams { + /// Additional information about the context in which inline completions were + /// requested. + pub context: InlineCompletionContext, + + /// The position inside the text document. + pub position: Position, + + /// The text document. + pub text_document: TextDocumentIdentifier, + + /// An optional token that a server can use to report work done progress. + pub work_done_token: Option, +} + +/// Represents a collection of [inline completion items][InlineCompletionItem] to be presented in the editor. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionList { + /// The inline completion items + pub items: Vec, +} + +/// An inline completion item represents a text snippet that is proposed inline to complete text that is being typed. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionItem { + /// An optional [Command] that is executed *after* inserting this completion. + pub command: Option, + + /// A text that is used to decide if this inline completion should be shown. When `falsy` the [`InlineCompletionItem::insertText`] is used. + pub filter_text: Option, + + /// The text to replace the range with. Must be set. + pub insert_text: OR2, + + /// The range to replace. Must begin and end on the same line. + pub range: Option, +} + +/// Inline completion options used during static or dynamic registration. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionRegistrationOptions { + /// 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. + #[serde(skip_serializing_if = "Option::is_none")] + pub document_selector: Option, + + /// The id used to register the request. The id can be used to deregister + /// the request again. See also Registration#id. + pub id: Option, +} + #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct RegistrationParams { @@ -4004,7 +4093,7 @@ pub struct ExecuteCommandRegistrationOptions { pub commands: Vec, } -/// The parameters passed via a apply workspace edit request. +/// The parameters passed via an apply workspace edit request. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct ApplyWorkspaceEditParams { @@ -4948,7 +5037,54 @@ pub struct NotebookDocumentIdentifier { pub uri: String, } -/// General parameters to to register for an notification or to register a provider. +/// Provides information about the context in which an inline completion was requested. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionContext { + /// Provides information about the currently selected item in the autocomplete widget if it is visible. + pub selected_completion_info: Option, + + /// Describes how the inline completion was triggered. + pub trigger_kind: InlineCompletionTriggerKind, +} + +/// 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}`. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct StringValue { + /// The kind of string value. + pub kind: String, + + /// The snippet string. + pub value: String, +} + +/// Inline completion options used during static registration. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionOptions { + pub work_done_progress: Option, +} + +/// General parameters to register for a notification or to register a provider. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct Registration { @@ -5134,6 +5270,13 @@ pub struct ServerCapabilities { /// @since 3.17.0 pub inlay_hint_provider: Option>, + /// Inline completion options used during static registration. + /// + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed", since = "3.18.0")] + pub inline_completion_provider: Option>, + /// The server provides inline values. /// /// @since 3.17.0 @@ -5883,6 +6026,21 @@ pub struct NotebookCellArrayChange { pub start: u32, } +/// Describes the currently selected completion item. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct SelectedCompletionInfo { + /// The range that will be replaced if this completion item is accepted. + pub range: Range, + + /// The text the range will be replaced with if this completion is accepted. + pub text: String, +} + /// Defines the capabilities provided by the client. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -6276,6 +6434,13 @@ pub struct TextDocumentClientCapabilities { /// @since 3.17.0 pub inlay_hint: Option, + /// Client capabilities specific to inline completions. + /// + /// @since 3.18.0 + /// @proposed + #[cfg(feature = "proposed", since = "3.18.0")] + pub inline_completion: Option, + /// Capabilities specific to the `textDocument/inlineValue` request. /// /// @since 3.17.0 @@ -7430,6 +7595,18 @@ pub struct DiagnosticClientCapabilities { pub related_document_support: Option, } +/// Client capabilities specific to inline completions. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct InlineCompletionClientCapabilities { + /// Whether implementation supports dynamic registration for inline completion providers. + pub dynamic_registration: Option, +} + /// Notebook specific client capabilities. /// /// @since 3.17.0 @@ -8560,6 +8737,10 @@ pub struct TextDocumentLinkedEditingRangeResponse { /// 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. +/// /// @since 3.16.0 #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] @@ -9076,6 +9257,45 @@ pub struct WorkspaceDiagnosticRefreshResponse { pub result: LSPNull, } +/// A request to provide inline completions in a document. The request's parameter is of +/// type [InlineCompletionParams], the response is of type +/// {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such. +/// +/// @since 3.18.0 +/// @proposed +#[cfg(feature = "proposed", since = "3.18.0")] +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TextDocumentInlineCompletionRequest { + /// The version of the JSON RPC protocol. + pub jsonrpc: String, + + /// The method to be invoked. + pub method: LSPRequestMethods, + + /// The request id. + pub id: LSPId, + + pub params: InlineCompletionParams, +} + +/// Response to the [TextDocumentInlineCompletionRequest]. +#[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] +#[serde(rename_all = "camelCase")] +pub struct TextDocumentInlineCompletionResponse { + /// The version of the JSON RPC protocol. + pub jsonrpc: String, + + /// The method to be invoked. + pub method: LSPRequestMethods, + + /// The request id. + pub id: LSPIdOptional, + + #[serde(skip_serializing_if = "Option::is_none")] + pub result: Option>>, +} + /// The `client/registerCapability` request is sent from the server to the client to register a new capability /// handler on the client side. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] @@ -9876,7 +10096,7 @@ pub struct DocumentLinkResolveResponse { pub result: DocumentLink, } -/// A request to to format a whole document. +/// A request to format a whole document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentFormattingRequest { @@ -9909,7 +10129,7 @@ pub struct TextDocumentFormattingResponse { pub result: Option>, } -/// A request to to format a range in a document. +/// A request to format a range in a document. #[derive(Serialize, Deserialize, PartialEq, Debug, Eq, Clone)] #[serde(rename_all = "camelCase")] pub struct TextDocumentRangeFormattingRequest { diff --git a/tests/python/common/jsonrpc.py b/tests/python/common/jsonrpc.py index 49a0071..79de35f 100644 --- a/tests/python/common/jsonrpc.py +++ b/tests/python/common/jsonrpc.py @@ -31,8 +31,8 @@ def to_json( def from_json(json_str: str, method: str = None, converter=None) -> types.MESSAGE_TYPES: - """Parses and given JSON string and returns LSP message object using the - provided converter.""" + """Parses and given JSON string and returns LSP message object using the provided + converter.""" if not converter: converter = converters.get_converter() diff --git a/tests/python/test_cattrs_special_cases.py b/tests/python/test_cattrs_special_cases.py index 5320e33..e023278 100644 --- a/tests/python/test_cattrs_special_cases.py +++ b/tests/python/test_cattrs_special_cases.py @@ -35,8 +35,7 @@ def test_numeric_validation(): def test_forward_refs(): - """Test that forward references are handled correctly by cattrs - converter.""" + """Test that forward references are handled correctly by cattrs converter.""" data = { "uri": "something.py", "diagnostics": [ @@ -115,8 +114,7 @@ def test_forward_refs(): ], ) def test_union_with_complex_type(data): - """Ensure types with multiple possible resolutions are handled - correctly.""" + """Ensure types with multiple possible resolutions are handled correctly.""" converter = cv.get_converter() obj = converter.structure(data, lsp.TextDocumentRegistrationOptions) hamcrest.assert_that(obj, hamcrest.instance_of(lsp.TextDocumentRegistrationOptions)) @@ -185,8 +183,7 @@ def test_keyword_field(): ], ) def test_LSPAny(data): - """Ensure that broad primitive and custom type alias is handled - correctly.""" + """Ensure that broad primitive and custom type alias is handled correctly.""" converter = cv.get_converter() obj = converter.structure(data, lsp.DidChangeConfigurationParams) hamcrest.assert_that(obj, hamcrest.instance_of(lsp.DidChangeConfigurationParams))