nvim: copy lua_ls from kickstart.nvim

This commit is contained in:
He4eT 2026-06-03 12:51:44 +02:00
commit 8f55e5d525

View file

@ -487,7 +487,30 @@ require('lazy').setup({
--[[ cfg_lazy_lsp_servers ]] --[[ cfg_lazy_lsp_servers ]]
local servers = { 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.tbl_extend('force', vim.api.nvim_get_runtime_file('', true), {
'${3rd}/luv/library',
'${3rd}/busted/library',
}),
},
})
end,
},
ts_ls = { ts_ls = {
filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' }, filetypes = { 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'vue' },
init_options = { init_options = {