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) on_init = function(client)
if client.workspace_folders then if client.workspace_folders then
local path = client.workspace_folders[1].name 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 return
end end
end end
@@ -20,6 +23,10 @@ local lsps = {
client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, {
runtime = { runtime = {
version = "LuaJIT", version = "LuaJIT",
path = {
"lua/?.lua",
"lua/?/init.lua",
},
}, },
workspace = { workspace = {
checkThirdParty = false, checkThirdParty = false,
@@ -31,7 +38,8 @@ local lsps = {
end, end,
settings = { settings = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, codeLens = { enable = true },
hint = { enable = true, semicolin = "Disable" },
telemetry = { enable = false }, telemetry = { enable = false },
}, },
}, },