Fix lsp setting overrides

This commit is contained in:
Kenneth Benzie 2025-08-13 14:28:18 +01:00
parent 0e2dcbc55b
commit 5a265839f9

View File

@ -88,12 +88,17 @@ return {
require('cmp_nvim_lsp').default_capabilities()),
}
local lspconfig_custom_opts = {
clangd = {
cmd = { 'clangd', '--completion-style=detailed' },
},
require('mason').setup()
require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = ensure_installed,
})
lua_ls = {
vim.lsp.config('clangd', {
cmd = { 'clangd', '--completion-style=detailed' },
})
vim.lsp.config('lua_ls', {
settings = {
Lua = {
diagnostics = {
@ -102,28 +107,14 @@ return {
},
},
},
},
})
pyright = {
vim.lsp.config('pyright', {
settings = {
pyright = {
disableOrganizeImports = true,
},
},
},
}
require('mason').setup()
require('mason-lspconfig').setup({
automatic_installation = false,
ensure_installed = ensure_installed,
handlers = {
function(server_name)
local opts = vim.tbl_deep_extend("force",
lspconfig_default_opts, lspconfig_custom_opts[server_name] or {})
require('lspconfig')[server_name].setup(opts)
end,
},
})
local cmp = require('cmp')