Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove handlers in config. #3344

Open
glepnir opened this issue Oct 3, 2024 · 0 comments
Open

Remove handlers in config. #3344

glepnir opened this issue Oct 3, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@glepnir
Copy link
Member

glepnir commented Oct 3, 2024

Description

The current behavior config.handlers works like a bridge. Then it is passed to vim.lsp.handler.. The purpose is to locate the override handlers in LspInfo. Currently checkhealth supports the vim.lsp module. In order to extract the redundant management behavior of lspconfig. The subsequent steps can add the override handler file location in checkhealth vim.lsp.

something like

diff --git a/runtime/lua/vim/lsp/health.lua b/runtime/lua/vim/lsp/health.lua
index 18066a84d..faf43ddcd 100644
--- a/runtime/lua/vim/lsp/health.lua
+++ b/runtime/lua/vim/lsp/health.lua
@@ -159,6 +159,16 @@ local function check_position_encodings()
   end
 end

+function M.check_handlers_override()
+  local handlers = vim.lsp.handlers
+  for name, handler in ipairs(handlers) do
+    local source = debug.getinfo(handler, 'S').source
+    if not source:find('vim/lsp/handlers.lua') then
+      report_info(('Handler of method %s override in: %s '):format(name, source))
+    end
+  end
+end
+
 --- Performs a healthcheck for LSP
 function M.check()
   check_log()

ref #3335

@glepnir glepnir added the bug Something isn't working label Oct 3, 2024
@justinmk justinmk added enhancement New feature or request and removed bug Something isn't working labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants