From 8c94842b4a613995bf4c0c79febcd74c310439d0 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Tue, 21 May 2024 18:23:04 +0200 Subject: [PATCH] fix(lsp): sometimes lsp client is not fully initialized and doesnt yet have client.supports_method on 0.9.5. Fixes #3263 --- lua/lazyvim/util/lsp.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lazyvim/util/lsp.lua b/lua/lazyvim/util/lsp.lua index 6479f1df..e14a5e13 100644 --- a/lua/lazyvim/util/lsp.lua +++ b/lua/lazyvim/util/lsp.lua @@ -61,7 +61,7 @@ function M._check_methods(client, buffer) for method, clients in pairs(M._supports_method) do clients[client] = clients[client] or {} if not clients[client][buffer] then - if client.supports_method(method, { bufnr = buffer }) then + if client.supports_method and client.supports_method(method, { bufnr = buffer }) then clients[client][buffer] = true vim.api.nvim_exec_autocmds("User", { pattern = "LspSupportsMethod",