From 5a265839f9120437d835e57d0435348155ea3a14 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Wed, 13 Aug 2025 14:28:18 +0100 Subject: [PATCH] Fix lsp setting overrides --- lua/plugins/completions.lua | 53 +++++++++++++++---------------------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/lua/plugins/completions.lua b/lua/plugins/completions.lua index 7f578a3..0ec0be5 100644 --- a/lua/plugins/completions.lua +++ b/lua/plugins/completions.lua @@ -88,41 +88,32 @@ return { require('cmp_nvim_lsp').default_capabilities()), } - local lspconfig_custom_opts = { - clangd = { - cmd = { 'clangd', '--completion-style=detailed' }, - }, - - lua_ls = { - settings = { - Lua = { - diagnostics = { - disable = { 'missing-fields', }, - globals = { 'vim', }, - }, - }, - }, - }, - - 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, + }) + + vim.lsp.config('clangd', { + cmd = { 'clangd', '--completion-style=detailed' }, + }) + + vim.lsp.config('lua_ls', { + settings = { + Lua = { + diagnostics = { + disable = { 'missing-fields', }, + globals = { 'vim', }, + }, + }, + }, + }) + + vim.lsp.config('pyright', { + settings = { + pyright = { + disableOrganizeImports = true, + }, }, })