diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-10-27 10:52:35 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2024-10-27 10:52:35 +0100 |
commit | 75a64f1ba990bcd44724dab97c1149ed1a96deb9 (patch) | |
tree | cb5740268d8048ccc824a79c923880b645b291c1 /dotfiles | |
parent | dotfiles: nvim: update settings for nvim 0.10 (diff) | |
download | nixos-config-75a64f1ba990bcd44724dab97c1149ed1a96deb9.tar.gz nixos-config-75a64f1ba990bcd44724dab97c1149ed1a96deb9.tar.bz2 nixos-config-75a64f1ba990bcd44724dab97c1149ed1a96deb9.zip |
dotfiles: nvim: update lsp config with capabilities for local servers
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/nvim/init.lua | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/dotfiles/nvim/init.lua b/dotfiles/nvim/init.lua index ba6243c..03304fa 100644 --- a/dotfiles/nvim/init.lua +++ b/dotfiles/nvim/init.lua @@ -597,9 +597,9 @@ require('lazy').setup({ local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities()) - -- TODO: We should do the capabilities stuff - require("lspconfig").hls.setup({}) - require("lspconfig").gopls.setup({ + local servers = { + hls = {}, + gopls = { settings = { gopls = { ["ui.inlayhint.hints"] = { @@ -612,18 +612,13 @@ require('lazy').setup({ }, }, }, - }) - require("lspconfig").lua_ls.setup({ - settings = { - Lua = { - completion = { - callSnippet = 'Replace', - }, - -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, - }, - }, - }) + }, + } + + for lsp, settings in pairs(servers) do + settings.capabilities = vim.tbl_deep_extend('force', {}, capabilities, settings.capabilities or {}) + require('lspconfig')[lsp].setup(settings) + end -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. @@ -635,6 +630,17 @@ require('lazy').setup({ -- - settings (table): Override the default settings passed when initializing the server. -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local autoinstalled_servers = { + lua_ls = { + settings = { + Lua = { + completion = { + callSnippet = 'Replace', + }, + -- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' } }, + }, + }, + } -- clangd = {}, -- pyright = {}, -- rust_analyzer = {}, |