aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/protocol.lua
diff options
context:
space:
mode:
authorTristan Knight <admin@snappeh.com>2026-05-05 21:36:02 +0100
committerGitHub <noreply@github.com>2026-05-05 16:36:02 -0400
commited194b99ac7ddf84dda8c8239fdc10bb02275b4b (patch)
treeb9d81e127f28a5f4c5e61956cde8fa4ff19d97c0 /runtime/lua/vim/lsp/protocol.lua
parent264fbc0ace0b701ac6fa8fe217d42950c8fd79c3 (diff)
downloadrneovim-ed194b99ac7ddf84dda8c8239fdc10bb02275b4b.tar.gz
rneovim-ed194b99ac7ddf84dda8c8239fdc10bb02275b4b.tar.bz2
rneovim-ed194b99ac7ddf84dda8c8239fdc10bb02275b4b.zip
fix(lsp): support nested workspace registrations #39574
Problem: Nested workspace capabilities like workspace.fileOperations.didCreate and workspace.textDocumentContent are not handled consistently for dynamic and static registration provider lookup. Solution: Generate explicit registration-provider mappings from the LSP metadata and use them when registering and querying capabilities. Add coverage for dynamic and static nested workspace registrations.
Diffstat (limited to 'runtime/lua/vim/lsp/protocol.lua')
-rw-r--r--runtime/lua/vim/lsp/protocol.lua139
1 files changed, 113 insertions, 26 deletions
diff --git a/runtime/lua/vim/lsp/protocol.lua b/runtime/lua/vim/lsp/protocol.lua
index 93f67b52b9..46b5602300 100644
--- a/runtime/lua/vim/lsp/protocol.lua
+++ b/runtime/lua/vim/lsp/protocol.lua
@@ -1175,7 +1175,6 @@ protocol.Methods = {
-- stylua: ignore start
-- Generated by gen_lsp.lua, keep at end of file.
--- Maps method names to the required client capability
----TODO: also has workspace/* items because spec lacks a top-level "workspaceProvider"
protocol._provider_to_client_registration = {
['callHierarchyProvider'] = { 'textDocument', 'callHierarchy' },
['codeActionProvider'] = { 'textDocument', 'codeAction' },
@@ -1208,21 +1207,123 @@ protocol._provider_to_client_registration = {
['textDocumentSync'] = { 'textDocument', 'synchronization' },
['typeDefinitionProvider'] = { 'textDocument', 'typeDefinition' },
['typeHierarchyProvider'] = { 'textDocument', 'typeHierarchy' },
+ ['workspace.fileOperations.didCreate'] = { 'workspace', 'fileOperations', 'didCreate' },
+ ['workspace.fileOperations.didDelete'] = { 'workspace', 'fileOperations', 'didDelete' },
+ ['workspace.fileOperations.didRename'] = { 'workspace', 'fileOperations', 'didRename' },
+ ['workspace.fileOperations.willCreate'] = { 'workspace', 'fileOperations', 'willCreate' },
+ ['workspace.fileOperations.willDelete'] = { 'workspace', 'fileOperations', 'willDelete' },
+ ['workspace.fileOperations.willRename'] = { 'workspace', 'fileOperations', 'willRename' },
+ ['workspace.textDocumentContent'] = { 'workspace', 'textDocumentContent' },
['workspace/didChangeConfiguration'] = { 'workspace', 'didChangeConfiguration' },
['workspace/didChangeWatchedFiles'] = { 'workspace', 'didChangeWatchedFiles' },
- ['workspace/didCreateFiles'] = { 'workspace', 'fileOperations', 'didCreate' },
- ['workspace/didDeleteFiles'] = { 'workspace', 'fileOperations', 'didDelete' },
- ['workspace/didRenameFiles'] = { 'workspace', 'fileOperations', 'didRename' },
- ['workspace/textDocumentContent'] = { 'workspace', 'textDocumentContent' },
- ['workspace/willCreateFiles'] = { 'workspace', 'fileOperations', 'willCreate' },
- ['workspace/willDeleteFiles'] = { 'workspace', 'fileOperations', 'willDelete' },
- ['workspace/willRenameFiles'] = { 'workspace', 'fileOperations', 'willRename' },
['workspaceSymbolProvider'] = { 'workspace', 'symbol' },
}
-- stylua: ignore end
-- stylua: ignore start
-- Generated by gen_lsp.lua, keep at end of file.
+--- Maps method names to dynamic/static registration providers
+protocol._request_name_to_registration_provider = {
+ ['callHierarchy/incomingCalls'] = 'callHierarchyProvider',
+ ['callHierarchy/outgoingCalls'] = 'callHierarchyProvider',
+ ['client/registerCapability'] = 'client/registerCapability',
+ ['client/unregisterCapability'] = 'client/unregisterCapability',
+ ['codeAction/resolve'] = 'codeActionProvider',
+ ['codeLens/resolve'] = 'codeLensProvider',
+ ['completionItem/resolve'] = 'completionProvider',
+ ['documentLink/resolve'] = 'documentLinkProvider',
+ ['$/cancelRequest'] = '$/cancelRequest',
+ ['$/logTrace'] = '$/logTrace',
+ ['$/progress'] = '$/progress',
+ ['$/setTrace'] = '$/setTrace',
+ ['exit'] = 'exit',
+ ['initialize'] = 'initialize',
+ ['initialized'] = 'initialized',
+ ['inlayHint/resolve'] = 'inlayHintProvider',
+ ['notebookDocument/didChange'] = 'notebookDocument/didChange',
+ ['notebookDocument/didClose'] = 'notebookDocument/didClose',
+ ['notebookDocument/didOpen'] = 'notebookDocument/didOpen',
+ ['notebookDocument/didSave'] = 'notebookDocument/didSave',
+ ['shutdown'] = 'shutdown',
+ ['telemetry/event'] = 'telemetry/event',
+ ['textDocument/codeAction'] = 'codeActionProvider',
+ ['textDocument/codeLens'] = 'codeLensProvider',
+ ['textDocument/colorPresentation'] = 'colorProvider',
+ ['textDocument/completion'] = 'completionProvider',
+ ['textDocument/declaration'] = 'declarationProvider',
+ ['textDocument/definition'] = 'definitionProvider',
+ ['textDocument/diagnostic'] = 'diagnosticProvider',
+ ['textDocument/didChange'] = 'textDocumentSync',
+ ['textDocument/didClose'] = 'textDocumentSync',
+ ['textDocument/didOpen'] = 'textDocumentSync',
+ ['textDocument/didSave'] = 'textDocumentSync',
+ ['textDocument/documentColor'] = 'colorProvider',
+ ['textDocument/documentHighlight'] = 'documentHighlightProvider',
+ ['textDocument/documentLink'] = 'documentLinkProvider',
+ ['textDocument/documentSymbol'] = 'documentSymbolProvider',
+ ['textDocument/foldingRange'] = 'foldingRangeProvider',
+ ['textDocument/formatting'] = 'documentFormattingProvider',
+ ['textDocument/hover'] = 'hoverProvider',
+ ['textDocument/implementation'] = 'implementationProvider',
+ ['textDocument/inlayHint'] = 'inlayHintProvider',
+ ['textDocument/inlineCompletion'] = 'inlineCompletionProvider',
+ ['textDocument/inlineValue'] = 'inlineValueProvider',
+ ['textDocument/linkedEditingRange'] = 'linkedEditingRangeProvider',
+ ['textDocument/moniker'] = 'monikerProvider',
+ ['textDocument/onTypeFormatting'] = 'documentOnTypeFormattingProvider',
+ ['textDocument/prepareCallHierarchy'] = 'callHierarchyProvider',
+ ['textDocument/prepareRename'] = 'renameProvider',
+ ['textDocument/prepareTypeHierarchy'] = 'typeHierarchyProvider',
+ ['textDocument/publishDiagnostics'] = 'textDocument/publishDiagnostics',
+ ['textDocument/rangeFormatting'] = 'documentRangeFormattingProvider',
+ ['textDocument/rangesFormatting'] = 'documentRangeFormattingProvider',
+ ['textDocument/references'] = 'referencesProvider',
+ ['textDocument/rename'] = 'renameProvider',
+ ['textDocument/selectionRange'] = 'selectionRangeProvider',
+ ['textDocument/semanticTokens/full'] = 'semanticTokensProvider',
+ ['textDocument/semanticTokens/full/delta'] = 'semanticTokensProvider',
+ ['textDocument/semanticTokens/range'] = 'semanticTokensProvider',
+ ['textDocument/signatureHelp'] = 'signatureHelpProvider',
+ ['textDocument/typeDefinition'] = 'typeDefinitionProvider',
+ ['textDocument/willSave'] = 'textDocumentSync',
+ ['textDocument/willSaveWaitUntil'] = 'textDocumentSync',
+ ['typeHierarchy/subtypes'] = 'typeHierarchy/subtypes',
+ ['typeHierarchy/supertypes'] = 'typeHierarchy/supertypes',
+ ['window/logMessage'] = 'window/logMessage',
+ ['window/showDocument'] = 'window/showDocument',
+ ['window/showMessage'] = 'window/showMessage',
+ ['window/showMessageRequest'] = 'window/showMessageRequest',
+ ['window/workDoneProgress/cancel'] = 'window/workDoneProgress/cancel',
+ ['window/workDoneProgress/create'] = 'window/workDoneProgress/create',
+ ['workspaceSymbol/resolve'] = 'workspaceSymbolProvider',
+ ['workspace/applyEdit'] = 'workspace/applyEdit',
+ ['workspace/codeLens/refresh'] = 'workspace/codeLens/refresh',
+ ['workspace/configuration'] = 'workspace/configuration',
+ ['workspace/diagnostic'] = 'diagnosticProvider',
+ ['workspace/diagnostic/refresh'] = 'workspace/diagnostic/refresh',
+ ['workspace/didChangeConfiguration'] = 'workspace/didChangeConfiguration',
+ ['workspace/didChangeWatchedFiles'] = 'workspace/didChangeWatchedFiles',
+ ['workspace/didChangeWorkspaceFolders'] = 'workspace.workspaceFolders.changeNotifications',
+ ['workspace/didCreateFiles'] = 'workspace.fileOperations.didCreate',
+ ['workspace/didDeleteFiles'] = 'workspace.fileOperations.didDelete',
+ ['workspace/didRenameFiles'] = 'workspace.fileOperations.didRename',
+ ['workspace/executeCommand'] = 'executeCommandProvider',
+ ['workspace/foldingRange/refresh'] = 'workspace/foldingRange/refresh',
+ ['workspace/inlayHint/refresh'] = 'workspace/inlayHint/refresh',
+ ['workspace/inlineValue/refresh'] = 'workspace/inlineValue/refresh',
+ ['workspace/semanticTokens/refresh'] = 'workspace/semanticTokens/refresh',
+ ['workspace/symbol'] = 'workspaceSymbolProvider',
+ ['workspace/textDocumentContent'] = 'workspace.textDocumentContent',
+ ['workspace/textDocumentContent/refresh'] = 'workspace/textDocumentContent/refresh',
+ ['workspace/willCreateFiles'] = 'workspace.fileOperations.willCreate',
+ ['workspace/willDeleteFiles'] = 'workspace.fileOperations.willDelete',
+ ['workspace/willRenameFiles'] = 'workspace.fileOperations.willRename',
+ ['workspace/workspaceFolders'] = 'workspace.workspaceFolders',
+}
+-- stylua: ignore end
+
+-- stylua: ignore start
+-- Generated by gen_lsp.lua, keep at end of file.
--- Maps method names to the required server capability
-- A server capability equal to the method means there is no related server capability
protocol._request_name_to_server_capability = {
@@ -1389,39 +1490,25 @@ protocol._method_supports_dynamic_registration = {
-- stylua: ignore start
-- Generated by gen_lsp.lua, keep at end of file.
protocol._method_supports_static_registration = {
- ['textDocument/codeAction'] = true,
- ['textDocument/codeLens'] = true,
+ ['callHierarchy/incomingCalls'] = true,
+ ['callHierarchy/outgoingCalls'] = true,
['textDocument/colorPresentation'] = true,
- ['textDocument/completion'] = true,
['textDocument/declaration'] = true,
- ['textDocument/definition'] = true,
['textDocument/diagnostic'] = true,
- ['textDocument/didChange'] = true,
['textDocument/documentColor'] = true,
- ['textDocument/documentHighlight'] = true,
- ['textDocument/documentLink'] = true,
- ['textDocument/documentSymbol'] = true,
['textDocument/foldingRange'] = true,
- ['textDocument/formatting'] = true,
- ['textDocument/hover'] = true,
['textDocument/implementation'] = true,
['textDocument/inlayHint'] = true,
['textDocument/inlineCompletion'] = true,
['textDocument/inlineValue'] = true,
['textDocument/linkedEditingRange'] = true,
- ['textDocument/moniker'] = true,
- ['textDocument/onTypeFormatting'] = true,
['textDocument/prepareCallHierarchy'] = true,
['textDocument/prepareTypeHierarchy'] = true,
- ['textDocument/rangeFormatting'] = true,
- ['textDocument/references'] = true,
- ['textDocument/rename'] = true,
['textDocument/selectionRange'] = true,
['textDocument/semanticTokens/full'] = true,
- ['textDocument/signatureHelp'] = true,
+ ['textDocument/semanticTokens/full/delta'] = true,
['textDocument/typeDefinition'] = true,
- ['workspace/executeCommand'] = true,
- ['workspace/symbol'] = true,
+ ['workspace/textDocumentContent'] = true,
}
-- stylua: ignore end