docs(gen_lsp.lua): re-generate vim.lsp._meta.protocol type annotations

The purpose of this commit is to make diff clean and easy to read; to
see the diff resulted from actual changes in gen_lsp.lua, not from the
updated LSP protocol JSON data.

Ran: `nvim -l scripts/gen_lsp.lua gen --methods`

Based on 3.18.0 (2023-12-23)
This commit is contained in:
Jongwook Choi 2023-12-11 00:05:24 -05:00 committed by Mathias Fußenegger
parent 382ea4d402
commit 3767468b96
3 changed files with 123 additions and 50 deletions

View File

@ -2181,7 +2181,7 @@ Methods *vim.lsp.protocol.Methods*
LSP method names.
See also: ~
• https://microsoft.github.io/language-server-protocol/specifications/specification-current/#metaModel
• https://microsoft.github.io/language-server-protocol/specification/#metaModel
*vim.lsp.protocol.resolve_capabilities()*
resolve_capabilities({server_capabilities})

View File

@ -472,6 +472,9 @@ error('Cannot require a meta file')
---@since 3.17.0
---@class lsp.InlayHint
---The position of this hint.
---
---If multiple hints have the same position, they will be shown in the order
---they appear in the response.
---@field position lsp.Position
---The label of this hint. A human readable string or an array of
---InlayHintLabelPart label parts.
@ -614,12 +617,16 @@ error('Cannot require a meta file')
---A parameter literal used in inline completion requests.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionParams: lsp.TextDocumentPositionParams, lsp.WorkDoneProgressParams
---Additional information about the context in which inline completions were
---requested.
---@field context lsp.InlineCompletionContext
---Represents a collection of {@link InlineCompletionItem inline completion items} to be presented in the editor.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionList
---The inline completion items
---@field items lsp.InlineCompletionItem[]
@ -627,11 +634,10 @@ error('Cannot require a meta file')
---An inline completion item represents a text snippet that is proposed inline to complete text that is being typed.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionItem
---The text to replace the range with. Must be set.
---@field insertText string
---The format of the insert text. The format applies to the `insertText`. If omitted defaults to `InsertTextFormat.PlainText`.
---@field insertTextFormat? lsp.InsertTextFormat
---@field insertText string|lsp.StringValue
---A text that is used to decide if this inline completion should be shown. When `falsy` the {@link InlineCompletionItem.insertText} is used.
---@field filterText? string
---The range to replace. Must begin and end on the same line.
@ -642,6 +648,7 @@ error('Cannot require a meta file')
---Inline completion options used during static or dynamic registration.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionRegistrationOptions: lsp.InlineCompletionOptions, lsp.StaticRegistrationOptions
---@class lsp.RegistrationParams
@ -981,14 +988,23 @@ error('Cannot require a meta file')
---In future version of the protocol this property might become
---mandatory to better express this.
---@field activeSignature? uinteger
---The active parameter of the active signature. If omitted or the value
---lies outside the range of `signatures[activeSignature].parameters`
---defaults to 0 if the active signature has parameters. If
---the active signature has no parameters it is ignored.
---The active parameter of the active signature.
---
---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
---`textDocument.signatureHelp.noActiveParameterSupport === true`
---
---If omitted or the value lies outside the range of
---`signatures[activeSignature].parameters` defaults to 0 if the active
---signature has parameters.
---
---If the active signature has no parameters it is ignored.
---
---In future version of the protocol this property might become
---mandatory to better express the active parameter if the
---active signature does have any.
---@field activeParameter? uinteger
---mandatory (but still nullable) to better express the active parameter if
---the active signature does have any.
---@field activeParameter? uinteger|lsp.null
---Registration options for a {@link SignatureHelpRequest}.
---@class lsp.SignatureHelpRegistrationOptions: lsp.TextDocumentRegistrationOptions
@ -1192,8 +1208,7 @@ error('Cannot require a meta file')
---The command this code lens represents.
---@field command? lsp.Command
---A data entry field that is preserved on a code lens item between
---a {@link CodeLensRequest} and a [CodeLensResolveRequest]
---(#CodeLensResolveRequest)
---a {@link CodeLensRequest} and a {@link CodeLensResolveRequest}
---@field data? lsp.LSPAny
---Registration options for a {@link CodeLensRequest}.
@ -1470,7 +1485,7 @@ error('Cannot require a meta file')
---@class lsp.ConfigurationItem
---The scope to get the configuration section for.
---@field scopeUri? string
---@field scopeUri? lsp.URI
---The configuration section asked for.
---@field section? string
@ -1503,14 +1518,14 @@ error('Cannot require a meta file')
---offset of b is 3 since `𐐀` is represented using two code units in UTF-16.
---Since 3.17 clients and servers can agree on a different string encoding
---representation (e.g. UTF-8). The client announces it's supported encoding
---via the client capability [`general.positionEncodings`](#clientCapabilities).
---via the client capability [`general.positionEncodings`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#clientCapabilities).
---The value is an array of position encodings the client supports, with
---decreasing preference (e.g. the encoding at index `0` is the most preferred
---one). To stay backwards compatible the only mandatory encoding is UTF-16
---represented via the string `utf-16`. The server can pick one of the
---encodings offered by the client and signals that encoding back to the
---client via the initialize result's property
---[`capabilities.positionEncoding`](#serverCapabilities). If the string value
---[`capabilities.positionEncoding`](https://microsoft.github.io/language-server-protocol/specifications/specification-current/#serverCapabilities). If the string value
---`utf-16` is missing from the client's capability `general.positionEncodings`
---servers can safely assume that the client supports UTF-16. If the server
---omits the position encoding in its initialize result the encoding defaults
@ -1915,18 +1930,36 @@ error('Cannot require a meta file')
---Provides information about the context in which an inline completion was requested.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionContext
---Describes how the inline completion was triggered.
---@field triggerKind lsp.InlineCompletionTriggerKind
---Provides information about the currently selected item in the autocomplete widget if it is visible.
---@field selectedCompletionInfo? lsp.SelectedCompletionInfo
---A string value used as a snippet is a template which allows to insert text
---and to control the editor cursor when insertion happens.
---
---A snippet can define tab stops and placeholders with `$1`, `$2`
---and `${3:foo}`. `$0` defines the final tab stop, it defaults to
---the end of the snippet. Variables are defined with `$name` and
---`${name:default value}`.
---
---@since 3.18.0
---@proposed
---@class lsp.StringValue
---The kind of string value.
---@field kind "snippet"
---The snippet string.
---@field value string
---Inline completion options used during static registration.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionOptions
---General parameters to to register for an notification or to register a provider.
---General parameters to register for a notification or to register a provider.
---@class lsp.Registration
---The id used to register the request. The id can be used to deregister
---the request again.
@ -2097,6 +2130,7 @@ error('Cannot require a meta file')
---Inline completion options used during static registration.
---
---@since 3.18.0
---@proposed
---@field inlineCompletionProvider? boolean|lsp.InlineCompletionOptions
---Workspace specific server capabilities.
---@field workspace? anonym12
@ -2261,10 +2295,16 @@ error('Cannot require a meta file')
---@field parameters? lsp.ParameterInformation[]
---The index of the active parameter.
---
---If provided, this is used in place of `SignatureHelp.activeParameter`.
---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
---`textDocument.signatureHelp.noActiveParameterSupport === true`
---
---If provided (or `null`), this is used in place of
---`SignatureHelp.activeParameter`.
---
---@since 3.16.0
---@field activeParameter? uinteger
---@field activeParameter? uinteger|lsp.null
---Server Capabilities for a {@link SignatureHelpRequest}.
---@class lsp.SignatureHelpOptions
@ -2545,6 +2585,7 @@ error('Cannot require a meta file')
---Describes the currently selected completion item.
---
---@since 3.18.0
---@proposed
---@class lsp.SelectedCompletionInfo
---The range that will be replaced if this completion item is accepted.
---@field range lsp.Range
@ -2758,6 +2799,11 @@ error('Cannot require a meta file')
---
---@since 3.17.0.
---@field diagnostics? lsp.DiagnosticWorkspaceClientCapabilities
---Capabilities specific to the folding range requests scoped to the workspace.
---
---@since 3.18.0
---@proposed
---@field foldingRange? lsp.FoldingRangeWorkspaceClientCapabilities
---Text document specific client capabilities.
---@class lsp.TextDocumentClientCapabilities
@ -2853,6 +2899,7 @@ error('Cannot require a meta file')
---Client capabilities specific to inline completions.
---
---@since 3.18.0
---@proposed
---@field inlineCompletion? lsp.InlineCompletionClientCapabilities
---Capabilities specific to the notebook document support.
@ -3083,6 +3130,23 @@ error('Cannot require a meta file')
---change that requires such a calculation.
---@field refreshSupport? boolean
---Client workspace capabilities specific to folding ranges
---
---@since 3.18.0
---@proposed
---@class lsp.FoldingRangeWorkspaceClientCapabilities
---Whether the client implementation supports a refresh request sent from the
---server to the client.
---
---Note that this event is global and will force the client to refresh all
---folding ranges currently shown. It should be used with absolute care and is
---useful for situation where a server for example detects a project wide
---change that requires such a calculation.
---
---@since 3.18.0
---@proposed
---@field refreshSupport? boolean
---@class lsp.TextDocumentSyncClientCapabilities
---Whether text document synchronization supports dynamic registration.
---@field dynamicRegistration? boolean
@ -3474,6 +3538,7 @@ error('Cannot require a meta file')
---Client capabilities specific to inline completions.
---
---@since 3.18.0
---@proposed
---@class lsp.InlineCompletionClientCapabilities
---Whether implementation supports dynamic registration for inline completion providers.
---@field dynamicRegistration? boolean
@ -3662,18 +3727,13 @@ error('Cannot require a meta file')
---| 1 # Type
---| 2 # Parameter
---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
---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.
@ -3723,6 +3783,12 @@ error('Cannot require a meta file')
---@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.
---
@ -3766,6 +3832,7 @@ error('Cannot require a meta file')
---Describes how an {@link InlineCompletionItemProvider inline completion provider} was triggered.
---
---@since 3.18.0
---@proposed
---@alias lsp.InlineCompletionTriggerKind
---| 0 # Invoked
---| 1 # Automatic
@ -4247,6 +4314,12 @@ error('Cannot require a meta file')
---
---@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.
---
---@since 3.18.0
---@field noActiveParameterSupport? boolean
---@class anonym31
---The symbol kind values the client supports. When this
@ -4352,7 +4425,7 @@ error('Cannot require a meta file')
---@field language string
---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
---@field scheme? string
---A glob pattern, like `*.{ts,js}`.
---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
---@field pattern? string
---@class anonym50
@ -4360,7 +4433,7 @@ error('Cannot require a meta file')
---@field language? string
---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
---@field scheme string
---A glob pattern, like `*.{ts,js}`.
---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
---@field pattern? string
---@class anonym51
@ -4368,7 +4441,7 @@ error('Cannot require a meta file')
---@field language? string
---A Uri {@link Uri.scheme scheme}, like `file` or `untitled`.
---@field scheme? string
---A glob pattern, like `*.{ts,js}`.
---A glob pattern, like **/*.{ts,js}. See TextDocumentFilter for examples.
---@field pattern string
---@class anonym52

View File

@ -934,7 +934,7 @@ end
-- Generated by gen_lsp.lua, keep at end of file.
--- LSP method names.
---
---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#metaModel
---@see https://microsoft.github.io/language-server-protocol/specification/#metaModel
protocol.Methods = {
--- A request to resolve the incoming calls for a given `CallHierarchyItem`.
--- @since 3.16.0
@ -1021,16 +1021,14 @@ protocol.Methods = {
--- `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
textDocument_completion = 'textDocument/completion',
--- A request to resolve the type definition locations of a symbol at a given text
--- document position. The request's parameter is of type [TextDocumentPositionParams]
--- (#TextDocumentPositionParams) the response is of type {@link Declaration}
--- or a typed array of {@link DeclarationLink} or a Thenable that resolves
--- to such.
--- document position. The request's parameter is of type {@link TextDocumentPositionParams}
--- the response is of type {@link Declaration} or a typed array of {@link DeclarationLink}
--- or a Thenable that resolves to such.
textDocument_declaration = 'textDocument/declaration',
--- A request to resolve the definition location of a symbol at a given text
--- document position. The request's parameter is of type [TextDocumentPosition]
--- (#TextDocumentPosition) the response is of either type {@link Definition}
--- or a typed array of {@link DefinitionLink} or a Thenable that resolves
--- to such.
--- document position. The request's parameter is of type {@link TextDocumentPosition}
--- the response is of either type {@link Definition} or a typed array of
--- {@link DefinitionLink} or a Thenable that resolves to such.
textDocument_definition = 'textDocument/definition',
--- The document diagnostic request definition.
--- @since 3.17.0
@ -1064,9 +1062,9 @@ protocol.Methods = {
--- that resolves to such.
textDocument_documentColor = 'textDocument/documentColor',
--- Request to resolve a {@link DocumentHighlight} for a given
--- text document position. The request's parameter is of type [TextDocumentPosition]
--- (#TextDocumentPosition) the request response is of type [DocumentHighlight[]]
--- (#DocumentHighlight) or a Thenable that resolves to such.
--- text document position. The request's parameter is of type {@link TextDocumentPosition}
--- the request response is an array of type {@link DocumentHighlight}
--- or a Thenable that resolves to such.
textDocument_documentHighlight = 'textDocument/documentHighlight',
--- A request to provide document links
textDocument_documentLink = 'textDocument/documentLink',
@ -1080,16 +1078,15 @@ protocol.Methods = {
--- response is of type {@link FoldingRangeList} or a Thenable
--- that resolves to such.
textDocument_foldingRange = 'textDocument/foldingRange',
--- A request to to format a whole document.
--- A request to format a whole document.
textDocument_formatting = 'textDocument/formatting',
--- Request to request hover information at a given text document position. The request's
--- parameter is of type {@link TextDocumentPosition} the response is of
--- type {@link Hover} or a Thenable that resolves to such.
textDocument_hover = 'textDocument/hover',
--- A request to resolve the implementation locations of a symbol at a given text
--- document position. The request's parameter is of type [TextDocumentPositionParams]
--- (#TextDocumentPositionParams) the response is of type {@link Definition} or a
--- Thenable that resolves to such.
--- document position. The request's parameter is of type {@link TextDocumentPositionParams}
--- the response is of type {@link Definition} or a Thenable that resolves to such.
textDocument_implementation = 'textDocument/implementation',
--- A request to provide inlay hints in a document. The request's parameter is of
--- type {@link InlayHintsParams}, the response is of type
@ -1100,6 +1097,7 @@ protocol.Methods = {
--- type {@link InlineCompletionParams}, the response is of type
--- {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
--- @since 3.18.0
--- @proposed
textDocument_inlineCompletion = 'textDocument/inlineCompletion',
--- A request to provide inline values in a document. The request's parameter is of
--- type {@link InlineValueParams}, the response is of type
@ -1155,9 +1153,8 @@ protocol.Methods = {
textDocument_semanticTokens_range = 'textDocument/semanticTokens/range',
textDocument_signatureHelp = 'textDocument/signatureHelp',
--- A request to resolve the type definition locations of a symbol at a given text
--- document position. The request's parameter is of type [TextDocumentPositionParams]
--- (#TextDocumentPositionParams) the response is of type {@link Definition} or a
--- Thenable that resolves to such.
--- document position. The request's parameter is of type {@link TextDocumentPositionParams}
--- the response is of type {@link Definition} or a Thenable that resolves to such.
textDocument_typeDefinition = 'textDocument/typeDefinition',
--- A document will save notification is sent from the client to the server before
--- the document is actually saved.
@ -1200,14 +1197,14 @@ protocol.Methods = {
--- symbol's location.
--- @since 3.17.0
workspaceSymbol_resolve = 'workspaceSymbol/resolve',
--- A request sent from the server to the client to modified certain resources.
--- A request sent from the server to the client to modify 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 were the client signaled configuration change via an
--- This pull model replaces the old push model where 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.
@ -1240,9 +1237,12 @@ protocol.Methods = {
--- files were renamed from within the client.
--- @since 3.16.0
workspace_didRenameFiles = 'workspace/didRenameFiles',
--- A request send from the client to the server to execute a command. The request might return
--- A request sent 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
--- @proposed
workspace_foldingRange_refresh = 'workspace/foldingRange/refresh',
--- @since 3.17.0
workspace_inlayHint_refresh = 'workspace/inlayHint/refresh',
--- @since 3.17.0