lua optimization

main
Mathias Rothenhaeusler 2025-11-22 11:36:05 +01:00
parent 1cb0dab7ff
commit 04e5478570
1 changed files with 13 additions and 11 deletions

View File

@ -120,11 +120,10 @@ setup_server("rust_analyzer", {
["rust-analyzer"] = { checkOnSave = true },
},
})
setup_server("lua_ls", { filetypes = { "lua" } })
-- setup_server("slint_lsp", { filetypes = { "slint" } })
-- PHP LSPs
local util = require("lspconfig.util")
local util = vim.lsp.util
root_dir = function(fname)
return util.root_pattern("composer.json", ".git")(fname)
or util.path.dirname(fname)
@ -139,6 +138,17 @@ setup_server("phpactor", {
},
})
vim.lsp.config("lua_ls", {
filetypes = { "lua" },
root_dir = util.root_pattern(".git", ".lua_ls.json", "lua"),
settings = {
Lua = {
diagnostics = {
globals = { "vim" } }
}
}
})
setup_server("intelephense", {
filetypes = { "php" },
root_dir = fallback_root_dir,
@ -177,14 +187,6 @@ elseif vim.loop.fs_stat(phpcs_config) then
vim.g.nvim_phpcs_config_phpcs_standard = phpcs_config
end
vim.lsp.config("lua_ls", {
settings = {
Lua = {
diagnostics = {
globals = { "vim" } }
}
}
})
-- === ENABLE: tell Neovim to autostart these configs lazily (filetype + root_dir)
-- call this early in your init (so FileType autocommands are installed before opening files)
local enabled_servers = {