From 690752ccd324c2844205d19edc9db1134bc61393 Mon Sep 17 00:00:00 2001 From: Darylle Villanueva Date: Sun, 4 Sep 2022 19:44:40 +0800 Subject: [PATCH] Fix client.resolved_capabilities is deprecated Full error: [LSP] Accessing client.resolved_capabilities is deprecated, update your plugins or configuration to access client.server_capabilities instead. The new key/value pairs in server_capabilities directly match those defined in the language server protocol. --- lua/user/lsp/handlers.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/user/lsp/handlers.lua b/lua/user/lsp/handlers.lua index fb8b7f8..ac31362 100644 --- a/lua/user/lsp/handlers.lua +++ b/lua/user/lsp/handlers.lua @@ -46,7 +46,7 @@ end local function lsp_highlight_document(client) -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then + if client.server_capabilities.documentHighlight then vim.api.nvim_exec( [[ augroup lsp_document_highlight @@ -86,7 +86,7 @@ end M.on_attach = function(client, bufnr) if client.name == "tsserver" then - client.resolved_capabilities.document_formatting = false + client.server_capabilities.documentFormattingProvider = false end lsp_keymaps(bufnr) lsp_highlight_document(client)