Skip to content

Commit 2c010a9

Browse files
committed
fix: add support for partial LSP clients in neovim <0.10
1 parent 56822a5 commit 2c010a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lua/astrolsp/init.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,9 @@ function M.setup(opts)
282282
local register_capability_handler = vim.lsp.handlers["client/registerCapability"]
283283
vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
284284
local ret = register_capability_handler(err, res, ctx)
285-
configure_environment(assert(vim.lsp.get_client_by_id(ctx.client_id)), vim.api.nvim_get_current_buf())
285+
local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
286+
-- TODO: remove `if` statement when dropping support for Neovim v0.9
287+
if client.supports_method then configure_environment(client, vim.api.nvim_get_current_buf()) end
286288
return ret
287289
end
288290

0 commit comments

Comments
 (0)