mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
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
This commit is contained in:
committed by
Lewis Russell
parent
e2ad251c8d
commit
989a37a594
@ -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' },
|
||||
|
Reference in New Issue
Block a user