feat: add lspconfig support, with wrapped lsp's
This commit is contained in:
40
lua/dot013/plugins/lsp.lua
Normal file
40
lua/dot013/plugins/lsp.lua
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user