commit 766d5036275e871932893f8dfc8c5bc1eb7a3726
parent ac53996ebbafe964480f0865c49866f2a429e8a1
Author: Ricardo Casía <ricardocasia.dev@gmail.com>
Date: Tue, 20 Aug 2024 14:52:14 +0200
docs(lsp): annotate with `vim.lsp.protocol.Methods` enum #29521
Added the enum type annotation `vim.lsp.protocol.Methods` to provide some intellisense support.
Diffstat:
3 files changed, 1214 insertions(+), 962 deletions(-)
diff --git a/runtime/lua/vim/lsp/_meta/protocol.lua b/runtime/lua/vim/lsp/_meta/protocol.lua
@@ -134,7 +134,7 @@ error('Cannot require a meta file')
---The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.
---@field endCharacter? uinteger
---
----Describes the kind of the folding range such as `comment' or 'region'. The kind
+---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.
---@field kind? lsp.FoldingRangeKind
@@ -681,6 +681,11 @@ error('Cannot require a meta file')
---of a notebook cell.
---@field cellTextDocuments lsp.TextDocumentItem[]
+---Registration options specific to a notebook.
+---
+---@since 3.17.0
+---@class lsp.NotebookDocumentSyncRegistrationOptions: lsp.NotebookDocumentSyncOptions, lsp.StaticRegistrationOptions
+
---The params sent in a change notebook document notification.
---
---@since 3.17.0
@@ -789,7 +794,7 @@ error('Cannot require a meta file')
---Information about the server.
---
---@since 3.15.0
----@field serverInfo? lsp._anonym1.serverInfo
+---@field serverInfo? lsp.ServerInfo
---The data type of the ResponseError if the
---initialize request fails.
@@ -1115,7 +1120,7 @@ error('Cannot require a meta file')
---capability.
---
---@since 3.17.0
----@field itemDefaults? lsp._anonym2.itemDefaults
+---@field itemDefaults? lsp.CompletionItemDefaults
---
---The completion items.
---@field items lsp.CompletionItem[]
@@ -1171,7 +1176,7 @@ error('Cannot require a meta file')
---
---If `null`, no parameter of the signature is active (for example a named
---argument that does not match any declared parameters). This is only valid
----since 3.18.0 and if the client specifies the client capability
+---if the client specifies the client capability
---`textDocument.signatureHelp.noActiveParameterSupport === true`
---
---If omitted or the value lies outside the range of
@@ -1307,6 +1312,12 @@ error('Cannot require a meta file')
---Title of the command, like `save`.
---@field title string
---
+---An optional tooltip.
+---
+---@since 3.18.0
+---@proposed
+---@field tooltip? string
+---
---The identifier of the actual command handler.
---@field command string
---
@@ -1355,7 +1366,7 @@ error('Cannot require a meta file')
--- error message with `reason` in the editor.
---
---@since 3.16.0
----@field disabled? lsp._anonym4.disabled
+---@field disabled? lsp.CodeActionDisabled
---
---The workspace edit this code action performs.
---@field edit? lsp.WorkspaceEdit
@@ -1379,6 +1390,12 @@ error('Cannot require a meta file')
---
---A query string to filter symbols by. Clients may send an empty
---string here to request all symbols.
+---
+---The `query`-parameter should be interpreted in a *relaxed way* as editors
+---will apply their own highlighting and scoring on the results. A good rule
+---of thumb is to match case-insensitive and to simply check that the
+---characters of *query* appear in their order in a candidate symbol.
+---Servers shouldn't use prefix, substring, or similar strict matching.
---@field query string
---A special workspace symbol that supports locations without a range.
@@ -1393,7 +1410,7 @@ error('Cannot require a meta file')
---capability `workspace.symbol.resolveSupport`.
---
---See SymbolInformation#location for more details.
----@field location lsp.Location|lsp._anonym5.location
+---@field location lsp.Location|lsp.LocationUriOnly
---
---A data entry field that is preserved on a workspace symbol between a
---workspace symbol request and a workspace symbol resolve request.
@@ -1566,6 +1583,12 @@ error('Cannot require a meta file')
---
---The edits to apply.
---@field edit lsp.WorkspaceEdit
+---
+---Additional data about the edit.
+---
+---@since 3.18.0
+---@proposed
+---@field metadata? lsp.WorkspaceEditMetadata
---The result returned from the apply workspace edit request.
---
@@ -1650,7 +1673,7 @@ error('Cannot require a meta file')
---@class lsp.SetTraceParams
---
----@field value lsp.TraceValues
+---@field value lsp.TraceValue
---@class lsp.LogTraceParams
---
@@ -1848,10 +1871,10 @@ error('Cannot require a meta file')
---
---Server supports providing semantic tokens for a specific range
---of a document.
----@field range? boolean|lsp._anonym6.range
+---@field range? boolean|lsp._anonym1.range
---
---Server supports providing semantic tokens for a full document.
----@field full? boolean|lsp._anonym7.full
+---@field full? boolean|lsp.SemanticTokensFullDelta
---@since 3.16.0
---@class lsp.SemanticTokensEdit
@@ -1888,7 +1911,10 @@ error('Cannot require a meta file')
---
---@since 3.16.0 - support for AnnotatedTextEdit. This is guarded using a
---client capability.
----@field edits (lsp.TextEdit|lsp.AnnotatedTextEdit)[]
+---
+---@since 3.18.0 - support for SnippetTextEdit. This is guarded using a
+---client capability.
+---@field edits (lsp.TextEdit|lsp.AnnotatedTextEdit|lsp.SnippetTextEdit)[]
---Create file operation.
---@class lsp.CreateFile: lsp.ResourceOperation
@@ -2235,7 +2261,7 @@ error('Cannot require a meta file')
---@field uri lsp.DocumentUri
---
---The text document's language identifier.
----@field languageId string
+---@field languageId lsp.LanguageKind
---
---The version number of this document (it will increase after each
---change, including undo/redo).
@@ -2244,6 +2270,28 @@ error('Cannot require a meta file')
---The content of the opened text document.
---@field text string
+---Options specific to a notebook plus its cells
+---to be synced to the server.
+---
+---If a selector provides a notebook document
+---filter but no cell selector all cells of a
+---matching notebook document will be synced.
+---
+---If a selector provides no notebook document
+---filter but only a cell selector all notebook
+---document that contain at least one matching
+---cell will be synced.
+---
+---@since 3.17.0
+---@class lsp.NotebookDocumentSyncOptions
+---
+---The notebooks to be synced
+---@field notebookSelector (lsp.NotebookDocumentFilterWithNotebook|lsp.NotebookDocumentFilterWithCells)[]
+---
+---Whether save notification should be forwarded to
+---the server. Will only be honored if mode === `notebook`.
+---@field save? boolean
+
---A versioned notebook document identifier.
---
---@since 3.17.0
@@ -2266,7 +2314,7 @@ error('Cannot require a meta file')
---@field metadata? lsp.LSPObject
---
---Changes to cells
----@field cells? lsp._anonym8.cells
+---@field cells? lsp.NotebookDocumentCellChanges
---A literal to identify a notebook document in the client.
---
@@ -2348,7 +2396,7 @@ error('Cannot require a meta file')
---Information about the client
---
---@since 3.15.0
----@field clientInfo? lsp._anonym11.clientInfo
+---@field clientInfo? lsp.ClientInfo
---
---The locale the client is currently showing the user interface
---in. This must not necessarily be the locale of the operating
@@ -2380,7 +2428,7 @@ error('Cannot require a meta file')
---@field initializationOptions? lsp.LSPAny
---
---The initial trace setting. If omitted trace is disabled ('off').
----@field trace? lsp.TraceValues
+---@field trace? lsp.TraceValue
---@class lsp.WorkspaceFoldersInitializeParams
---
@@ -2534,18 +2582,24 @@ error('Cannot require a meta file')
---@proposed
---@field inlineCompletionProvider? boolean|lsp.InlineCompletionOptions
---
----Text document specific server capabilities.
----
----@since 3.18.0
----@proposed
----@field textDocument? lsp._anonym12.textDocument
----
---Workspace specific server capabilities.
----@field workspace? lsp._anonym14.workspace
+---@field workspace? lsp.WorkspaceOptions
---
---Experimental server capabilities.
---@field experimental? lsp.LSPAny
+---Information about the server
+---
+---@since 3.15.0
+---@since 3.18.0 ServerInfo type name added.
+---@class lsp.ServerInfo
+---
+---The name of the server as defined by the server.
+---@field name string
+---
+---The server's version as defined by the server.
+---@field version? string
+
---A text document identifier to denote a specific version of a text document.
---@class lsp.VersionedTextDocumentIdentifier: lsp.TextDocumentIdentifier
---
@@ -2586,8 +2640,9 @@ error('Cannot require a meta file')
---The range at which the message applies
---@field range lsp.Range
---
----The diagnostic's severity. Can be omitted. If omitted it is up to the
----client to interpret diagnostics as error, warning, info or hint.
+---The diagnostic's severity. To avoid interpretation mismatches when a
+---server is used with different clients it is highly recommended that servers
+---always provide a severity value.
---@field severity? lsp.DiagnosticSeverity
---
---The diagnostic's code, which usually appear in the user interface.
@@ -2604,10 +2659,8 @@ error('Cannot require a meta file')
---appears in the user interface.
---@field source? string
---
----The diagnostic's message. It usually appears in the user interface.
----
----@since 3.18.0 - support for `MarkupContent`. This is guarded by the client capability `textDocument.diagnostic.markupMessageSupport`.
----@field message string|lsp.MarkupContent
+---The diagnostic's message. It usually appears in the user interface
+---@field message string
---
---Additional metadata about the diagnostic.
---
@@ -2661,6 +2714,46 @@ error('Cannot require a meta file')
---The range if the replace is requested.
---@field replace lsp.Range
+---In many cases the items of an actual completion result share the same
+---value for properties like `commitCharacters` or the range of a text
+---edit. A completion list can therefore define item defaults which will
+---be used if a completion item itself doesn't specify the value.
+---
+---If a completion list specifies a default value and a completion item
+---also specifies a corresponding value the one from the item is used.
+---
+---Servers are only allowed to return default values if the client
+---signals support for this via the `completionList.itemDefaults`
+---capability.
+---
+---@since 3.17.0
+---@class lsp.CompletionItemDefaults
+---
+---A default commit character set.
+---
+---@since 3.17.0
+---@field commitCharacters? string[]
+---
+---A default edit range.
+---
+---@since 3.17.0
+---@field editRange? lsp.Range|lsp.EditRangeWithInsertReplace
+---
+---A default insert text format.
+---
+---@since 3.17.0
+---@field insertTextFormat? lsp.InsertTextFormat
+---
+---A default insert text mode.
+---
+---@since 3.17.0
+---@field insertTextMode? lsp.InsertTextMode
+---
+---A default data value.
+---
+---@since 3.17.0
+---@field data? lsp.LSPAny
+
---Completion options.
---@class lsp.CompletionOptions: lsp.WorkDoneProgressOptions
---
@@ -2692,7 +2785,7 @@ error('Cannot require a meta file')
---capabilities.
---
---@since 3.17.0
----@field completionItem? lsp._anonym15.completionItem
+---@field completionItem? lsp.ServerCompletionItemOptions
---Hover options.
---@class lsp.HoverOptions: lsp.WorkDoneProgressOptions
@@ -2742,7 +2835,7 @@ error('Cannot require a meta file')
---
---If `null`, no parameter of the signature is active (for example a named
---argument that does not match any declared parameters). This is only valid
----since 3.18.0 and if the client specifies the client capability
+---if the client specifies the client capability
---`textDocument.signatureHelp.noActiveParameterSupport === true`
---
---If provided (or `null`), this is used in place of
@@ -2819,8 +2912,6 @@ error('Cannot require a meta file')
---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.
----
----Note that the client should check the `textDocument.diagnostic.markupMessageSupport` server capability before sending diagnostics with markup messages to a server.
---@field diagnostics lsp.Diagnostic[]
---
---Requested kind of actions to return.
@@ -2834,6 +2925,16 @@ error('Cannot require a meta file')
---@since 3.17.0
---@field triggerKind? lsp.CodeActionTriggerKind
+---Captures why the code action is currently disabled.
+---
+---@since 3.18.0
+---@class lsp.CodeActionDisabled
+---
+---Human readable description of why the code action is currently disabled.
+---
+---This is displayed in the code actions UI.
+---@field reason string
+
---Provider options for a {@link CodeActionRequest}.
---@class lsp.CodeActionOptions: lsp.WorkDoneProgressOptions
---
@@ -2843,12 +2944,36 @@ error('Cannot require a meta file')
---may list out every specific kind they provide.
---@field codeActionKinds? lsp.CodeActionKind[]
---
+---Static documentation for a class of code actions.
+---
+---Documentation from the provider should be shown in the code actions menu if either:
+---
+---- Code actions of `kind` are requested by the editor. In this case, the editor will show the documentation that
+--- most closely matches the requested code action kind. For example, if a provider has documentation for
+--- both `Refactor` and `RefactorExtract`, when the user requests code actions for `RefactorExtract`,
+--- the editor will use the documentation for `RefactorExtract` instead of the documentation for `Refactor`.
+---
+---- Any code actions of `kind` are returned by the provider.
+---
+---At most one documentation entry should be shown per provider.
+---
+---@since 3.18.0
+---@proposed
+---@field documentation? lsp.CodeActionKindDocumentation[]
+---
---The server provides support to resolve additional
---information for a code action.
---
---@since 3.16.0
---@field resolveProvider? boolean
+---Location with only uri and does not include range.
+---
+---@since 3.18.0
+---@class lsp.LocationUriOnly
+---
+---@field uri lsp.DocumentUri
+
---Server capabilities for a {@link WorkspaceSymbolRequest}.
---@class lsp.WorkspaceSymbolOptions: lsp.WorkDoneProgressOptions
---
@@ -2923,12 +3048,33 @@ error('Cannot require a meta file')
---@since version 3.12.0
---@field prepareProvider? boolean
+---@since 3.18.0
+---@class lsp.PrepareRenamePlaceholder
+---
+---@field range lsp.Range
+---
+---@field placeholder string
+
+---@since 3.18.0
+---@class lsp.PrepareRenameDefaultBehavior
+---
+---@field defaultBehavior boolean
+
---The server capabilities of a {@link ExecuteCommandRequest}.
---@class lsp.ExecuteCommandOptions: lsp.WorkDoneProgressOptions
---
---The commands to be executed on the server
---@field commands string[]
+---Additional data about a workspace edit.
+---
+---@since 3.18.0
+---@proposed
+---@class lsp.WorkspaceEditMetadata
+---
+---Signal to the editor that this edit is a refactoring.
+---@field isRefactoring? boolean
+
---@since 3.16.0
---@class lsp.SemanticTokensLegend
---
@@ -2938,6 +3084,14 @@ error('Cannot require a meta file')
---The token modifiers a server uses.
---@field tokenModifiers string[]
+---Semantic tokens options to support deltas for full documents
+---
+---@since 3.18.0
+---@class lsp.SemanticTokensFullDelta
+---
+---The server supports deltas for full documents.
+---@field delta? boolean
+
---A text document identifier to optionally denote a specific version of a text document.
---@class lsp.OptionalVersionedTextDocumentIdentifier: lsp.TextDocumentIdentifier
---
@@ -2956,6 +3110,21 @@ error('Cannot require a meta file')
---The actual identifier of the change annotation
---@field annotationId lsp.ChangeAnnotationIdentifier
+---An interactive text edit.
+---
+---@since 3.18.0
+---@proposed
+---@class lsp.SnippetTextEdit
+---
+---The range of the text document to be manipulated.
+---@field range lsp.Range
+---
+---The snippet to be inserted.
+---@field snippet lsp.StringValue
+---
+---The actual identifier of the snippet edit.
+---@field annotationId? lsp.ChangeAnnotationIdentifier
+
---A generic resource operation.
---@class lsp.ResourceOperation
---
@@ -3066,20 +3235,43 @@ error('Cannot require a meta file')
---if supported by the client.
---@field executionSummary? lsp.ExecutionSummary
----A change describing how to move a `NotebookCell`
----array from state S to S'.
+---@since 3.18.0
+---@class lsp.NotebookDocumentFilterWithNotebook
---
----@since 3.17.0
----@class lsp.NotebookCellArrayChange
+---The notebook to be synced If a string
+---value is provided it matches against the
+---notebook type. '*' matches every notebook.
+---@field notebook string|lsp.NotebookDocumentFilter
---
----The start oftest of the cell that changed.
----@field start uinteger
+---The cells of the matching notebook to be synced.
+---@field cells? lsp.NotebookCellLanguage[]
+
+---@since 3.18.0
+---@class lsp.NotebookDocumentFilterWithCells
---
----The deleted cells
----@field deleteCount uinteger
+---The notebook to be synced If a string
+---value is provided it matches against the
+---notebook type. '*' matches every notebook.
+---@field notebook? string|lsp.NotebookDocumentFilter
---
----The new cells, if any
----@field cells? lsp.NotebookCell[]
+---The cells of the matching notebook to be synced.
+---@field cells lsp.NotebookCellLanguage[]
+
+---Cell changes to a notebook document.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentCellChanges
+---
+---Changes to the cell structure to add or
+---remove cells.
+---@field structure? lsp.NotebookDocumentCellChangeStructure
+---
+---Changes to notebook cells properties like its
+---kind, execution summary or metadata.
+---@field data? lsp.NotebookCell[]
+---
+---Changes to the text content of notebook cells.
+---@field textContent? lsp.NotebookDocumentCellContentChanges[]
---Describes the currently selected completion item.
---
@@ -3093,6 +3285,18 @@ error('Cannot require a meta file')
---The text the range will be replaced with if this completion is accepted.
---@field text string
+---Information about the client
+---
+---@since 3.15.0
+---@since 3.18.0 ClientInfo type name added.
+---@class lsp.ClientInfo
+---
+---The name of the client as defined by the client.
+---@field name string
+---
+---The client's version as defined by the client.
+---@field version? string
+
---Defines the capabilities provided by the client.
---@class lsp.ClientCapabilities
---
@@ -3140,69 +3344,40 @@ error('Cannot require a meta file')
---sent.
---@field save? boolean|lsp.SaveOptions
----Options specific to a notebook plus its cells
----to be synced to the server.
+---Defines workspace specific capabilities of the server.
---
----If a selector provides a notebook document
----filter but no cell selector all cells of a
----matching notebook document will be synced.
+---@since 3.18.0
+---@class lsp.WorkspaceOptions
---
----If a selector provides no notebook document
----filter but only a cell selector all notebook
----document that contain at least one matching
----cell will be synced.
+---The server supports workspace folder.
---
----@since 3.17.0
----@class lsp.NotebookDocumentSyncOptions
+---@since 3.6.0
+---@field workspaceFolders? lsp.WorkspaceFoldersServerCapabilities
---
----The notebooks to be synced
----@field notebookSelector (lsp._anonym16.notebookSelector|lsp._anonym18.notebookSelector)[]
+---The server is interested in notifications/requests for operations on files.
---
----Whether save notification should be forwarded to
----the server. Will only be honored if mode === `notebook`.
----@field save? boolean
+---@since 3.16.0
+---@field fileOperations? lsp.FileOperationOptions
----Registration options specific to a notebook.
+---@since 3.18.0
+---@class lsp.TextDocumentContentChangePartial
---
----@since 3.17.0
----@class lsp.NotebookDocumentSyncRegistrationOptions: lsp.NotebookDocumentSyncOptions, lsp.StaticRegistrationOptions
-
----@class lsp.WorkspaceFoldersServerCapabilities
+---The range of the document that changed.
+---@field range lsp.Range
---
----The server has support for workspace folders
----@field supported? boolean
+---The optional length of the range that got replaced.
---
----Whether the server wants to receive workspace folder
----change notifications.
+---@deprecated use range instead.
+---@field rangeLength? uinteger
---
----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.
----@field changeNotifications? string|boolean
+---The new text for the provided range.
+---@field text string
----Options for notifications/requests for user operations on files.
----
----@since 3.16.0
----@class lsp.FileOperationOptions
----
----The server is interested in receiving didCreateFiles notifications.
----@field didCreate? lsp.FileOperationRegistrationOptions
----
----The server is interested in receiving willCreateFiles requests.
----@field willCreate? lsp.FileOperationRegistrationOptions
----
----The server is interested in receiving didRenameFiles notifications.
----@field didRename? lsp.FileOperationRegistrationOptions
----
----The server is interested in receiving willRenameFiles requests.
----@field willRename? lsp.FileOperationRegistrationOptions
----
----The server is interested in receiving didDeleteFiles file notifications.
----@field didDelete? lsp.FileOperationRegistrationOptions
+---@since 3.18.0
+---@class lsp.TextDocumentContentChangeWholeDocument
---
----The server is interested in receiving willDeleteFiles file requests.
----@field willDelete? lsp.FileOperationRegistrationOptions
+---The new text of the whole document.
+---@field text string
---Structure to capture a description for an error code.
---
@@ -3223,6 +3398,33 @@ error('Cannot require a meta file')
---The message of this related diagnostic information.
---@field message string
+---Edit range variant that includes ranges for insert and replace operations.
+---
+---@since 3.18.0
+---@class lsp.EditRangeWithInsertReplace
+---
+---@field insert lsp.Range
+---
+---@field replace lsp.Range
+
+---@since 3.18.0
+---@class lsp.ServerCompletionItemOptions
+---
+---The server has support for completion item label
+---details (see also `CompletionItemLabelDetails`) when
+---receiving a completion item in a resolve call.
+---
+---@since 3.17.0
+---@field labelDetailsSupport? boolean
+
+---@since 3.18.0
+---@deprecated use MarkupContent instead.
+---@class lsp.MarkedStringWithLanguage
+---
+---@field language string
+---
+---@field value string
+
---Represents a parameter of a callable-signature. A parameter can
---have a label and a doc-comment.
---@class lsp.ParameterInformation
@@ -3233,6 +3435,10 @@ error('Cannot require a meta file')
---signature label. (see SignatureInformation.label). The offsets are based on a UTF-16
---string representation as `Position` and `Range` does.
---
+---To avoid ambiguities a server should use the [start, end] offset value instead of using
+---a substring. Whether a client support this is controlled via `labelOffsetSupport` client
+---capability.
+---
---*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`.
---@field label string|[uinteger, uinteger]
@@ -3241,6 +3447,24 @@ error('Cannot require a meta file')
---in the UI but can be omitted.
---@field documentation? string|lsp.MarkupContent
+---Documentation for a class of code actions.
+---
+---@since 3.18.0
+---@proposed
+---@class lsp.CodeActionKindDocumentation
+---
+---The kind of the code action being documented.
+---
+---If the kind is generic, such as `CodeActionKind.Refactor`, the documentation will be shown whenever any
+---refactorings are returned. If the kind if more specific, such as `CodeActionKind.RefactorExtract`, the
+---documentation will only be shown when extract refactoring code actions are returned.
+---@field kind lsp.CodeActionKind
+---
+---Command that is ued to display the documentation to the user.
+---
+---The title of this documentation code action is taken from {@linkcode Command.title}
+---@field command lsp.Command
+
---A notebook cell text document filter denotes a cell text
---document by different properties.
---
@@ -3278,6 +3502,34 @@ error('Cannot require a meta file')
---not if known by the client.
---@field success? boolean
+---@since 3.18.0
+---@class lsp.NotebookCellLanguage
+---
+---@field language string
+
+---Structural changes to cells in a notebook document.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentCellChangeStructure
+---
+---The change to the cell array.
+---@field array lsp.NotebookCellArrayChange
+---
+---Additional opened cell text documents.
+---@field didOpen? lsp.TextDocumentItem[]
+---
+---Additional closed cell text documents.
+---@field didClose? lsp.TextDocumentIdentifier[]
+
+---Content changes to a cell in a notebook document.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentCellContentChanges
+---
+---@field document lsp.VersionedTextDocumentIdentifier
+---
+---@field changes lsp.TextDocumentContentChangeEvent[]
+
---Workspace specific client capabilities.
---@class lsp.WorkspaceClientCapabilities
---
@@ -3524,7 +3776,7 @@ error('Cannot require a meta file')
---anymore since the information is outdated).
---
---@since 3.17.0
----@field staleRequestSupport? lsp._anonym20.staleRequestSupport
+---@field staleRequestSupport? lsp.StaleRequestSupportOptions
---
---Client capabilities specific to regular expressions.
---
@@ -3556,6 +3808,43 @@ error('Cannot require a meta file')
---@since 3.17.0
---@field positionEncodings? lsp.PositionEncodingKind[]
+---@class lsp.WorkspaceFoldersServerCapabilities
+---
+---The server has support for workspace folders
+---@field supported? boolean
+---
+---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.
+---@field changeNotifications? string|boolean
+
+---Options for notifications/requests for user operations on files.
+---
+---@since 3.16.0
+---@class lsp.FileOperationOptions
+---
+---The server is interested in receiving didCreateFiles notifications.
+---@field didCreate? lsp.FileOperationRegistrationOptions
+---
+---The server is interested in receiving willCreateFiles requests.
+---@field willCreate? lsp.FileOperationRegistrationOptions
+---
+---The server is interested in receiving didRenameFiles notifications.
+---@field didRename? lsp.FileOperationRegistrationOptions
+---
+---The server is interested in receiving willRenameFiles requests.
+---@field willRename? lsp.FileOperationRegistrationOptions
+---
+---The server is interested in receiving didDeleteFiles file notifications.
+---@field didDelete? lsp.FileOperationRegistrationOptions
+---
+---The server is interested in receiving willDeleteFiles file requests.
+---@field willDelete? lsp.FileOperationRegistrationOptions
+
---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.
@@ -3570,6 +3859,111 @@ error('Cannot require a meta file')
---The actual glob pattern;
---@field pattern lsp.Pattern
+---A document filter where `language` is required field.
+---
+---@since 3.18.0
+---@class lsp.TextDocumentFilterLanguage
+---
+---A language id, like `typescript`.
+---@field language string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme? string
+---
+---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
+---
+---@since 3.18.0 - support for relative patterns.
+---@field pattern? lsp.GlobPattern
+
+---A document filter where `scheme` is required field.
+---
+---@since 3.18.0
+---@class lsp.TextDocumentFilterScheme
+---
+---A language id, like `typescript`.
+---@field language? string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme string
+---
+---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
+---
+---@since 3.18.0 - support for relative patterns.
+---@field pattern? lsp.GlobPattern
+
+---A document filter where `pattern` is required field.
+---
+---@since 3.18.0
+---@class lsp.TextDocumentFilterPattern
+---
+---A language id, like `typescript`.
+---@field language? string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme? string
+---
+---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
+---
+---@since 3.18.0 - support for relative patterns.
+---@field pattern lsp.GlobPattern
+
+---A notebook document filter where `notebookType` is required field.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentFilterNotebookType
+---
+---The type of the enclosing notebook.
+---@field notebookType string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme? string
+---
+---A glob pattern.
+---@field pattern? lsp.GlobPattern
+
+---A notebook document filter where `scheme` is required field.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentFilterScheme
+---
+---The type of the enclosing notebook.
+---@field notebookType? string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme string
+---
+---A glob pattern.
+---@field pattern? lsp.GlobPattern
+
+---A notebook document filter where `pattern` is required field.
+---
+---@since 3.18.0
+---@class lsp.NotebookDocumentFilterPattern
+---
+---The type of the enclosing notebook.
+---@field notebookType? string
+---
+---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
+---@field scheme? string
+---
+---A glob pattern.
+---@field pattern lsp.GlobPattern
+
+---A change describing how to move a `NotebookCell`
+---array from state S to S'.
+---
+---@since 3.17.0
+---@class lsp.NotebookCellArrayChange
+---
+---The start oftest of the cell that changed.
+---@field start uinteger
+---
+---The deleted cells
+---@field deleteCount uinteger
+---
+---The new cells, if any
+---@field cells? lsp.NotebookCell[]
+
---@class lsp.WorkspaceEditClientCapabilities
---
---The client supports versioned document changes in `WorkspaceEdit`s
@@ -3600,7 +3994,19 @@ error('Cannot require a meta file')
---create file, rename file and delete file changes.
---
---@since 3.16.0
----@field changeAnnotationSupport? lsp._anonym21.changeAnnotationSupport
+---@field changeAnnotationSupport? lsp.ChangeAnnotationsSupportOptions
+---
+---Whether the client supports `WorkspaceEditMetadata` in `WorkspaceEdit`s.
+---
+---@since 3.18.0
+---@proposed
+---@field metadataSupport? boolean
+---
+---Whether the client supports snippets as text edits.
+---
+---@since 3.18.0
+---@proposed
+---@field snippetEditSupport? boolean
---@class lsp.DidChangeConfigurationClientCapabilities
---
@@ -3627,20 +4033,20 @@ error('Cannot require a meta file')
---@field dynamicRegistration? boolean
---
---Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
----@field symbolKind? lsp._anonym22.symbolKind
+---@field symbolKind? lsp.ClientSymbolKindOptions
---
---The client supports tags on `SymbolInformation`.
---Clients supporting tags have to handle unknown tags gracefully.
---
---@since 3.16.0
----@field tagSupport? lsp._anonym23.tagSupport
+---@field tagSupport? lsp.ClientSymbolTagOptions
---
---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
----@field resolveSupport? lsp._anonym24.resolveSupport
+---@field resolveSupport? lsp.ClientSymbolResolveOptions
---The client capabilities of a {@link ExecuteCommandRequest}.
---@class lsp.ExecuteCommandClientCapabilities
@@ -3785,9 +4191,9 @@ error('Cannot require a meta file')
---
---The client supports the following `CompletionItem` specific
---capabilities.
----@field completionItem? lsp._anonym25.completionItem
+---@field completionItem? lsp.ClientCompletionItemOptions
---
----@field completionItemKind? lsp._anonym29.completionItemKind
+---@field completionItemKind? lsp.ClientCompletionItemOptionsKind
---
---Defines how the client handles whitespace and indentation
---when accepting a completion item that uses multi line
@@ -3804,7 +4210,7 @@ error('Cannot require a meta file')
---capabilities.
---
---@since 3.17.0
----@field completionList? lsp._anonym30.completionList
+---@field completionList? lsp.CompletionListCapabilities
---@class lsp.HoverClientCapabilities
---
@@ -3823,7 +4229,7 @@ error('Cannot require a meta file')
---
---The client supports the following `SignatureInformation`
---specific properties.
----@field signatureInformation? lsp._anonym31.signatureInformation
+---@field signatureInformation? lsp.ClientSignatureInformationOptions
---
---The client supports to send additional context information for a
---`textDocument/signatureHelp` request. A client that opts into
@@ -3901,7 +4307,7 @@ error('Cannot require a meta file')
---
---Specific capabilities for the `SymbolKind` in the
---`textDocument/documentSymbol` request.
----@field symbolKind? lsp._anonym33.symbolKind
+---@field symbolKind? lsp.ClientSymbolKindOptions
---
---The client supports hierarchical document symbols.
---@field hierarchicalDocumentSymbolSupport? boolean
@@ -3911,7 +4317,7 @@ error('Cannot require a meta file')
---Clients supporting tags have to handle unknown tags gracefully.
---
---@since 3.16.0
----@field tagSupport? lsp._anonym34.tagSupport
+---@field tagSupport? lsp.ClientSymbolTagOptions
---
---The client supports an additional label presented in the UI when
---registering a document symbol provider.
@@ -3930,7 +4336,7 @@ error('Cannot require a meta file')
---set the request can only return `Command` literals.
---
---@since 3.8.0
----@field codeActionLiteralSupport? lsp._anonym35.codeActionLiteralSupport
+---@field codeActionLiteralSupport? lsp.ClientCodeActionLiteralOptions
---
---Whether code action supports the `isPreferred` property.
---
@@ -3953,7 +4359,7 @@ error('Cannot require a meta file')
---properties via a separate `codeAction/resolve` request.
---
---@since 3.16.0
----@field resolveSupport? lsp._anonym37.resolveSupport
+---@field resolveSupport? lsp.ClientCodeActionResolveOptions
---
---Whether the client honors the change annotations in
---text edits and resource operations returned via the
@@ -3963,12 +4369,25 @@ error('Cannot require a meta file')
---
---@since 3.16.0
---@field honorsChangeAnnotations? boolean
+---
+---Whether the client supports documentation for a class of
+---code actions.
+---
+---@since 3.18.0
+---@proposed
+---@field documentationSupport? boolean
---The client capabilities of a {@link CodeLensRequest}.
---@class lsp.CodeLensClientCapabilities
---
---Whether code lens supports dynamic registration.
---@field dynamicRegistration? boolean
+---
+---Whether the client supports resolving additional code lens
+---properties via a separate `codeLens/resolve` request.
+---
+---@since 3.18.0
+---@field resolveSupport? lsp.ClientCodeLensResolveOptions
---The client capabilities of a {@link DocumentLinkRequest}.
---@class lsp.DocumentLinkClientCapabilities
@@ -4061,12 +4480,12 @@ error('Cannot require a meta file')
---Specific options for the folding range kind.
---
---@since 3.17.0
----@field foldingRangeKind? lsp._anonym38.foldingRangeKind
+---@field foldingRangeKind? lsp.ClientFoldingRangeKindOptions
---
---Specific options for the folding range.
---
---@since 3.17.0
----@field foldingRange? lsp._anonym39.foldingRange
+---@field foldingRange? lsp.ClientFoldingRangeOptions
---@class lsp.SelectionRangeClientCapabilities
---
@@ -4076,34 +4495,13 @@ error('Cannot require a meta file')
---@field dynamicRegistration? boolean
---The publish diagnostic client capabilities.
----@class lsp.PublishDiagnosticsClientCapabilities
----
----Whether the clients accepts diagnostics with related information.
----@field relatedInformation? boolean
----
----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
----@field tagSupport? lsp._anonym40.tagSupport
+---@class lsp.PublishDiagnosticsClientCapabilities: lsp.DiagnosticsCapabilities
---
---Whether the client interprets the version property of the
---`textDocument/publishDiagnostics` notification's parameter.
---
---@since 3.15.0
---@field versionSupport? boolean
----
----Client supports a codeDescription property
----
----@since 3.16.0
----@field codeDescriptionSupport? boolean
----
----Whether code action supports the `data` property which is
----preserved between a `textDocument/publishDiagnostics` and
----`textDocument/codeAction` request.
----
----@since 3.16.0
----@field dataSupport? boolean
---@since 3.16.0
---@class lsp.CallHierarchyClientCapabilities
@@ -4129,7 +4527,7 @@ error('Cannot require a meta file')
---`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.
----@field requests lsp._anonym41.requests
+---@field requests lsp.ClientSemanticTokensRequestOptions
---
---The token types that the client supports.
---@field tokenTypes string[]
@@ -4212,12 +4610,12 @@ error('Cannot require a meta file')
---
---Indicates which properties a client can resolve lazily on an inlay
---hint.
----@field resolveSupport? lsp._anonym44.resolveSupport
+---@field resolveSupport? lsp.ClientInlayHintResolveOptions
---Client capabilities specific to diagnostic pull requests.
---
---@since 3.17.0
----@class lsp.DiagnosticClientCapabilities
+---@class lsp.DiagnosticClientCapabilities: lsp.DiagnosticsCapabilities
---
---Whether implementation supports dynamic registration. If this is set to `true`
---the client supports the new `(TextDocumentRegistrationOptions & StaticRegistrationOptions)`
@@ -4226,9 +4624,6 @@ error('Cannot require a meta file')
---
---Whether the clients supports related documents for document diagnostic pulls.
---@field relatedDocumentSupport? boolean
----
----Whether the client supports `MarkupContent` in diagnostic messages.
----@field markupMessageSupport? boolean
---Client capabilities specific to inline completions.
---
@@ -4257,7 +4652,7 @@ error('Cannot require a meta file')
---@class lsp.ShowMessageRequestClientCapabilities
---
---Capabilities specific to the `MessageActionItem` type.
----@field messageActionItem? lsp._anonym45.messageActionItem
+---@field messageActionItem? lsp.ClientShowMessageActionItemOptions
---Client capabilities for the showDocument request.
---
@@ -4268,13 +4663,24 @@ error('Cannot require a meta file')
---request.
---@field support boolean
+---@since 3.18.0
+---@class lsp.StaleRequestSupportOptions
+---
+---The client will actively cancel the request.
+---@field cancel boolean
+---
+---The list of requests for which the client
+---will retry the request if it receives a
+---response with error code `ContentModified`
+---@field retryOnContentModified string[]
+
---Client capabilities specific to regular expressions.
---
---@since 3.16.0
---@class lsp.RegularExpressionsClientCapabilities
---
---The engine's name.
----@field engine string
+---@field engine lsp.RegularExpressionEngineKind
---
---The engine's version.
---@field version? string
@@ -4296,988 +4702,832 @@ error('Cannot require a meta file')
---@since 3.17.0
---@field allowedTags? string[]
----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.18.0
+---@class lsp.ChangeAnnotationsSupportOptions
---
----@since 3.16.0
----@alias lsp.SemanticTokenTypes
----| "namespace" # namespace
----| "type" # type
----| "class" # class
----| "enum" # enum
----| "interface" # interface
----| "struct" # struct
----| "typeParameter" # typeParameter
----| "parameter" # parameter
----| "variable" # variable
----| "property" # property
----| "enumMember" # enumMember
----| "event" # event
----| "function" # function
----| "method" # method
----| "macro" # macro
----| "keyword" # keyword
----| "modifier" # modifier
----| "comment" # comment
----| "string" # string
----| "number" # number
----| "regexp" # regexp
----| "operator" # operator
----| "decorator" # decorator
+---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.
+---@field groupsOnLabel? boolean
----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
----@alias lsp.SemanticTokenModifiers
----| "declaration" # declaration
----| "definition" # definition
----| "readonly" # readonly
----| "static" # static
----| "deprecated" # deprecated
----| "abstract" # abstract
----| "async" # async
----| "modification" # modification
----| "documentation" # documentation
----| "defaultLibrary" # defaultLibrary
-
----The document diagnostic report kinds.
+---@since 3.18.0
+---@class lsp.ClientSymbolKindOptions
---
----@since 3.17.0
----@alias lsp.DocumentDiagnosticReportKind
----| "full" # Full
----| "unchanged" # Unchanged
-
----Predefined error codes.
----@alias lsp.ErrorCodes
----| -32700 # ParseError
----| -32600 # InvalidRequest
----| -32601 # MethodNotFound
----| -32602 # InvalidParams
----| -32603 # InternalError
----| -32002 # ServerNotInitialized
----| -32001 # UnknownErrorCode
-
----@alias lsp.LSPErrorCodes
----| -32803 # RequestFailed
----| -32802 # ServerCancelled
----| -32801 # ContentModified
----| -32800 # RequestCancelled
-
----A set of predefined range kinds.
----@alias lsp.FoldingRangeKind
----| "comment" # Comment
----| "imports" # Imports
----| "region" # Region
-
----A symbol kind.
----@alias lsp.SymbolKind
----| 1 # File
----| 2 # Module
----| 3 # Namespace
----| 4 # Package
----| 5 # Class
----| 6 # Method
----| 7 # Property
----| 8 # Field
----| 9 # Constructor
----| 10 # Enum
----| 11 # Interface
----| 12 # Function
----| 13 # Variable
----| 14 # Constant
----| 15 # String
----| 16 # Number
----| 17 # Boolean
----| 18 # Array
----| 19 # Object
----| 20 # Key
----| 21 # Null
----| 22 # EnumMember
----| 23 # Struct
----| 24 # Event
----| 25 # Operator
----| 26 # TypeParameter
-
----Symbol tags are extra annotations that tweak the rendering of a symbol.
+---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.
---
----@since 3.16
----@alias lsp.SymbolTag
----| 1 # Deprecated
+---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.
+---@field valueSet? lsp.SymbolKind[]
----Moniker uniqueness level to define scope of the moniker.
+---@since 3.18.0
+---@class lsp.ClientSymbolTagOptions
---
----@since 3.16.0
----@alias lsp.UniquenessLevel
----| "document" # document
----| "project" # project
----| "group" # group
----| "scheme" # scheme
----| "global" # global
+---The tags supported by the client.
+---@field valueSet lsp.SymbolTag[]
----The moniker kind.
+---@since 3.18.0
+---@class lsp.ClientSymbolResolveOptions
---
----@since 3.16.0
----@alias lsp.MonikerKind
----| "import" # import
----| "export" # export
----| "local" # local
+---The properties that a client can resolve lazily. Usually
+---`location.range`
+---@field properties string[]
----Inlay hint kinds.
+---@since 3.18.0
+---@class lsp.ClientCompletionItemOptions
---
----@since 3.17.0
----@alias lsp.InlayHintKind
----| 1 # Type
----| 2 # Parameter
-
----The message type
----@alias lsp.MessageType
----| 1 # Error
----| 2 # Warning
----| 3 # Info
----| 4 # Log
----| 5 # Debug
-
----Defines how the host (editor) should sync
----document changes to the language server.
----@alias lsp.TextDocumentSyncKind
----| 0 # None
----| 1 # Full
----| 2 # Incremental
-
----Represents reasons why a text document is saved.
----@alias lsp.TextDocumentSaveReason
----| 1 # Manual
----| 2 # AfterDelay
----| 3 # FocusOut
-
----The kind of a completion entry.
----@alias lsp.CompletionItemKind
----| 1 # Text
----| 2 # Method
----| 3 # Function
----| 4 # Constructor
----| 5 # Field
----| 6 # Variable
----| 7 # Class
----| 8 # Interface
----| 9 # Module
----| 10 # Property
----| 11 # Unit
----| 12 # Value
----| 13 # Enum
----| 14 # Keyword
----| 15 # Snippet
----| 16 # Color
----| 17 # File
----| 18 # Reference
----| 19 # Folder
----| 20 # EnumMember
----| 21 # Constant
----| 22 # Struct
----| 23 # Event
----| 24 # Operator
----| 25 # TypeParameter
-
----Completion item tags are extra annotations that tweak the rendering of a completion
----item.
+---Client supports snippets as insert text.
---
----@since 3.15.0
----@alias lsp.CompletionItemTag
----| 1 # Deprecated
-
----Defines whether the insert text in a completion item should be interpreted as
----plain text or a snippet.
----@alias lsp.InsertTextFormat
----| 1 # PlainText
----| 2 # Snippet
-
----How whitespace and indentation is handled during completion
----item insertion.
+---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.
+---@field snippetSupport? boolean
---
----@since 3.16.0
----@alias lsp.InsertTextMode
----| 1 # asIs
----| 2 # adjustIndentation
-
----A document highlight kind.
----@alias lsp.DocumentHighlightKind
----| 1 # Text
----| 2 # Read
----| 3 # Write
-
----A set of predefined code action kinds
----@alias lsp.CodeActionKind
----| "" # Empty
----| "quickfix" # QuickFix
----| "refactor" # Refactor
----| "refactor.extract" # RefactorExtract
----| "refactor.inline" # RefactorInline
----| "refactor.rewrite" # RefactorRewrite
----| "source" # Source
----| "source.organizeImports" # SourceOrganizeImports
----| "source.fixAll" # SourceFixAll
-
----@alias lsp.TraceValues
----| "off" # Off
----| "messages" # Messages
----| "verbose" # Verbose
-
----Describes the content type that a client supports in various
----result literals like `Hover`, `ParameterInfo` or `CompletionItem`.
+---Client supports commit characters on a completion item.
+---@field commitCharactersSupport? boolean
---
----Please note that `MarkupKinds` must not start with a `$`. This kinds
----are reserved for internal usage.
----@alias lsp.MarkupKind
----| "plaintext" # PlainText
----| "markdown" # Markdown
-
----Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
+---Client supports the following content formats for the documentation
+---property. The order describes the preferred format of the client.
+---@field documentationFormat? lsp.MarkupKind[]
---
----@since 3.18.0
----@proposed
----@alias lsp.InlineCompletionTriggerKind
----| 0 # Invoked
----| 1 # Automatic
-
----A set of predefined position encoding kinds.
+---Client supports the deprecated property on a completion item.
+---@field deprecatedSupport? boolean
---
----@since 3.17.0
----@alias lsp.PositionEncodingKind
----| "utf-8" # UTF8
----| "utf-16" # UTF16
----| "utf-32" # UTF32
-
----The file event type
----@alias lsp.FileChangeType
----| 1 # Created
----| 2 # Changed
----| 3 # Deleted
-
----@alias lsp.WatchKind
----| 1 # Create
----| 2 # Change
----| 4 # Delete
-
----The diagnostic's severity.
----@alias lsp.DiagnosticSeverity
----| 1 # Error
----| 2 # Warning
----| 3 # Information
----| 4 # Hint
-
----The diagnostic tags.
+---Client supports the preselect property on a completion item.
+---@field preselectSupport? boolean
---
----@since 3.15.0
----@alias lsp.DiagnosticTag
----| 1 # Unnecessary
----| 2 # Deprecated
-
----How a completion was triggered
----@alias lsp.CompletionTriggerKind
----| 1 # Invoked
----| 2 # TriggerCharacter
----| 3 # TriggerForIncompleteCompletions
-
----How a signature help was triggered.
+---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
----@alias lsp.SignatureHelpTriggerKind
----| 1 # Invoked
----| 2 # TriggerCharacter
----| 3 # ContentChange
-
----The reason why code actions were requested.
+---@field tagSupport? lsp.CompletionItemTagOptions
---
----@since 3.17.0
----@alias lsp.CodeActionTriggerKind
----| 1 # Invoked
----| 2 # Automatic
-
----A pattern kind describing if a glob pattern matches a file a folder or
----both.
+---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
----@alias lsp.FileOperationPatternKind
----| "file" # file
----| "folder" # folder
-
----A notebook cell kind.
----
----@since 3.17.0
----@alias lsp.NotebookCellKind
----| 1 # Markup
----| 2 # Code
-
----@alias lsp.ResourceOperationKind
----| "create" # Create
----| "rename" # Rename
----| "delete" # Delete
-
----@alias lsp.FailureHandlingKind
----| "abort" # Abort
----| "transactional" # Transactional
----| "textOnlyTransactional" # TextOnlyTransactional
----| "undo" # Undo
-
----@alias lsp.PrepareSupportDefaultBehavior
----| 1 # Identifier
-
----@alias lsp.TokenFormat
----| "relative" # Relative
-
----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.
+---@field insertReplaceSupport? boolean
---
----Servers should prefer returning `DefinitionLink` over `Definition` if supported
----by the client.
----@alias lsp.Definition lsp.Location|lsp.Location[]
-
----Information about where a symbol is defined.
+---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.
---
----Provides additional metadata over normal {@link Location location} definitions, including the range of
----the defining symbol
----@alias lsp.DefinitionLink lsp.LocationLink
-
----LSP arrays.
----@since 3.17.0
----@alias lsp.LSPArray lsp.LSPAny[]
-
----The LSP any type.
----Please note that strictly speaking a property with the value `undefined`
----can't be converted into JSON preserving the property name. However for
----convenience it is allowed and assumed that all these properties are
----optional as well.
----@since 3.17.0
----@alias lsp.LSPAny lsp.LSPObject|lsp.LSPArray|string|integer|uinteger|decimal|boolean|lsp.null
-
----The declaration of a symbol representation as one or many {@link Location locations}.
----@alias lsp.Declaration lsp.Location|lsp.Location[]
-
----Information about where a symbol is declared.
+---@since 3.16.0
+---@field resolveSupport? lsp.ClientCompletionItemResolveOptions
---
----Provides additional metadata over normal {@link Location location} declarations, including the range of
----the declaring symbol.
+---The client supports the `insertTextMode` property on
+---a completion item to override the whitespace handling mode
+---as defined by the client (see `insertTextMode`).
---
----Servers should prefer returning `DeclarationLink` over `Declaration` if supported
----by the client.
----@alias lsp.DeclarationLink lsp.LocationLink
-
----Inline value information can be provided by different means:
----- directly as a text value (class InlineValueText).
----- as a name to use for a variable lookup (class InlineValueVariableLookup)
----- as an evaluatable expression (class InlineValueEvaluatableExpression)
----The InlineValue types combines all inline value types into one type.
+---@since 3.16.0
+---@field insertTextModeSupport? lsp.ClientCompletionItemInsertTextModeOptions
---
----@since 3.17.0
----@alias lsp.InlineValue lsp.InlineValueText|lsp.InlineValueVariableLookup|lsp.InlineValueEvaluatableExpression
-
----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 client has support for completion item label
+---details (see also `CompletionItemLabelDetails`).
---
---@since 3.17.0
----@alias lsp.DocumentDiagnosticReport lsp.RelatedFullDocumentDiagnosticReport|lsp.RelatedUnchangedDocumentDiagnosticReport
-
----@alias lsp.PrepareRenameResult lsp.Range|lsp._anonym46.PrepareRenameResult|lsp._anonym47.PrepareRenameResult
+---@field labelDetailsSupport? boolean
----A document selector is the combination of one or many document filters.
+---@since 3.18.0
+---@class lsp.ClientCompletionItemOptionsKind
---
----\@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
+---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 use of a string as a document filter is deprecated @since 3.16.0.
----@alias lsp.DocumentSelector lsp.DocumentFilter[]
-
----@alias lsp.ProgressToken integer|string
-
----An identifier to refer to a change annotation stored with a workspace edit.
----@alias lsp.ChangeAnnotationIdentifier string
+---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.
+---@field valueSet? lsp.CompletionItemKind[]
----A workspace diagnostic document report.
+---The client supports the following `CompletionList` specific
+---capabilities.
---
---@since 3.17.0
----@alias lsp.WorkspaceDocumentDiagnosticReport lsp.WorkspaceFullDocumentDiagnosticReport|lsp.WorkspaceUnchangedDocumentDiagnosticReport
-
----An event describing a change to a text document. If only a text is provided
----it is considered to be the full content of the document.
----@alias lsp.TextDocumentContentChangeEvent lsp._anonym48.TextDocumentContentChangeEvent|lsp._anonym49.TextDocumentContentChangeEvent
-
----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
+---@class lsp.CompletionListCapabilities
---
----The pair of a language and a value is an equivalent to markdown:
----```${language}
----${value}
----```
+---The client supports the following itemDefaults on
+---a completion list.
---
----Note that markdown strings will be sanitized - that means html will be escaped.
----@deprecated use MarkupContent instead.
----@alias lsp.MarkedString string|lsp._anonym50.MarkedString
-
----A document filter describes a top level text document or
----a notebook cell document.
+---The value lists the supported property names of the
+---`CompletionList.itemDefaults` object. If omitted
+---no properties are supported.
---
----@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.
----@alias lsp.DocumentFilter lsp.TextDocumentFilter|lsp.NotebookCellTextDocumentFilter
-
----LSP object definition.
---@since 3.17.0
----@alias lsp.LSPObject table<string, lsp.LSPAny>
+---@field itemDefaults? string[]
----The glob pattern. Either a string pattern or a relative pattern.
+---@since 3.18.0
+---@class lsp.ClientSignatureInformationOptions
---
----@since 3.17.0
----@alias lsp.GlobPattern lsp.Pattern|lsp.RelativePattern
-
----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}.
+---Client supports the following content formats for the documentation
+---property. The order describes the preferred format of the client.
+---@field documentationFormat? lsp.MarkupKind[]
---
----Glob patterns can have the following syntax:
----- `*` to match one or more characters in a path segment
----- `?` to match on one character in a path segment
----- `**` to match any number of path segments, including none
----- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
----- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
----- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
+---Client capabilities specific to parameter information.
+---@field parameterInformation? lsp.ClientSignatureParameterInformationOptions
---
----\@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
----\@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
+---The client supports the `activeParameter` property on `SignatureInformation`
+---literal.
---
----@since 3.17.0
----@alias lsp.TextDocumentFilter lsp._anonym51.TextDocumentFilter|lsp._anonym52.TextDocumentFilter|lsp._anonym53.TextDocumentFilter
-
----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.16.0
+---@field activeParameterSupport? boolean
---
----@since 3.17.0
----@alias lsp.NotebookDocumentFilter lsp._anonym54.NotebookDocumentFilter|lsp._anonym55.NotebookDocumentFilter|lsp._anonym56.NotebookDocumentFilter
+---The client supports the `activeParameter` property on
+---`SignatureHelp`/`SignatureInformation` being set to `null` to
+---indicate that no parameter should be active.
+---
+---@since 3.18.0
+---@proposed
+---@field noActiveParameterSupport? boolean
----The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
----- `*` to match one or more characters in a path segment
----- `?` to match on one character in a path segment
----- `**` to match any number of path segments, including none
----- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
----- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
----- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
+---@since 3.18.0
+---@class lsp.ClientCodeActionLiteralOptions
---
----@since 3.17.0
----@alias lsp.Pattern string
+---The code action kind is support with the following value
+---set.
+---@field codeActionKind lsp.ClientCodeActionKindOptions
----@class lsp._anonym1.serverInfo
+---@since 3.18.0
+---@class lsp.ClientCodeActionResolveOptions
---
----The name of the server as defined by the server.
----@field name string
+---The properties that a client can resolve lazily.
+---@field properties string[]
+
+---@since 3.18.0
+---@class lsp.ClientCodeLensResolveOptions
---
----The server's version as defined by the server.
----@field version? string
+---The properties that a client can resolve lazily.
+---@field properties string[]
----@class lsp._anonym3.itemDefaults.editRange
----
----@field insert lsp.Range
+---@since 3.18.0
+---@class lsp.ClientFoldingRangeKindOptions
---
----@field replace lsp.Range
+---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.
+---@field valueSet? lsp.FoldingRangeKind[]
----@class lsp._anonym2.itemDefaults
+---@since 3.18.0
+---@class lsp.ClientFoldingRangeOptions
---
----A default commit character set.
+---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
----@field commitCharacters? string[]
----
----A default edit range.
+---@field collapsedText? boolean
+
+---General diagnostics capabilities for pull and push model.
+---@class lsp.DiagnosticsCapabilities
---
----@since 3.17.0
----@field editRange? lsp.Range|lsp._anonym3.itemDefaults.editRange
+---Whether the clients accepts diagnostics with related information.
+---@field relatedInformation? boolean
---
----A default insert text format.
+---Client supports the tag property to provide meta data about a diagnostic.
+---Clients supporting tags have to handle unknown tags gracefully.
---
----@since 3.17.0
----@field insertTextFormat? lsp.InsertTextFormat
+---@since 3.15.0
+---@field tagSupport? lsp.ClientDiagnosticsTagOptions
---
----A default insert text mode.
+---Client supports a codeDescription property
---
----@since 3.17.0
----@field insertTextMode? lsp.InsertTextMode
+---@since 3.16.0
+---@field codeDescriptionSupport? boolean
---
----A default data value.
+---Whether code action supports the `data` property which is
+---preserved between a `textDocument/publishDiagnostics` and
+---`textDocument/codeAction` request.
---
----@since 3.17.0
----@field data? lsp.LSPAny
+---@since 3.16.0
+---@field dataSupport? boolean
----@class lsp._anonym4.disabled
+---@since 3.18.0
+---@class lsp.ClientSemanticTokensRequestOptions
---
----Human readable description of why the code action is currently disabled.
+---The client will send the `textDocument/semanticTokens/range` request if
+---the server provides a corresponding handler.
+---@field range? boolean|lsp._anonym2.range
---
----This is displayed in the code actions UI.
----@field reason string
+---The client will send the `textDocument/semanticTokens/full` request if
+---the server provides a corresponding handler.
+---@field full? boolean|lsp.ClientSemanticTokensRequestFullDelta
----@class lsp._anonym5.location
+---@since 3.18.0
+---@class lsp.ClientInlayHintResolveOptions
---
----@field uri lsp.DocumentUri
-
----@class lsp._anonym6.range
+---The properties that a client can resolve lazily.
+---@field properties string[]
----@class lsp._anonym7.full
+---@since 3.18.0
+---@class lsp.ClientShowMessageActionItemOptions
---
----The server supports deltas for full documents.
----@field delta? boolean
+---Whether the client supports additional attributes which
+---are preserved and send back to the server in the
+---request's response.
+---@field additionalPropertiesSupport? boolean
----@class lsp._anonym9.cells.structure
----
----The change to the cell array.
----@field array lsp.NotebookCellArrayChange
----
----Additional opened cell text documents.
----@field didOpen? lsp.TextDocumentItem[]
+---@since 3.18.0
+---@class lsp.CompletionItemTagOptions
---
----Additional closed cell text documents.
----@field didClose? lsp.TextDocumentIdentifier[]
+---The tags supported by the client.
+---@field valueSet lsp.CompletionItemTag[]
----@class lsp._anonym10.cells.textContent
----
----@field document lsp.VersionedTextDocumentIdentifier
+---@since 3.18.0
+---@class lsp.ClientCompletionItemResolveOptions
---
----@field changes lsp.TextDocumentContentChangeEvent[]
+---The properties that a client can resolve lazily.
+---@field properties string[]
----@class lsp._anonym8.cells
----
----Changes to the cell structure to add or
----remove cells.
----@field structure? lsp._anonym9.cells.structure
----
----Changes to notebook cells properties like its
----kind, execution summary or metadata.
----@field data? lsp.NotebookCell[]
+---@since 3.18.0
+---@class lsp.ClientCompletionItemInsertTextModeOptions
---
----Changes to the text content of notebook cells.
----@field textContent? lsp._anonym10.cells.textContent[]
+---@field valueSet lsp.InsertTextMode[]
----@class lsp._anonym11.clientInfo
+---@since 3.18.0
+---@class lsp.ClientSignatureParameterInformationOptions
---
----The name of the client as defined by the client.
----@field name string
+---The client supports processing label offsets instead of a
+---simple label string.
---
----The client's version as defined by the client.
----@field version? string
+---@since 3.14.0
+---@field labelOffsetSupport? boolean
----@class lsp._anonym13.textDocument.diagnostic
+---@since 3.18.0
+---@class lsp.ClientCodeActionKindOptions
---
----Whether the server supports `MarkupContent` in diagnostic messages.
----@field markupMessageSupport? boolean
+---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.
+---@field valueSet lsp.CodeActionKind[]
----@class lsp._anonym12.textDocument
----
----Capabilities specific to the diagnostic pull model.
----
---@since 3.18.0
----@field diagnostic? lsp._anonym13.textDocument.diagnostic
-
----@class lsp._anonym14.workspace
----
----The server supports workspace folder.
----
----@since 3.6.0
----@field workspaceFolders? lsp.WorkspaceFoldersServerCapabilities
----
----The server is interested in notifications/requests for operations on files.
+---@class lsp.ClientDiagnosticsTagOptions
---
----@since 3.16.0
----@field fileOperations? lsp.FileOperationOptions
+---The tags supported by the client.
+---@field valueSet lsp.DiagnosticTag[]
----@class lsp._anonym15.completionItem
----
----The server has support for completion item label
----details (see also `CompletionItemLabelDetails`) when
----receiving a completion item in a resolve call.
+---@since 3.18.0
+---@class lsp.ClientSemanticTokensRequestFullDelta
---
----@since 3.17.0
----@field labelDetailsSupport? boolean
+---The client will send the `textDocument/semanticTokens/full/delta` request if
+---the server provides a corresponding handler.
+---@field delta? boolean
----@class lsp._anonym17.notebookSelector.cells
+---A set of predefined token types. This set is not fixed
+---an clients can specify additional token types via the
+---corresponding client capabilities.
---
----@field language string
+---@since 3.16.0
+---@alias lsp.SemanticTokenTypes
+---| "namespace" # namespace
+---| "type" # type
+---| "class" # class
+---| "enum" # enum
+---| "interface" # interface
+---| "struct" # struct
+---| "typeParameter" # typeParameter
+---| "parameter" # parameter
+---| "variable" # variable
+---| "property" # property
+---| "enumMember" # enumMember
+---| "event" # event
+---| "function" # function
+---| "method" # method
+---| "macro" # macro
+---| "keyword" # keyword
+---| "modifier" # modifier
+---| "comment" # comment
+---| "string" # string
+---| "number" # number
+---| "regexp" # regexp
+---| "operator" # operator
+---| "decorator" # decorator
+---| "label" # label
----@class lsp._anonym16.notebookSelector
----
----The notebook to be synced If a string
----value is provided it matches against the
----notebook type. '*' matches every notebook.
----@field notebook string|lsp.NotebookDocumentFilter
+---A set of predefined token modifiers. This set is not fixed
+---an clients can specify additional token types via the
+---corresponding client capabilities.
---
----The cells of the matching notebook to be synced.
----@field cells? lsp._anonym17.notebookSelector.cells[]
+---@since 3.16.0
+---@alias lsp.SemanticTokenModifiers
+---| "declaration" # declaration
+---| "definition" # definition
+---| "readonly" # readonly
+---| "static" # static
+---| "deprecated" # deprecated
+---| "abstract" # abstract
+---| "async" # async
+---| "modification" # modification
+---| "documentation" # documentation
+---| "defaultLibrary" # defaultLibrary
----@class lsp._anonym19.notebookSelector.cells
+---The document diagnostic report kinds.
---
----@field language string
+---@since 3.17.0
+---@alias lsp.DocumentDiagnosticReportKind
+---| "full" # Full
+---| "unchanged" # Unchanged
----@class lsp._anonym18.notebookSelector
----
----The notebook to be synced If a string
----value is provided it matches against the
----notebook type. '*' matches every notebook.
----@field notebook? string|lsp.NotebookDocumentFilter
----
----The cells of the matching notebook to be synced.
----@field cells lsp._anonym19.notebookSelector.cells[]
+---Predefined error codes.
+---@alias lsp.ErrorCodes
+---| -32700 # ParseError
+---| -32600 # InvalidRequest
+---| -32601 # MethodNotFound
+---| -32602 # InvalidParams
+---| -32603 # InternalError
+---| -32002 # ServerNotInitialized
+---| -32001 # UnknownErrorCode
----@class lsp._anonym20.staleRequestSupport
----
----The client will actively cancel the request.
----@field cancel boolean
----
----The list of requests for which the client
----will retry the request if it receives a
----response with error code `ContentModified`
----@field retryOnContentModified string[]
+---@alias lsp.LSPErrorCodes
+---| -32803 # RequestFailed
+---| -32802 # ServerCancelled
+---| -32801 # ContentModified
+---| -32800 # RequestCancelled
----@class lsp._anonym21.changeAnnotationSupport
----
----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.
----@field groupsOnLabel? boolean
+---A set of predefined range kinds.
+---@alias lsp.FoldingRangeKind
+---| "comment" # Comment
+---| "imports" # Imports
+---| "region" # Region
----@class lsp._anonym22.symbolKind
----
----The symbol kind values the client supports. When this
----property exists the client also guarantees that it will
----handle values outside its set gracefully and falls back
----to a default value when unknown.
----
----If this property is not present the client only supports
----the symbol kinds from `File` to `Array` as defined in
----the initial version of the protocol.
----@field valueSet? lsp.SymbolKind[]
+---A symbol kind.
+---@alias lsp.SymbolKind
+---| 1 # File
+---| 2 # Module
+---| 3 # Namespace
+---| 4 # Package
+---| 5 # Class
+---| 6 # Method
+---| 7 # Property
+---| 8 # Field
+---| 9 # Constructor
+---| 10 # Enum
+---| 11 # Interface
+---| 12 # Function
+---| 13 # Variable
+---| 14 # Constant
+---| 15 # String
+---| 16 # Number
+---| 17 # Boolean
+---| 18 # Array
+---| 19 # Object
+---| 20 # Key
+---| 21 # Null
+---| 22 # EnumMember
+---| 23 # Struct
+---| 24 # Event
+---| 25 # Operator
+---| 26 # TypeParameter
----@class lsp._anonym23.tagSupport
+---Symbol tags are extra annotations that tweak the rendering of a symbol.
---
----The tags supported by the client.
----@field valueSet lsp.SymbolTag[]
+---@since 3.16
+---@alias lsp.SymbolTag
+---| 1 # Deprecated
----@class lsp._anonym24.resolveSupport
+---Moniker uniqueness level to define scope of the moniker.
---
----The properties that a client can resolve lazily. Usually
----`location.range`
----@field properties string[]
+---@since 3.16.0
+---@alias lsp.UniquenessLevel
+---| "document" # document
+---| "project" # project
+---| "group" # group
+---| "scheme" # scheme
+---| "global" # global
----@class lsp._anonym26.completionItem.tagSupport
+---The moniker kind.
---
----The tags supported by the client.
----@field valueSet lsp.CompletionItemTag[]
+---@since 3.16.0
+---@alias lsp.MonikerKind
+---| "import" # import
+---| "export" # export
+---| "local" # local
----@class lsp._anonym27.completionItem.resolveSupport
+---Inlay hint kinds.
---
----The properties that a client can resolve lazily.
----@field properties string[]
+---@since 3.17.0
+---@alias lsp.InlayHintKind
+---| 1 # Type
+---| 2 # Parameter
----@class lsp._anonym28.completionItem.insertTextModeSupport
----
----@field valueSet lsp.InsertTextMode[]
+---The message type
+---@alias lsp.MessageType
+---| 1 # Error
+---| 2 # Warning
+---| 3 # Info
+---| 4 # Log
+---| 5 # Debug
----@class lsp._anonym25.completionItem
----
----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.
----@field snippetSupport? boolean
----
----Client supports commit characters on a completion item.
----@field commitCharactersSupport? boolean
----
----Client supports the following content formats for the documentation
----property. The order describes the preferred format of the client.
----@field documentationFormat? lsp.MarkupKind[]
----
----Client supports the deprecated property on a completion item.
----@field deprecatedSupport? boolean
----
----Client supports the preselect property on a completion item.
----@field preselectSupport? boolean
----
----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.
+---Defines how the host (editor) should sync
+---document changes to the language server.
+---@alias lsp.TextDocumentSyncKind
+---| 0 # None
+---| 1 # Full
+---| 2 # Incremental
+
+---Represents reasons why a text document is saved.
+---@alias lsp.TextDocumentSaveReason
+---| 1 # Manual
+---| 2 # AfterDelay
+---| 3 # FocusOut
+
+---The kind of a completion entry.
+---@alias lsp.CompletionItemKind
+---| 1 # Text
+---| 2 # Method
+---| 3 # Function
+---| 4 # Constructor
+---| 5 # Field
+---| 6 # Variable
+---| 7 # Class
+---| 8 # Interface
+---| 9 # Module
+---| 10 # Property
+---| 11 # Unit
+---| 12 # Value
+---| 13 # Enum
+---| 14 # Keyword
+---| 15 # Snippet
+---| 16 # Color
+---| 17 # File
+---| 18 # Reference
+---| 19 # Folder
+---| 20 # EnumMember
+---| 21 # Constant
+---| 22 # Struct
+---| 23 # Event
+---| 24 # Operator
+---| 25 # TypeParameter
+
+---Completion item tags are extra annotations that tweak the rendering of a completion
+---item.
---
---@since 3.15.0
----@field tagSupport? lsp._anonym26.completionItem.tagSupport
----
----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
----@field insertReplaceSupport? boolean
----
----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
----@field resolveSupport? lsp._anonym27.completionItem.resolveSupport
----
----The client supports the `insertTextMode` property on
----a completion item to override the whitespace handling mode
----as defined by the client (see `insertTextMode`).
+---@alias lsp.CompletionItemTag
+---| 1 # Deprecated
+
+---Defines whether the insert text in a completion item should be interpreted as
+---plain text or a snippet.
+---@alias lsp.InsertTextFormat
+---| 1 # PlainText
+---| 2 # Snippet
+
+---How whitespace and indentation is handled during completion
+---item insertion.
---
---@since 3.16.0
----@field insertTextModeSupport? lsp._anonym28.completionItem.insertTextModeSupport
----
----The client has support for completion item label
----details (see also `CompletionItemLabelDetails`).
----
----@since 3.17.0
----@field labelDetailsSupport? boolean
+---@alias lsp.InsertTextMode
+---| 1 # asIs
+---| 2 # adjustIndentation
----@class lsp._anonym29.completionItemKind
----
----The completion item kind values the client supports. When this
----property exists the client also guarantees that it will
----handle values outside its set gracefully and falls back
----to a default value when unknown.
----
----If this property is not present the client only supports
----the completion items kinds from `Text` to `Reference` as defined in
----the initial version of the protocol.
----@field valueSet? lsp.CompletionItemKind[]
+---A document highlight kind.
+---@alias lsp.DocumentHighlightKind
+---| 1 # Text
+---| 2 # Read
+---| 3 # Write
----@class lsp._anonym30.completionList
----
----The client supports the following itemDefaults on
----a completion list.
----
----The value lists the supported property names of the
----`CompletionList.itemDefaults` object. If omitted
----no properties are supported.
----
----@since 3.17.0
----@field itemDefaults? string[]
+---A set of predefined code action kinds
+---@alias lsp.CodeActionKind
+---| "" # Empty
+---| "quickfix" # QuickFix
+---| "refactor" # Refactor
+---| "refactor.extract" # RefactorExtract
+---| "refactor.inline" # RefactorInline
+---| "refactor.move" # RefactorMove
+---| "refactor.rewrite" # RefactorRewrite
+---| "source" # Source
+---| "source.organizeImports" # SourceOrganizeImports
+---| "source.fixAll" # SourceFixAll
+---| "notebook" # Notebook
----@class lsp._anonym32.signatureInformation.parameterInformation
----
----The client supports processing label offsets instead of a
----simple label string.
----
----@since 3.14.0
----@field labelOffsetSupport? boolean
+---@alias lsp.TraceValue
+---| "off" # Off
+---| "messages" # Messages
+---| "verbose" # Verbose
----@class lsp._anonym31.signatureInformation
----
----Client supports the following content formats for the documentation
----property. The order describes the preferred format of the client.
----@field documentationFormat? lsp.MarkupKind[]
----
----Client capabilities specific to parameter information.
----@field parameterInformation? lsp._anonym32.signatureInformation.parameterInformation
----
----The client supports the `activeParameter` property on `SignatureInformation`
----literal.
----
----@since 3.16.0
----@field activeParameterSupport? boolean
----
----The client supports the `activeParameter` property on
----`SignatureInformation` being set to `null` to indicate that no
----parameter should be active.
+---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.
+---@alias lsp.MarkupKind
+---| "plaintext" # PlainText
+---| "markdown" # Markdown
+
+---Predefined Language kinds
---@since 3.18.0
----@field noActiveParameterSupport? boolean
+---@proposed
+---@alias lsp.LanguageKind
+---| "abap" # ABAP
+---| "bat" # WindowsBat
+---| "bibtex" # BibTeX
+---| "clojure" # Clojure
+---| "coffeescript" # Coffeescript
+---| "c" # C
+---| "cpp" # CPP
+---| "csharp" # CSharp
+---| "css" # CSS
+---| "d" # D
+---| "pascal" # Delphi
+---| "diff" # Diff
+---| "dart" # Dart
+---| "dockerfile" # Dockerfile
+---| "elixir" # Elixir
+---| "erlang" # Erlang
+---| "fsharp" # FSharp
+---| "git-commit" # GitCommit
+---| "rebase" # GitRebase
+---| "go" # Go
+---| "groovy" # Groovy
+---| "handlebars" # Handlebars
+---| "haskell" # Haskell
+---| "html" # HTML
+---| "ini" # Ini
+---| "java" # Java
+---| "javascript" # JavaScript
+---| "javascriptreact" # JavaScriptReact
+---| "json" # JSON
+---| "latex" # LaTeX
+---| "less" # Less
+---| "lua" # Lua
+---| "makefile" # Makefile
+---| "markdown" # Markdown
+---| "objective-c" # ObjectiveC
+---| "objective-cpp" # ObjectiveCPP
+---| "pascal" # Pascal
+---| "perl" # Perl
+---| "perl6" # Perl6
+---| "php" # PHP
+---| "powershell" # Powershell
+---| "jade" # Pug
+---| "python" # Python
+---| "r" # R
+---| "razor" # Razor
+---| "ruby" # Ruby
+---| "rust" # Rust
+---| "scss" # SCSS
+---| "sass" # SASS
+---| "scala" # Scala
+---| "shaderlab" # ShaderLab
+---| "shellscript" # ShellScript
+---| "sql" # SQL
+---| "swift" # Swift
+---| "typescript" # TypeScript
+---| "typescriptreact" # TypeScriptReact
+---| "tex" # TeX
+---| "vb" # VisualBasic
+---| "xml" # XML
+---| "xsl" # XSL
+---| "yaml" # YAML
----@class lsp._anonym33.symbolKind
+---Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
---
----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.
+---@since 3.18.0
+---@proposed
+---@alias lsp.InlineCompletionTriggerKind
+---| 1 # Invoked
+---| 2 # Automatic
+
+---A set of predefined position encoding kinds.
---
----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.
----@field valueSet? lsp.SymbolKind[]
+---@since 3.17.0
+---@alias lsp.PositionEncodingKind
+---| "utf-8" # UTF8
+---| "utf-16" # UTF16
+---| "utf-32" # UTF32
+
+---The file event type
+---@alias lsp.FileChangeType
+---| 1 # Created
+---| 2 # Changed
+---| 3 # Deleted
+
+---@alias lsp.WatchKind
+---| 1 # Create
+---| 2 # Change
+---| 4 # Delete
+
+---The diagnostic's severity.
+---@alias lsp.DiagnosticSeverity
+---| 1 # Error
+---| 2 # Warning
+---| 3 # Information
+---| 4 # Hint
----@class lsp._anonym34.tagSupport
+---The diagnostic tags.
---
----The tags supported by the client.
----@field valueSet lsp.SymbolTag[]
+---@since 3.15.0
+---@alias lsp.DiagnosticTag
+---| 1 # Unnecessary
+---| 2 # Deprecated
----@class lsp._anonym36.codeActionLiteralSupport.codeActionKind
----
----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.
----@field valueSet lsp.CodeActionKind[]
+---How a completion was triggered
+---@alias lsp.CompletionTriggerKind
+---| 1 # Invoked
+---| 2 # TriggerCharacter
+---| 3 # TriggerForIncompleteCompletions
----@class lsp._anonym35.codeActionLiteralSupport
+---How a signature help was triggered.
---
----The code action kind is support with the following value
----set.
----@field codeActionKind lsp._anonym36.codeActionLiteralSupport.codeActionKind
+---@since 3.15.0
+---@alias lsp.SignatureHelpTriggerKind
+---| 1 # Invoked
+---| 2 # TriggerCharacter
+---| 3 # ContentChange
----@class lsp._anonym37.resolveSupport
+---The reason why code actions were requested.
---
----The properties that a client can resolve lazily.
----@field properties string[]
+---@since 3.17.0
+---@alias lsp.CodeActionTriggerKind
+---| 1 # Invoked
+---| 2 # Automatic
----@class lsp._anonym38.foldingRangeKind
+---A pattern kind describing if a glob pattern matches a file a folder or
+---both.
---
----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.
----@field valueSet? lsp.FoldingRangeKind[]
+---@since 3.16.0
+---@alias lsp.FileOperationPatternKind
+---| "file" # file
+---| "folder" # folder
----@class lsp._anonym39.foldingRange
----
----If set, the client signals that it supports setting collapsedText on
----folding ranges to display custom labels instead of the default text.
+---A notebook cell kind.
---
---@since 3.17.0
----@field collapsedText? boolean
+---@alias lsp.NotebookCellKind
+---| 1 # Markup
+---| 2 # Code
----@class lsp._anonym40.tagSupport
----
----The tags supported by the client.
----@field valueSet lsp.DiagnosticTag[]
+---@alias lsp.ResourceOperationKind
+---| "create" # Create
+---| "rename" # Rename
+---| "delete" # Delete
----@class lsp._anonym42.requests.range
+---@alias lsp.FailureHandlingKind
+---| "abort" # Abort
+---| "transactional" # Transactional
+---| "textOnlyTransactional" # TextOnlyTransactional
+---| "undo" # Undo
----@class lsp._anonym43.requests.full
----
----The client will send the `textDocument/semanticTokens/full/delta` request if
----the server provides a corresponding handler.
----@field delta? boolean
+---@alias lsp.PrepareSupportDefaultBehavior
+---| 1 # Identifier
----@class lsp._anonym41.requests
----
----The client will send the `textDocument/semanticTokens/range` request if
----the server provides a corresponding handler.
----@field range? boolean|lsp._anonym42.requests.range
----
----The client will send the `textDocument/semanticTokens/full` request if
----the server provides a corresponding handler.
----@field full? boolean|lsp._anonym43.requests.full
+---@alias lsp.TokenFormat
+---| "relative" # Relative
----@class lsp._anonym44.resolveSupport
+---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 properties that a client can resolve lazily.
----@field properties string[]
+---Servers should prefer returning `DefinitionLink` over `Definition` if supported
+---by the client.
+---@alias lsp.Definition lsp.Location|lsp.Location[]
----@class lsp._anonym45.messageActionItem
+---Information about where a symbol is defined.
---
----Whether the client supports additional attributes which
----are preserved and send back to the server in the
----request's response.
----@field additionalPropertiesSupport? boolean
+---Provides additional metadata over normal {@link Location location} definitions, including the range of
+---the defining symbol
+---@alias lsp.DefinitionLink lsp.LocationLink
----@class lsp._anonym46.PrepareRenameResult
----
----@field range lsp.Range
----
----@field placeholder string
+---LSP arrays.
+---@since 3.17.0
+---@alias lsp.LSPArray lsp.LSPAny[]
----@class lsp._anonym47.PrepareRenameResult
----
----@field defaultBehavior boolean
+---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
+---@alias lsp.LSPAny lsp.LSPObject|lsp.LSPArray|string|integer|uinteger|decimal|boolean|lsp.null
----@class lsp._anonym48.TextDocumentContentChangeEvent
----
----The range of the document that changed.
----@field range lsp.Range
----
----The optional length of the range that got replaced.
+---The declaration of a symbol representation as one or many {@link Location locations}.
+---@alias lsp.Declaration lsp.Location|lsp.Location[]
+
+---Information about where a symbol is declared.
---
----@deprecated use range instead.
----@field rangeLength? uinteger
+---Provides additional metadata over normal {@link Location location} declarations, including the range of
+---the declaring symbol.
---
----The new text for the provided range.
----@field text string
+---Servers should prefer returning `DeclarationLink` over `Declaration` if supported
+---by the client.
+---@alias lsp.DeclarationLink lsp.LocationLink
----@class lsp._anonym49.TextDocumentContentChangeEvent
+---Inline value information can be provided by different means:
+---- directly as a text value (class InlineValueText).
+---- as a name to use for a variable lookup (class InlineValueVariableLookup)
+---- as an evaluatable expression (class InlineValueEvaluatableExpression)
+---The InlineValue types combines all inline value types into one type.
---
----The new text of the whole document.
----@field text string
+---@since 3.17.0
+---@alias lsp.InlineValue lsp.InlineValueText|lsp.InlineValueVariableLookup|lsp.InlineValueEvaluatableExpression
----@class lsp._anonym50.MarkedString
----
----@field language string
+---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.
---
----@field value string
+---@since 3.17.0
+---@alias lsp.DocumentDiagnosticReport lsp.RelatedFullDocumentDiagnosticReport|lsp.RelatedUnchangedDocumentDiagnosticReport
----@class lsp._anonym51.TextDocumentFilter
----
----A language id, like `typescript`.
----@field language string
----
----A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme? string
----
----A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
----@field pattern? string
+---@alias lsp.PrepareRenameResult lsp.Range|lsp.PrepareRenamePlaceholder|lsp.PrepareRenameDefaultBehavior
----@class lsp._anonym52.TextDocumentFilter
----
----A language id, like `typescript`.
----@field language? string
+---A document selector is the combination of one or many document filters.
---
----A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme string
+---\@sample `let sel:DocumentSelector = [{ language: 'typescript' }, { language: 'json', pattern: '**∕tsconfig.json' }]`;
---
----A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
----@field pattern? string
+---The use of a string as a document filter is deprecated @since 3.16.0.
+---@alias lsp.DocumentSelector lsp.DocumentFilter[]
+
+---@alias lsp.ProgressToken integer|string
----@class lsp._anonym53.TextDocumentFilter
+---An identifier to refer to a change annotation stored with a workspace edit.
+---@alias lsp.ChangeAnnotationIdentifier string
+
+---A workspace diagnostic document report.
---
----A language id, like `typescript`.
----@field language? string
+---@since 3.17.0
+---@alias lsp.WorkspaceDocumentDiagnosticReport lsp.WorkspaceFullDocumentDiagnosticReport|lsp.WorkspaceUnchangedDocumentDiagnosticReport
+
+---An event describing a change to a text document. If only a text is provided
+---it is considered to be the full content of the document.
+---@alias lsp.TextDocumentContentChangeEvent lsp.TextDocumentContentChangePartial|lsp.TextDocumentContentChangeWholeDocument
+
+---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
---
----A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme? string
+---The pair of a language and a value is an equivalent to markdown:
+---```${language}
+---${value}
+---```
---
----A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
----@field pattern string
+---Note that markdown strings will be sanitized - that means html will be escaped.
+---@deprecated use MarkupContent instead.
+---@alias lsp.MarkedString string|lsp.MarkedStringWithLanguage
----@class lsp._anonym54.NotebookDocumentFilter
----
----The type of the enclosing notebook.
----@field notebookType string
+---A document filter describes a top level text document or
+---a notebook cell document.
---
----A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme? string
+---@since 3.17.0 - proposed support for NotebookCellTextDocumentFilter.
+---@alias lsp.DocumentFilter lsp.TextDocumentFilter|lsp.NotebookCellTextDocumentFilter
+
+---LSP object definition.
+---@since 3.17.0
+---@alias lsp.LSPObject table<string, lsp.LSPAny>
+
+---The glob pattern. Either a string pattern or a relative pattern.
---
----A glob pattern.
----@field pattern? string
+---@since 3.17.0
+---@alias lsp.GlobPattern lsp.Pattern|lsp.RelativePattern
----@class lsp._anonym55.NotebookDocumentFilter
+---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}.
---
----The type of the enclosing notebook.
----@field notebookType? string
+---Glob patterns can have the following syntax:
+---- `*` to match one or more characters in a path segment
+---- `?` to match on one character in a path segment
+---- `**` to match any number of path segments, including none
+---- `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
+---- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
+---- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
---
----A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme string
+---\@sample A language filter that applies to typescript files on disk: `{ language: 'typescript', scheme: 'file' }`
+---\@sample A language filter that applies to all package.json paths: `{ language: 'json', pattern: '**package.json' }`
---
----A glob pattern.
----@field pattern? string
+---@since 3.17.0
+---@alias lsp.TextDocumentFilter lsp.TextDocumentFilterLanguage|lsp.TextDocumentFilterScheme|lsp.TextDocumentFilterPattern
----@class lsp._anonym56.NotebookDocumentFilter
----
----The type of the enclosing notebook.
----@field notebookType? string
+---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 Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
----@field scheme? string
+---@since 3.17.0
+---@alias lsp.NotebookDocumentFilter lsp.NotebookDocumentFilterNotebookType|lsp.NotebookDocumentFilterScheme|lsp.NotebookDocumentFilterPattern
+
+---The glob pattern to watch relative to the base path. Glob patterns can have the following syntax:
+---- `*` to match one or more characters in a path segment
+---- `?` to match on one character in a path segment
+---- `**` to match any number of path segments, including none
+---- `{}` to group conditions (e.g. `**/*.{ts,js}` matches all TypeScript and JavaScript files)
+---- `[]` to declare a range of characters to match in a path segment (e.g., `example.[0-9]` to match on `example.0`, `example.1`, …)
+---- `[!...]` to negate a range of characters to match in a path segment (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but not `example.0`)
---
----A glob pattern.
----@field pattern string
+---@since 3.17.0
+---@alias lsp.Pattern string
+
+---@alias lsp.RegularExpressionEngineKind string
+
+---@class lsp._anonym1.range
+
+---@class lsp._anonym2.range
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
@@ -615,9 +615,10 @@ function protocol.resolve_capabilities(server_capabilities)
end
-- Generated by gen_lsp.lua, keep at end of file.
---- LSP method names.
---
+---@enum vim.lsp.protocol.Methods
---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel
+--- LSP method names.
protocol.Methods = {
--- A request to resolve the incoming calls for a given `CallHierarchyItem`.
--- @since 3.16.0
@@ -880,14 +881,14 @@ protocol.Methods = {
--- symbol's location.
--- @since 3.17.0
workspaceSymbol_resolve = 'workspaceSymbol/resolve',
- --- A request sent from the server to the client to modify certain resources.
+ --- A request sent from the server to the client to modified certain resources.
workspace_applyEdit = 'workspace/applyEdit',
--- A request to refresh all code actions
--- @since 3.16.0
workspace_codeLens_refresh = 'workspace/codeLens/refresh',
--- 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 where the client signaled configuration change via an
+ --- 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.
@@ -920,7 +921,7 @@ protocol.Methods = {
--- files were renamed from within the client.
--- @since 3.16.0
workspace_didRenameFiles = 'workspace/didRenameFiles',
- --- A request sent from the client to the server to execute a command. The request might return
+ --- 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.
workspace_executeCommand = 'workspace/executeCommand',
--- @since 3.18.0
diff --git a/scripts/gen_lsp.lua b/scripts/gen_lsp.lua
@@ -60,9 +60,10 @@ end
local function gen_methods(protocol)
local output = {
'-- Generated by gen_lsp.lua, keep at end of file.',
- '--- LSP method names.',
'---',
+ '---@enum vim.lsp.protocol.Methods',
'---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel',
+ '--- LSP method names.',
'protocol.Methods = {',
}
local indent = (' '):rep(2)