summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
diff options
context:
space:
mode:
authorseth <[email protected]>2022-08-24 15:37:06 -0400
committerseth <[email protected]>2022-08-24 15:37:06 -0400
commit8fef927ede6733c20a53c4b0c13d2ab4cb08b604 (patch)
treec5eae97847773355ffd3f2afcc84c7c9c2a5b387 /.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
parentee45c4211d79dfb3b62531cc4f974ac3932e5131 (diff)
refactor lsp config
Diffstat (limited to '.config/nvim/lua/getchoo/lsp/config/lsp_config.lua')
-rw-r--r--.config/nvim/lua/getchoo/lsp/config/lsp_config.lua42
1 files changed, 42 insertions, 0 deletions
diff --git a/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua b/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
new file mode 100644
index 0000000..4bf69e4
--- /dev/null
+++ b/.config/nvim/lua/getchoo/lsp/config/lsp_config.lua
@@ -0,0 +1,42 @@
+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 = {
+ on_attach = on_attach,
+ capabilities = cmp.capabilities,
+}
+
+local servers = {}
+for _, server in ipairs(sources.lsp_servers) do
+ servers[server] = all_config
+end
+
+servers["sumneko_lua"] = {
+ on_attach = on_attach,
+ settings = {
+ Lua = {
+ runtime = {
+ version = "LuaJIT",
+ },
+ diagnostics = {
+ globals = { "vim" },
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true),
+ },
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
+}
+
+M.servers = servers
+
+return M