summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
blob: eb6bb840dba508358ee4d1b555e7e32901c5d3da (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
41
42
43
44
--
-- setup lsp_config
--

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["lua_ls"] = {
	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