summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby Bingham <koorogi@koorogi.info>2022-12-25 08:34:24 -0600
committerBobby Bingham <koorogi@koorogi.info>2022-12-25 08:34:24 -0600
commitc392f14ec6e57861e5d25ddfaf51586a4de9ba35 (patch)
tree0b1448591dece3d7df20937c570b7e140514f5d1
parentd08c18568fb80871c4927916fb751aa480248008 (diff)
lsp: update config for API changes
-rw-r--r--nvim/.config/nvim/lua/lsp_config.lua8
1 files changed, 4 insertions, 4 deletions
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', '<space>ca', ':LspCodeAction<cr>')
buf_map(bufnr, 'n', '<space>f', ':LspFormatting<cr>')
- if client.resolved_capabilities.document_formatting then
+ if client.server_capabilities.documentFormattingProvider then
vim.cmd("autocmd BufWritePre <buffer> 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({})