.config/nvim/lua/plugins/lsp.lua

Mon, 06 Mar 2023 10:42:32 -0600

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 06 Mar 2023 10:42:32 -0600
changeset 1067
08675f3a85f6
parent 1064
fcfa295076a8
child 1068
537a428597b5
permissions
-rw-r--r--

more default editor switching

return {
  "neovim/nvim-lspconfig",
  { "williamboman/mason.nvim", config = true },
  { "j-hui/fidget.nvim", config = true },

  {
    "williamboman/mason-lspconfig.nvim",
    config = function(plugin, opts)
      require("mason-lspconfig").setup()
      require("mason-lspconfig").setup_handlers({
        function(server)
          require("lspconfig")[server].setup({
            capabilities = require("cmp_nvim_lsp").default_capabilities(),
          })
        end,
        gopls = function()
          require("lspconfig").gopls.setup({
            capabilities = require("cmp_nvim_lsp").default_capabilities(),
            settings = { gopls = { gofumpt = true } },
          })
        end,
        solargraph = function()
          require("lspconfig").solargraph.setup({
            capabilities = require("cmp_nvim_lsp").default_capabilities(),
            init_options = { formatting = false },
          })
        end,
      })
    end,
  },
}

mercurial