From 65df9845f72399df20266cb9fbd5e3d4afe41cc5 Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Sat, 21 Dec 2024 12:40:51 +0530 Subject: [PATCH] nvim: lsp: Non-method client functions are deprecated We have no idea what non method client functions are or imply in the context of Lua but who cares. --- nvim/.config/nvim/lua/lsp.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 432c720..34ab06e 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -161,12 +161,12 @@ local on_attach = function(client_id, client, bufnr) for _, mappings in pairs(lsp_key_mappings) do local capability, mode, lhs, rhs = unpack(mappings) - if client.supports_method(capability) then + if client:supports_method(capability) then vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts) end end - if client.supports_method('textDocument/codeLens') then + if client:supports_method('textDocument/codeLens') then vim.api.nvim_create_autocmd({"CursorHold", "CursorHoldI", "InsertLeave"}, { group = lsp_augroup_id, buffer = bufnr, @@ -174,7 +174,7 @@ local on_attach = function(client_id, client, bufnr) }) end - if client.supports_method('textDocument/documentHighlight') then + if client:supports_method('textDocument/documentHighlight') then vim.api.nvim_create_autocmd("CursorHold", { group = lsp_augroup_id, buffer = bufnr, @@ -187,7 +187,7 @@ local on_attach = function(client_id, client, bufnr) }) end - if client.supports_method('textDocument/inlayHint') then + if client:supports_method('textDocument/inlayHint') then vim.lsp.inlay_hint.enable(false) end end @@ -210,7 +210,7 @@ vim.api.nvim_create_autocmd("LspAttach", { for _, mappings in pairs(lsp_key_mappings) do local capability, mode, lhs, rhs = unpack(mappings) - if client.supports_method(capability) then + if client:supports_method(capability) then vim.api.nvim_buf_set_keymap(bufnr, mode, lhs, rhs, opts) end end @@ -236,7 +236,7 @@ vim.api.nvim_create_autocmd("LspDetach", { for _, mappings in pairs(lsp_key_mappings) do local capability, mode, lhs, _ = unpack(mappings) - if client.supports_method(capability) then + if client:supports_method(capability) then vim.api.nvim_buf_del_keymap(bufnr, mode, lhs) end end