summaryrefslogtreecommitdiff
path: root/nvim/.config
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/.config')
-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({})