From 7120876518f0e99e2e9f07b2f41d1a4b287834a6 Mon Sep 17 00:00:00 2001 From: Jimmy Bates Date: Thu, 25 Apr 2024 22:07:41 -0700 Subject: [PATCH] Added some extensions back in as it seems important to have lsp work correctly --- lua/custom/plugins/lsp.lua | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/lua/custom/plugins/lsp.lua b/lua/custom/plugins/lsp.lua index fe98d2c3..726dbf89 100644 --- a/lua/custom/plugins/lsp.lua +++ b/lua/custom/plugins/lsp.lua @@ -147,9 +147,6 @@ return { -- LSP Configuration & Plugins clangd = { cmd = { 'clangd', - '--offset-encoding=utf-16', - '--background-index', - '--style=file -i ~/.config/nvim/.clang-format', }, }, -- gopls = {}, @@ -199,7 +196,34 @@ return { -- LSP Configuration & Plugins -- You can add other tools here that you want Mason to install -- for you, so that they are available from within Neovim. local ensure_installed = vim.tbl_keys(servers or {}) - vim.list_extend(ensure_installed, {}) + vim.list_extend(ensure_installed, { + 'stylua', -- Used to format Lua code + 'cpplint', + 'clangd', + 'clang-format', + 'codelldb', + 'cmake-language-server', + 'ruff', + 'pyright', + 'prettier', + 'autopep8', + 'djlint', + 'typescript-language-server', + 'deno', + }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } + + require('mason-lspconfig').setup { + handlers = { + function(server_name) + local server = servers[server_name] or {} + -- This handles overriding only values explicitly passed + -- by the server configuration above. Useful when disabling + -- certain features of an LSP (for example, turning off formatting for tsserver) + server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}) + require('lspconfig')[server_name].setup(server) + end, + }, + } end, }