new setup
This commit is contained in:
parent
01e80d152e
commit
81aaccd4ae
1 changed files with 16 additions and 12 deletions
24
init.lua
24
init.lua
|
@ -365,26 +365,30 @@ local servers = {
|
|||
|
||||
-- Setup neovim lua configuration
|
||||
require('neodev').setup()
|
||||
--
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
-- Setup mason so it can manage external tooling
|
||||
require('mason').setup()
|
||||
|
||||
-- Ensure the servers above are installed
|
||||
require('mason-lspconfig').setup {
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
||||
mason_lspconfig.setup {
|
||||
ensure_installed = vim.tbl_keys(servers),
|
||||
}
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
for lsp, settings in ipairs(servers) do
|
||||
require('lspconfig')[lsp].setup {
|
||||
on_attach = on_attach,
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
settings = settings,
|
||||
on_attach = on_attach,
|
||||
settings = servers[server_name],
|
||||
}
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
-- Turn on lsp status information
|
||||
require('fidget').setup()
|
||||
|
|
Loading…
Reference in a new issue