aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-30 20:35:25 +0000
commit1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch)
treecd08258054db80bb9a11b1061bb091c70b76926a /runtime/lua/vim/lsp/protocol.lua
parenteaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.gz
rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.tar.bz2
rneovim-1b7b916b7631ddf73c38e3a0070d64e4636cb2f3.zip
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua594
1 files changed, 405 insertions, 189 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 12345b6c8c..a7c3914834 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -20,15 +20,8 @@ function transform_schema_to_table()
end
--]=]
----@class lsp.ShowMessageRequestParams
----@field type lsp.MessageType
----@field message string
----@field actions nil|lsp.MessageActionItem[]
-
----@class lsp.MessageActionItem
----@field title string
-
local constants = {
+ --- @enum lsp.DiagnosticSeverity
DiagnosticSeverity = {
-- Reports an error.
Error = 1,
@@ -40,6 +33,7 @@ local constants = {
Hint = 4,
},
+ --- @enum lsp.DiagnosticTag
DiagnosticTag = {
-- Unused or unnecessary code
Unnecessary = 1,
@@ -60,6 +54,7 @@ local constants = {
},
-- The file event type.
+ ---@enum lsp.FileChangeType
FileChangeType = {
-- The file got created.
Created = 1,
@@ -247,6 +242,7 @@ local constants = {
-- Defines whether the insert text in a completion item should be interpreted as
-- plain text or a snippet.
+ --- @enum lsp.InsertTextFormat
InsertTextFormat = {
-- The primary text to be inserted is treated as a plain string.
PlainText = 1,
@@ -637,9 +633,29 @@ export interface WorkspaceClientCapabilities {
--- Gets a new ClientCapabilities object describing the LSP client
--- capabilities.
+--- @return lsp.ClientCapabilities
function protocol.make_client_capabilities()
return {
+ general = {
+ positionEncodings = {
+ 'utf-16',
+ },
+ },
textDocument = {
+ diagnostic = {
+ dynamicRegistration = false,
+ },
+ inlayHint = {
+ dynamicRegistration = true,
+ resolveSupport = {
+ properties = {
+ 'textEdits',
+ 'tooltip',
+ 'location',
+ 'command',
+ },
+ },
+ },
semanticTokens = {
dynamicRegistration = false,
tokenTypes = {
@@ -702,7 +718,7 @@ function protocol.make_client_capabilities()
didSave = true,
},
codeAction = {
- dynamicRegistration = false,
+ dynamicRegistration = true,
codeActionLiteralSupport = {
codeActionKind = {
@@ -719,6 +735,12 @@ function protocol.make_client_capabilities()
properties = { 'edit' },
},
},
+ formatting = {
+ dynamicRegistration = true,
+ },
+ rangeFormatting = {
+ dynamicRegistration = true,
+ },
completion = {
dynamicRegistration = false,
completionItem = {
@@ -726,7 +748,6 @@ function protocol.make_client_capabilities()
-- this should be disabled out of the box.
-- However, users can turn this back on if they have a snippet plugin.
snippetSupport = false,
-
commitCharactersSupport = false,
preselectSupport = false,
deprecatedSupport = false,
@@ -752,6 +773,7 @@ function protocol.make_client_capabilities()
},
definition = {
linkSupport = true,
+ dynamicRegistration = true,
},
implementation = {
linkSupport = true,
@@ -760,7 +782,7 @@ function protocol.make_client_capabilities()
linkSupport = true,
},
hover = {
- dynamicRegistration = false,
+ dynamicRegistration = true,
contentFormat = { protocol.MarkupKind.Markdown, protocol.MarkupKind.PlainText },
},
signatureHelp = {
@@ -795,7 +817,7 @@ function protocol.make_client_capabilities()
hierarchicalDocumentSymbolSupport = true,
},
rename = {
- dynamicRegistration = false,
+ dynamicRegistration = true,
prepareSupport = true,
},
publishDiagnostics = {
@@ -811,6 +833,7 @@ function protocol.make_client_capabilities()
return res
end)(),
},
+ dataSupport = true,
},
callHierarchy = {
dynamicRegistration = false,
@@ -830,9 +853,11 @@ function protocol.make_client_capabilities()
return res
end)(),
},
- hierarchicalWorkspaceSymbolSupport = true,
},
configuration = true,
+ didChangeConfiguration = {
+ dynamicRegistration = false,
+ },
workspaceFolders = true,
applyEdit = true,
workspaceEdit = {
@@ -841,6 +866,13 @@ function protocol.make_client_capabilities()
semanticTokens = {
refreshSupport = true,
},
+ didChangeWatchedFiles = {
+ dynamicRegistration = true,
+ relativePatternSupport = true,
+ },
+ inlayHint = {
+ refreshSupport = true,
+ },
},
experimental = nil,
window = {
@@ -857,10 +889,9 @@ function protocol.make_client_capabilities()
}
end
-local if_nil = vim.F.if_nil
--- Creates a normalized object describing LSP server capabilities.
---@param server_capabilities table Table of capabilities supported by the server
----@return table Normalized table of capabilities
+---@return table|nil Normalized table of capabilities
function protocol.resolve_capabilities(server_capabilities)
local TextDocumentSyncKind = protocol.TextDocumentSyncKind
local textDocumentSync = server_capabilities.textDocumentSync
@@ -878,7 +909,8 @@ function protocol.resolve_capabilities(server_capabilities)
elseif type(textDocumentSync) == 'number' then
-- Backwards compatibility
if not TextDocumentSyncKind[textDocumentSync] then
- return nil, 'Invalid server TextDocumentSyncKind for textDocumentSync'
+ vim.notify('Invalid server TextDocumentSyncKind for textDocumentSync', vim.log.levels.ERROR)
+ return nil
end
server_capabilities.textDocumentSync = {
openClose = true,
@@ -890,183 +922,367 @@ function protocol.resolve_capabilities(server_capabilities)
},
}
elseif type(textDocumentSync) ~= 'table' then
- return nil, string.format('Invalid type for textDocumentSync: %q', type(textDocumentSync))
+ vim.notify(
+ string.format('Invalid type for textDocumentSync: %q', type(textDocumentSync)),
+ vim.log.levels.ERROR
+ )
+ return nil
end
return server_capabilities
end
----@private
---- Creates a normalized object describing LSP server capabilities.
--- @deprecated access resolved_capabilities instead
----@param server_capabilities table Table of capabilities supported by the server
----@return table Normalized table of capabilities
-function protocol._resolve_capabilities_compat(server_capabilities)
- local general_properties = {}
- local text_document_sync_properties
- do
- local TextDocumentSyncKind = protocol.TextDocumentSyncKind
- local textDocumentSync = server_capabilities.textDocumentSync
- if textDocumentSync == nil then
- -- Defaults if omitted.
- text_document_sync_properties = {
- text_document_open_close = false,
- text_document_did_change = TextDocumentSyncKind.None,
- -- text_document_did_change = false;
- text_document_will_save = false,
- text_document_will_save_wait_until = false,
- text_document_save = false,
- text_document_save_include_text = false,
- }
- elseif type(textDocumentSync) == 'number' then
- -- Backwards compatibility
- if not TextDocumentSyncKind[textDocumentSync] then
- return nil, 'Invalid server TextDocumentSyncKind for textDocumentSync'
- end
- text_document_sync_properties = {
- text_document_open_close = true,
- text_document_did_change = textDocumentSync,
- text_document_will_save = false,
- text_document_will_save_wait_until = false,
- text_document_save = true,
- text_document_save_include_text = false,
- }
- elseif type(textDocumentSync) == 'table' then
- text_document_sync_properties = {
- text_document_open_close = if_nil(textDocumentSync.openClose, false),
- text_document_did_change = if_nil(textDocumentSync.change, TextDocumentSyncKind.None),
- text_document_will_save = if_nil(textDocumentSync.willSave, true),
- text_document_will_save_wait_until = if_nil(textDocumentSync.willSaveWaitUntil, true),
- text_document_save = if_nil(textDocumentSync.save, false),
- text_document_save_include_text = if_nil(
- type(textDocumentSync.save) == 'table' and textDocumentSync.save.includeText,
- false
- ),
- }
- else
- return nil, string.format('Invalid type for textDocumentSync: %q', type(textDocumentSync))
- end
- end
- general_properties.completion = server_capabilities.completionProvider ~= nil
- general_properties.hover = server_capabilities.hoverProvider or false
- general_properties.goto_definition = server_capabilities.definitionProvider or false
- general_properties.find_references = server_capabilities.referencesProvider or false
- general_properties.document_highlight = server_capabilities.documentHighlightProvider or false
- general_properties.document_symbol = server_capabilities.documentSymbolProvider or false
- general_properties.workspace_symbol = server_capabilities.workspaceSymbolProvider or false
- general_properties.document_formatting = server_capabilities.documentFormattingProvider or false
- general_properties.document_range_formatting = server_capabilities.documentRangeFormattingProvider
- or false
- general_properties.call_hierarchy = server_capabilities.callHierarchyProvider or false
- general_properties.execute_command = server_capabilities.executeCommandProvider ~= nil
-
- if server_capabilities.renameProvider == nil then
- general_properties.rename = false
- elseif type(server_capabilities.renameProvider) == 'boolean' then
- general_properties.rename = server_capabilities.renameProvider
- else
- general_properties.rename = true
- end
-
- if server_capabilities.codeLensProvider == nil then
- general_properties.code_lens = false
- general_properties.code_lens_resolve = false
- elseif type(server_capabilities.codeLensProvider) == 'table' then
- general_properties.code_lens = true
- general_properties.code_lens_resolve = server_capabilities.codeLensProvider.resolveProvider
- or false
- else
- error('The server sent invalid codeLensProvider')
- end
-
- if server_capabilities.codeActionProvider == nil then
- general_properties.code_action = false
- elseif
- type(server_capabilities.codeActionProvider) == 'boolean'
- or type(server_capabilities.codeActionProvider) == 'table'
- then
- general_properties.code_action = server_capabilities.codeActionProvider
- else
- error('The server sent invalid codeActionProvider')
- end
-
- if server_capabilities.declarationProvider == nil then
- general_properties.declaration = false
- elseif type(server_capabilities.declarationProvider) == 'boolean' then
- general_properties.declaration = server_capabilities.declarationProvider
- elseif type(server_capabilities.declarationProvider) == 'table' then
- general_properties.declaration = server_capabilities.declarationProvider
- else
- error('The server sent invalid declarationProvider')
- end
-
- if server_capabilities.typeDefinitionProvider == nil then
- general_properties.type_definition = false
- elseif type(server_capabilities.typeDefinitionProvider) == 'boolean' then
- general_properties.type_definition = server_capabilities.typeDefinitionProvider
- elseif type(server_capabilities.typeDefinitionProvider) == 'table' then
- general_properties.type_definition = server_capabilities.typeDefinitionProvider
- else
- error('The server sent invalid typeDefinitionProvider')
- end
-
- if server_capabilities.implementationProvider == nil then
- general_properties.implementation = false
- elseif type(server_capabilities.implementationProvider) == 'boolean' then
- general_properties.implementation = server_capabilities.implementationProvider
- elseif type(server_capabilities.implementationProvider) == 'table' then
- general_properties.implementation = server_capabilities.implementationProvider
- else
- error('The server sent invalid implementationProvider')
- end
-
- local workspace = server_capabilities.workspace
- local workspace_properties = {}
- if workspace == nil or workspace.workspaceFolders == nil then
- -- Defaults if omitted.
- workspace_properties = {
- workspace_folder_properties = {
- supported = false,
- changeNotifications = false,
- },
- }
- elseif type(workspace.workspaceFolders) == 'table' then
- workspace_properties = {
- workspace_folder_properties = {
- supported = if_nil(workspace.workspaceFolders.supported, false),
- changeNotifications = if_nil(workspace.workspaceFolders.changeNotifications, false),
- },
- }
- else
- error('The server sent invalid workspace')
- end
-
- local signature_help_properties
- if server_capabilities.signatureHelpProvider == nil then
- signature_help_properties = {
- signature_help = false,
- signature_help_trigger_characters = {},
- }
- elseif type(server_capabilities.signatureHelpProvider) == 'table' then
- signature_help_properties = {
- signature_help = true,
- -- The characters that trigger signature help automatically.
- signature_help_trigger_characters = server_capabilities.signatureHelpProvider.triggerCharacters
- or {},
- }
- else
- error('The server sent invalid signatureHelpProvider')
- end
-
- local capabilities = vim.tbl_extend(
- 'error',
- text_document_sync_properties,
- signature_help_properties,
- workspace_properties,
- general_properties
- )
-
- return capabilities
+-- 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
+protocol.Methods = {
+ --- A request to resolve the incoming calls for a given `CallHierarchyItem`.
+ --- @since 3.16.0
+ callHierarchy_incomingCalls = 'callHierarchy/incomingCalls',
+ --- A request to resolve the outgoing calls for a given `CallHierarchyItem`.
+ --- @since 3.16.0
+ callHierarchy_outgoingCalls = 'callHierarchy/outgoingCalls',
+ --- The `client/registerCapability` request is sent from the server to the client to register a new capability
+ --- handler on the client side.
+ client_registerCapability = 'client/registerCapability',
+ --- The `client/unregisterCapability` request is sent from the server to the client to unregister a previously registered capability
+ --- handler on the client side.
+ client_unregisterCapability = 'client/unregisterCapability',
+ --- Request to resolve additional information for a given code action.The request's
+ --- parameter is of type {@link CodeAction} the response
+ --- is of type {@link CodeAction} or a Thenable that resolves to such.
+ codeAction_resolve = 'codeAction/resolve',
+ --- A request to resolve a command for a given code lens.
+ codeLens_resolve = 'codeLens/resolve',
+ --- Request to resolve additional information for a given completion item.The request's
+ --- parameter is of type {@link CompletionItem} the response
+ --- is of type {@link CompletionItem} or a Thenable that resolves to such.
+ completionItem_resolve = 'completionItem/resolve',
+ --- Request to resolve additional information for a given document link. The request's
+ --- parameter is of type {@link DocumentLink} the response
+ --- is of type {@link DocumentLink} or a Thenable that resolves to such.
+ documentLink_resolve = 'documentLink/resolve',
+ dollar_cancelRequest = '$/cancelRequest',
+ dollar_logTrace = '$/logTrace',
+ dollar_progress = '$/progress',
+ dollar_setTrace = '$/setTrace',
+ --- The exit event is sent from the client to the server to
+ --- ask the server to exit its process.
+ exit = 'exit',
+ --- The initialize request is sent from the client to the server.
+ --- It is sent once as the request after starting up the server.
+ --- The requests parameter is of type {@link InitializeParams}
+ --- the response if of type {@link InitializeResult} of a Thenable that
+ --- resolves to such.
+ initialize = 'initialize',
+ --- The initialized notification is sent from the client to the
+ --- server after the client is fully initialized and the server
+ --- is allowed to send requests from the server to the client.
+ initialized = 'initialized',
+ --- A request to resolve additional properties for an inlay hint.
+ --- The request's parameter is of type {@link InlayHint}, the response is
+ --- of type {@link InlayHint} or a Thenable that resolves to such.
+ --- @since 3.17.0
+ inlayHint_resolve = 'inlayHint/resolve',
+ notebookDocument_didChange = 'notebookDocument/didChange',
+ --- A notification sent when a notebook closes.
+ --- @since 3.17.0
+ notebookDocument_didClose = 'notebookDocument/didClose',
+ --- A notification sent when a notebook opens.
+ --- @since 3.17.0
+ notebookDocument_didOpen = 'notebookDocument/didOpen',
+ --- A notification sent when a notebook document is saved.
+ --- @since 3.17.0
+ notebookDocument_didSave = 'notebookDocument/didSave',
+ --- A shutdown request is sent from the client to the server.
+ --- It is sent once when the client decides to shutdown the
+ --- server. The only notification that is sent after a shutdown request
+ --- is the exit event.
+ shutdown = 'shutdown',
+ --- The telemetry event notification is sent from the server to the client to ask
+ --- the client to log telemetry data.
+ telemetry_event = 'telemetry/event',
+ --- A request to provide commands for the given text document and range.
+ textDocument_codeAction = 'textDocument/codeAction',
+ --- A request to provide code lens for the given text document.
+ textDocument_codeLens = 'textDocument/codeLens',
+ --- A request to list all presentation for a color. The request's
+ --- parameter is of type {@link ColorPresentationParams} the
+ --- response is of type {@link ColorInformation ColorInformation[]} or a Thenable
+ --- that resolves to such.
+ textDocument_colorPresentation = 'textDocument/colorPresentation',
+ --- Request to request completion at a given text document position. The request's
+ --- parameter is of type {@link TextDocumentPosition} the response
+ --- is of type {@link CompletionItem CompletionItem[]} or {@link CompletionList}
+ --- or a Thenable that resolves to such.
+ --- The request can delay the computation of the {@link CompletionItem.detail `detail`}
+ --- and {@link CompletionItem.documentation `documentation`} properties to the `completionItem/resolve`
+ --- request. However, properties that are needed for the initial sorting and filtering, like `sortText`,
+ --- `filterText`, `insertText`, and `textEdit`, must not be changed during resolve.
+ 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.
+ 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.
+ textDocument_definition = 'textDocument/definition',
+ --- The document diagnostic request definition.
+ --- @since 3.17.0
+ textDocument_diagnostic = 'textDocument/diagnostic',
+ --- The document change notification is sent from the client to the server to signal
+ --- changes to a text document.
+ textDocument_didChange = 'textDocument/didChange',
+ --- The document close notification is sent from the client to the server when
+ --- the document got closed in the client. The document's truth now exists where
+ --- the document's uri points to (e.g. if the document's uri is a file uri the
+ --- truth now exists on disk). As with the open notification the close notification
+ --- is about managing the document's content. Receiving a close notification
+ --- doesn't mean that the document was open in an editor before. A close
+ --- notification requires a previous open notification to be sent.
+ textDocument_didClose = 'textDocument/didClose',
+ --- The document open notification is sent from the client to the server to signal
+ --- newly opened text documents. The document's truth is now managed by the client
+ --- and the server must not try to read the document's truth using the document's
+ --- uri. Open in this sense means it is managed by the client. It doesn't necessarily
+ --- mean that its content is presented in an editor. An open notification must not
+ --- be sent more than once without a corresponding close notification send before.
+ --- This means open and close notification must be balanced and the max open count
+ --- is one.
+ textDocument_didOpen = 'textDocument/didOpen',
+ --- The document save notification is sent from the client to the server when
+ --- the document got saved in the client.
+ textDocument_didSave = 'textDocument/didSave',
+ --- A request to list all color symbols found in a given text document. The request's
+ --- parameter is of type {@link DocumentColorParams} the
+ --- response is of type {@link ColorInformation ColorInformation[]} or a Thenable
+ --- that resolves to such.
+ 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.
+ textDocument_documentHighlight = 'textDocument/documentHighlight',
+ --- A request to provide document links
+ textDocument_documentLink = 'textDocument/documentLink',
+ --- A request to list all symbols found in a given text document. The request's
+ --- parameter is of type {@link TextDocumentIdentifier} the
+ --- response is of type {@link SymbolInformation SymbolInformation[]} or a Thenable
+ --- that resolves to such.
+ textDocument_documentSymbol = 'textDocument/documentSymbol',
+ --- A request to provide folding ranges in a document. The request's
+ --- parameter is of type {@link FoldingRangeParams}, the
+ --- response is of type {@link FoldingRangeList} or a Thenable
+ --- that resolves to such.
+ textDocument_foldingRange = 'textDocument/foldingRange',
+ --- A request to 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.
+ 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
+ --- {@link InlayHint InlayHint[]} or a Thenable that resolves to such.
+ --- @since 3.17.0
+ textDocument_inlayHint = 'textDocument/inlayHint',
+ --- A request to provide inline completions in a document. The request's parameter is of
+ --- type {@link InlineCompletionParams}, the response is of type
+ --- {@link InlineCompletion InlineCompletion[]} or a Thenable that resolves to such.
+ --- @since 3.18.0
+ 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
+ --- {@link InlineValue InlineValue[]} or a Thenable that resolves to such.
+ --- @since 3.17.0
+ textDocument_inlineValue = 'textDocument/inlineValue',
+ --- A request to provide ranges that can be edited together.
+ --- @since 3.16.0
+ textDocument_linkedEditingRange = 'textDocument/linkedEditingRange',
+ --- A request to get the moniker of a symbol at a given text document position.
+ --- The request parameter is of type {@link TextDocumentPositionParams}.
+ --- The response is of type {@link Moniker Moniker[]} or `null`.
+ textDocument_moniker = 'textDocument/moniker',
+ --- A request to format a document on type.
+ textDocument_onTypeFormatting = 'textDocument/onTypeFormatting',
+ --- A request to result a `CallHierarchyItem` in a document at a given position.
+ --- Can be used as an input to an incoming or outgoing call hierarchy.
+ --- @since 3.16.0
+ textDocument_prepareCallHierarchy = 'textDocument/prepareCallHierarchy',
+ --- A request to test and perform the setup necessary for a rename.
+ --- @since 3.16 - support for default behavior
+ textDocument_prepareRename = 'textDocument/prepareRename',
+ --- A request to result a `TypeHierarchyItem` in a document at a given position.
+ --- Can be used as an input to a subtypes or supertypes type hierarchy.
+ --- @since 3.17.0
+ textDocument_prepareTypeHierarchy = 'textDocument/prepareTypeHierarchy',
+ --- Diagnostics notification are sent from the server to the client to signal
+ --- results of validation runs.
+ textDocument_publishDiagnostics = 'textDocument/publishDiagnostics',
+ --- A request to format a range in a document.
+ textDocument_rangeFormatting = 'textDocument/rangeFormatting',
+ --- A request to format ranges in a document.
+ --- @since 3.18.0
+ --- @proposed
+ textDocument_rangesFormatting = 'textDocument/rangesFormatting',
+ --- A request to resolve project-wide references for the symbol denoted
+ --- by the given text document position. The request's parameter is of
+ --- type {@link ReferenceParams} the response is of type
+ --- {@link Location Location[]} or a Thenable that resolves to such.
+ textDocument_references = 'textDocument/references',
+ --- A request to rename a symbol.
+ textDocument_rename = 'textDocument/rename',
+ --- A request to provide selection ranges in a document. The request's
+ --- parameter is of type {@link SelectionRangeParams}, the
+ --- response is of type {@link SelectionRange SelectionRange[]} or a Thenable
+ --- that resolves to such.
+ textDocument_selectionRange = 'textDocument/selectionRange',
+ --- @since 3.16.0
+ textDocument_semanticTokens_full = 'textDocument/semanticTokens/full',
+ --- @since 3.16.0
+ textDocument_semanticTokens_full_delta = 'textDocument/semanticTokens/full/delta',
+ --- @since 3.16.0
+ 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.
+ textDocument_typeDefinition = 'textDocument/typeDefinition',
+ --- A document will save notification is sent from the client to the server before
+ --- the document is actually saved.
+ textDocument_willSave = 'textDocument/willSave',
+ --- A document will save request is sent from the client to the server before
+ --- the document is actually saved. The request can return an array of TextEdits
+ --- which will be applied to the text document before it is saved. Please note that
+ --- clients might drop results if computing the text edits took too long or if a
+ --- server constantly fails on this request. This is done to keep the save fast and
+ --- reliable.
+ textDocument_willSaveWaitUntil = 'textDocument/willSaveWaitUntil',
+ --- A request to resolve the subtypes for a given `TypeHierarchyItem`.
+ --- @since 3.17.0
+ typeHierarchy_subtypes = 'typeHierarchy/subtypes',
+ --- A request to resolve the supertypes for a given `TypeHierarchyItem`.
+ --- @since 3.17.0
+ typeHierarchy_supertypes = 'typeHierarchy/supertypes',
+ --- The log message notification is sent from the server to the client to ask
+ --- the client to log a particular message.
+ window_logMessage = 'window/logMessage',
+ --- A request to show a document. This request might open an
+ --- external program depending on the value of the URI to open.
+ --- For example a request to open `https://code.visualstudio.com/`
+ --- will very likely open the URI in a WEB browser.
+ --- @since 3.16.0
+ window_showDocument = 'window/showDocument',
+ --- The show message notification is sent from a server to a client to ask
+ --- the client to display a particular message in the user interface.
+ window_showMessage = 'window/showMessage',
+ --- The show message request is sent from the server to the client to show a message
+ --- and a set of options actions to the user.
+ window_showMessageRequest = 'window/showMessageRequest',
+ --- The `window/workDoneProgress/cancel` notification is sent from the client to the server to cancel a progress
+ --- initiated on the server side.
+ window_workDoneProgress_cancel = 'window/workDoneProgress/cancel',
+ --- The `window/workDoneProgress/create` request is sent from the server to the client to initiate progress
+ --- reporting from the server.
+ window_workDoneProgress_create = 'window/workDoneProgress/create',
+ --- A request to resolve the range inside the workspace
+ --- symbol's location.
+ --- @since 3.17.0
+ workspaceSymbol_resolve = 'workspaceSymbol/resolve',
+ --- 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 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.
+ workspace_configuration = 'workspace/configuration',
+ --- The workspace diagnostic request definition.
+ --- @since 3.17.0
+ workspace_diagnostic = 'workspace/diagnostic',
+ --- The diagnostic refresh request definition.
+ --- @since 3.17.0
+ workspace_diagnostic_refresh = 'workspace/diagnostic/refresh',
+ --- The configuration change notification is sent from the client to the server
+ --- when the client's configuration has changed. The notification contains
+ --- the changed configuration as defined by the language client.
+ workspace_didChangeConfiguration = 'workspace/didChangeConfiguration',
+ --- The watched files notification is sent from the client to the server when
+ --- the client detects changes to file watched by the language client.
+ workspace_didChangeWatchedFiles = 'workspace/didChangeWatchedFiles',
+ --- The `workspace/didChangeWorkspaceFolders` notification is sent from the client to the server when the workspace
+ --- folder configuration changes.
+ workspace_didChangeWorkspaceFolders = 'workspace/didChangeWorkspaceFolders',
+ --- The did create files notification is sent from the client to the server when
+ --- files were created from within the client.
+ --- @since 3.16.0
+ workspace_didCreateFiles = 'workspace/didCreateFiles',
+ --- The will delete files request is sent from the client to the server before files are actually
+ --- deleted as long as the deletion is triggered from within the client.
+ --- @since 3.16.0
+ workspace_didDeleteFiles = 'workspace/didDeleteFiles',
+ --- The did rename files notification is sent from the client to the server when
+ --- files were renamed from within the client.
+ --- @since 3.16.0
+ workspace_didRenameFiles = 'workspace/didRenameFiles',
+ --- 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.17.0
+ workspace_inlayHint_refresh = 'workspace/inlayHint/refresh',
+ --- @since 3.17.0
+ workspace_inlineValue_refresh = 'workspace/inlineValue/refresh',
+ --- @since 3.16.0
+ workspace_semanticTokens_refresh = 'workspace/semanticTokens/refresh',
+ --- A request to list project-wide symbols matching the query string given
+ --- by the {@link WorkspaceSymbolParams}. The response is
+ --- of type {@link SymbolInformation SymbolInformation[]} or a Thenable that
+ --- resolves to such.
+ --- @since 3.17.0 - support for WorkspaceSymbol in the returned data. Clients
+ --- need to advertise support for WorkspaceSymbols via the client capability
+ --- `workspace.symbol.resolveSupport`.
+ workspace_symbol = 'workspace/symbol',
+ --- The will create files request is sent from the client to the server before files are actually
+ --- created as long as the creation is triggered from within the client.
+ --- The request can return a `WorkspaceEdit` which will be applied to workspace before the
+ --- files are created. Hence the `WorkspaceEdit` can not manipulate the content of the file
+ --- to be created.
+ --- @since 3.16.0
+ workspace_willCreateFiles = 'workspace/willCreateFiles',
+ --- The did delete files notification is sent from the client to the server when
+ --- files were deleted from within the client.
+ --- @since 3.16.0
+ workspace_willDeleteFiles = 'workspace/willDeleteFiles',
+ --- The will rename files request is sent from the client to the server before files are actually
+ --- renamed as long as the rename is triggered from within the client.
+ --- @since 3.16.0
+ workspace_willRenameFiles = 'workspace/willRenameFiles',
+ --- The `workspace/workspaceFolders` is sent from the server to the client to fetch the open workspace folders.
+ workspace_workspaceFolders = 'workspace/workspaceFolders',
+}
+local function freeze(t)
+ return setmetatable({}, {
+ __index = t,
+ __newindex = function()
+ error('cannot modify immutable table')
+ end,
+ })
end
+protocol.Methods = freeze(protocol.Methods)
return protocol
--- vim:sw=2 ts=2 et