summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
blob: 6b13d19114b59e9df83a8ea44904ba308f2f3091 (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
37
38
39
40
local cmp = require("getchoo.lsp.config.cmp")
local sources = require("getchoo.lsp.config.sources")

local M = {}

local on_attach = function(client, bufnr)
  cmp.on_attach(client, bufnr)
end

local all_config = {
  capabilities = cmp.capabilities,
  on_attach = on_attach,
}

local servers = {}
for _, server in ipairs(sources.lsp_servers) do
  servers[server] = all_config
end

servers["sumneko_lua"] = {
  capabilities = cmp.capabilities,
  on_attach = on_attach,
  settings = {
    Lua = {
      runtime = {
        version = "LuaJIT",
      },
      diagnostics = {
        globals = { "vim" },
      },
      workspace = {
        library = vim.api.nvim_get_runtime_file("", true),
      },
    },
  },
}

M.servers = servers

return M