Set up lua language server for Neovim

main
Hektor Misplon 2025-11-03 23:42:54 +01:00
parent 38e27e7208
commit 7fd1b35186
1 changed files with 32 additions and 1 deletions

View File

@ -32,7 +32,38 @@ local servers = {
},
},
},
lua_ls = {},
lua_ls = {
on_init = function(client)
if client.workspace_folders then
local path = client.workspace_folders[1].name
if
path ~= vim.fn.stdpath("config")
and (vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.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",
path = {
"lua/?.lua",
"lua/?/init.lua",
},
},
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
},
},
})
end,
settings = {
Lua = {},
},
},
-- marksman = {},
nixd = {},
pyright = {},