[nvim] Update lsp config after deprecation of lspconfig module
This commit is contained in:
parent
a11355afc4
commit
e188601053
3 changed files with 17 additions and 19 deletions
|
|
@ -1,6 +1,6 @@
|
|||
local treesitter_configs = require 'nvim-treesitter.configs'
|
||||
local treesitter = require 'nvim-treesitter'
|
||||
|
||||
treesitter_configs.setup {
|
||||
treesitter.setup {
|
||||
ensure_installed = { "lua", "vim" },
|
||||
sync_install = true,
|
||||
auto_install = true,
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
|
||||
local clangd_extensions = require 'clangd_extensions'
|
||||
local cmp = require 'cmp'
|
||||
local lspconfig = require 'lspconfig'
|
||||
|
||||
local keys = require 'keys'
|
||||
|
||||
cmp.setup {
|
||||
|
|
@ -60,7 +58,7 @@ local function on_attach(client, buffer_number)
|
|||
keys.init_lsp_key_mappings(buffer_number)
|
||||
end
|
||||
|
||||
lspconfig.clangd.setup {
|
||||
vim.lsp.config("clangd", {
|
||||
on_attach = function(client, buffer_number)
|
||||
on_attach(client, buffer_number)
|
||||
|
||||
|
|
@ -69,24 +67,24 @@ lspconfig.clangd.setup {
|
|||
clangd_inlay_hints.set_inlay_hints()
|
||||
end,
|
||||
capabilities = cmp_capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.eslint.setup {
|
||||
vim.lsp.config("eslint", {
|
||||
on_attach = on_attach,
|
||||
capabilities = cmp_capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.ts_ls.setup {
|
||||
vim.lsp.config("ts_ls", {
|
||||
on_attach = on_attach,
|
||||
capabilities = cmp_capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.html.setup {
|
||||
vim.lsp.config("html", {
|
||||
on_attach = on_attach,
|
||||
capabilities = cmp_capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.lua_ls.setup {
|
||||
vim.lsp.config("lua_ls", {
|
||||
on_attach = on_attach,
|
||||
capabilities = cmp_capabilities,
|
||||
settings = {
|
||||
|
|
@ -101,14 +99,14 @@ lspconfig.lua_ls.setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.pyright.setup {
|
||||
vim.lsp.config("pyright", {
|
||||
on_attach = on_attach,
|
||||
capabilities = cmp_capabilities,
|
||||
}
|
||||
})
|
||||
|
||||
lspconfig.rust_analyzer.setup {
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
on_attach = function(client, buffer_number)
|
||||
on_attach(client, buffer_number)
|
||||
end,
|
||||
|
|
@ -139,4 +137,4 @@ lspconfig.rust_analyzer.setup {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
-- Treesitter configuration
|
||||
-- Eryn Wells <eryn@erynwells.me>
|
||||
|
||||
local treesitter = require 'nvim-treesitter.configs'
|
||||
local treesitter = require 'nvim-treesitter'
|
||||
|
||||
-- For some reason the Lua linter complains about missing fields here even
|
||||
-- though they're not requried. So, ignore the error.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue