From c392f14ec6e57861e5d25ddfaf51586a4de9ba35 Mon Sep 17 00:00:00 2001 From: Bobby Bingham Date: Sun, 25 Dec 2022 08:34:24 -0600 Subject: lsp: update config for API changes --- nvim/.config/nvim/lua/lsp_config.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nvim/.config') diff --git a/nvim/.config/nvim/lua/lsp_config.lua b/nvim/.config/nvim/lua/lsp_config.lua index 1bfdf2f..555a70a 100644 --- a/nvim/.config/nvim/lua/lsp_config.lua +++ b/nvim/.config/nvim/lua/lsp_config.lua @@ -45,14 +45,14 @@ local on_attach = function(client, bufnr) buf_map(bufnr, 'n', 'ca', ':LspCodeAction') buf_map(bufnr, 'n', 'f', ':LspFormatting') - if client.resolved_capabilities.document_formatting then + if client.server_capabilities.documentFormattingProvider then vim.cmd("autocmd BufWritePre lua vim.lsp.buf.formatting_sync()") end end -- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) +capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches @@ -72,8 +72,8 @@ end lspconfig.tsserver.setup({ on_attach = function(client, bufnr) -- disable tsserver's formatting; we'll use prettier instead - client.resolved_capabilities.document_formatting = false - client.resolved_capabilities.document_range_formatting = false + client.server_capabilities.documentFormattingProvider = false + client.server_capabilities.documentrangeFormattingProvider = false local ts_utils = require("nvim-lsp-ts-utils") ts_utils.setup({}) -- cgit v1.2.3