feat(lsp): setup lua_ls for neovim

This commit is contained in:
Guz
2025-12-08 21:36:09 -03:00
parent abf916554e
commit 21646b69b3

View File

@@ -12,7 +12,10 @@ local lsps = {
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
if
path ~= vim.fn.stdpath("config") and vim.loop.fs_stat(path .. "/.luarc.json")
or vim.loop.fs_stat(path .. "/.luarc.jsonc")
then
return
end
end
@@ -20,6 +23,10 @@ local lsps = {
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = {
version = "LuaJIT",
path = {
"lua/?.lua",
"lua/?/init.lua",
},
},
workspace = {
checkThirdParty = false,
@@ -31,7 +38,8 @@ local lsps = {
end,
settings = {
Lua = {
workspace = { checkThirdParty = false },
codeLens = { enable = true },
hint = { enable = true, semicolin = "Disable" },
telemetry = { enable = false },
},
},