aboutsummaryrefslogtreecommitdiffstats
path: root/neovim/.config/nvim/lua/plugins/lsp.lua
blob: 0463ddeb1bed83bab244b3d2611c46423f340fa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
return {
  "mason-org/mason-lspconfig.nvim",
  dependencies = {
    { "mason-org/mason.nvim", opts = {} },
    "neovim/nvim-lspconfig",
    "saghen/blink.cmp",
  },
  opts = {
    ensure_installed = {
      "pyright",
      "lua_ls",
      "bashls",
      "terraformls",
      "yamlls",
      "ts_ls",
      "cssls",
      "html",
    },
    -- default true: auto-calls vim.lsp.enable() for every Mason-installed
    -- server as it finishes installing.
  },
  config = function(_, opts)
    -- Merge blink.cmp's LSP capabilities into every server's default config
    -- (Mason-managed or not) before any server gets enabled.
    vim.lsp.config("*", {
      capabilities = require("blink.cmp").get_lsp_capabilities(),
    })

    require("mason-lspconfig").setup(opts)

    -- clangd ships with Xcode Command Line Tools already, so it's not
    -- Mason-managed — nvim-lspconfig provides its default config, we just
    -- need to turn it on.
    vim.lsp.enable("clangd")
  end,
}