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

Mon, 14 Aug 2023 22:04:03 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 14 Aug 2023 22:04:03 -0400
changeset 1127
a120f1d3d932
parent 1120
8f8a93daa98c
child 1128
30d81fbc6a7b
permissions
-rw-r--r--

tmux: update DBUS_SESSION_BUS_ADDRESS to fix gpg pinentry

return {
  -- mason is nonlazy so my executable tests work
  { "williamboman/mason.nvim", config = true },

  {
    "neovim/nvim-lspconfig",
    event = { "BufReadPre", "BufNewFile" },
    dependencies = {
      { "williamboman/mason-lspconfig.nvim", config = true },
      { "folke/neodev.nvim", config = true },
      { "j-hui/fidget.nvim", config = true, branch = "legacy" },
    },
    config = function(_, _)
      local capabilities = require("cmp_nvim_lsp").default_capabilities()

      require("mason-lspconfig").setup_handlers({
        function(server)
          require("lspconfig")[server].setup({ capabilities = capabilities })
        end,
        gopls = function()
          require("lspconfig").gopls.setup({
            capabilities = capabilities,
            settings = { gopls = { gofumpt = true } },
          })
        end,
        solargraph = function()
          require("lspconfig").solargraph.setup({
            capabilities = capabilities,
            init_options = { formatting = false },
          })
        end,
      })
    end,
  },
}

mercurial