clean up lsp config

Wed, 29 Mar 2023 01:07:18 -0500

author
Meredith Howard <mhoward@roomag.org>
date
Wed, 29 Mar 2023 01:07:18 -0500
changeset 1096
8bb51fcd6f2a
parent 1095
226221dc1d6b
child 1097
7df98d33285d

clean up lsp config

.config/nvim/lua/plugins/lsp.lua file | annotate | diff | comparison | revisions
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -6,28 +6,26 @@ return {
     "neovim/nvim-lspconfig",
     event = { "BufReadPre", "BufNewFile" },
     dependencies = {
-      "williamboman/mason-lspconfig.nvim",
-      "folke/neodev.nvim",
+      { "williamboman/mason-lspconfig.nvim", config = true },
+      { "folke/neodev.nvim", config = true },
       { "j-hui/fidget.nvim", config = true },
     },
     config = function(_, _)
-      require("neodev").setup({})
-      require("mason-lspconfig").setup()
+      local capabilities = require("cmp_nvim_lsp").default_capabilities()
+
       require("mason-lspconfig").setup_handlers({
         function(server)
-          require("lspconfig")[server].setup({
-            capabilities = require("cmp_nvim_lsp").default_capabilities(),
-          })
+          require("lspconfig")[server].setup({ capabilities = capabilities })
         end,
         gopls = function()
           require("lspconfig").gopls.setup({
-            capabilities = require("cmp_nvim_lsp").default_capabilities(),
+            capabilities = capabilities,
             settings = { gopls = { gofumpt = true } },
           })
         end,
         solargraph = function()
           require("lspconfig").solargraph.setup({
-            capabilities = require("cmp_nvim_lsp").default_capabilities(),
+            capabilities = capabilities,
             init_options = { formatting = false },
           })
         end,

mercurial