aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2024-11-05 17:34:21 +0000
committerLewis Russell <me@lewisr.dev>2024-11-18 17:09:53 +0000
commit989a37a594649528f28432388c0e7e28e8be2753 (patch)
tree995df7bc856bc61d69d6666d3c569b5bb1a1f905 /runtime/lua/vim/lsp.lua
parente2ad251c8d01726ecd54d925b5280ab32b448c13 (diff)
downloadrneovim-989a37a594649528f28432388c0e7e28e8be2753.tar.gz
rneovim-989a37a594649528f28432388c0e7e28e8be2753.tar.bz2
rneovim-989a37a594649528f28432388c0e7e28e8be2753.zip
refactor(lsp): fold in dynamic_registration code into the client
Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 42a0ccc3d4..0de3b4ee4d 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -3,7 +3,6 @@ local validate = vim.validate
local lsp = vim._defer_require('vim.lsp', {
_changetracking = ..., --- @module 'vim.lsp._changetracking'
- _dynamic = ..., --- @module 'vim.lsp._dynamic'
_snippet_grammar = ..., --- @module 'vim.lsp._snippet_grammar'
_tagfunc = ..., --- @module 'vim.lsp._tagfunc'
_watchfiles = ..., --- @module 'vim.lsp._watchfiles'
@@ -31,6 +30,13 @@ local changetracking = lsp._changetracking
---@nodoc
lsp.rpc_response_error = lsp.rpc.rpc_response_error
+lsp._resolve_to_request = {
+ [ms.codeAction_resolve] = ms.textDocument_codeAction,
+ [ms.codeLens_resolve] = ms.textDocument_codeLens,
+ [ms.documentLink_resolve] = ms.textDocument_documentLink,
+ [ms.inlayHint_resolve] = ms.textDocument_inlayHint,
+}
+
-- maps request name to the required server_capability in the client.
lsp._request_name_to_capability = {
[ms.callHierarchy_incomingCalls] = { 'callHierarchyProvider' },