feat: add lspconfig support, with wrapped lsp's

This commit is contained in:
Guz
2024-12-05 19:26:15 -03:00
parent 26793ef834
commit 19b1f317b1
2 changed files with 51 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
local lsps = {
["lua_ls"] = {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if vim.loop.fs_stat(path .. "/.luarc.json") or vim.loop.fs_stat(path .. "/.luarc.jsonc") then
return
end
end
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
version = "LuaJIT",
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
})
end,
settings = {
Lua = {
workspace = { checkThirdParty = false },
telemetry = { enable = false },
},
},
},
}
return {
"nvim-lspconfig",
after = function()
local lsp = require("lspconfig")
for k, v in pairs(lsps) do
lsp[k].setup(v)
end
end,
}