When I enter a certain lua file, it throws below error
The lua config
lspconfig.lua_ls.setup(
{
on_init = function(client)
local path = client.workspace_folders[1].name
if not vim.loop.fs_stat(path .. "/.luarc.json") and not vim.loop.fs_stat(path .. "/.luarc.jsonc") then
client.config.settings =
vim.tbl_deep_extend(
"force",
client.config.settings.Lua,
{
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT"
},
diagnostics = {
globals = { 'vim' }
},
-- Make the server aware of Neovim runtime files
workspace = {
library = {vim.env.VIMRUNTIME}
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower
-- library = vim.api.nvim_get_runtime_file("", true)
}
}
)
client.notify("workspace/didChangeConfiguration", {settings = client.config.settings})
end
return true
end
}
)
Description
When I enter a certain lua file, it throws below error
The lua config
Neovim version
NVIM v0.10.0-dev-1988+g1ef60ea65 Build type: RelWithDebInfo LuaJIT 2.1.1703358377
Nvim-lspconfig version
No response
Operating system and version
Windows11 23H2
Affected language servers
lua_ls
Steps to reproduce
enter a lua file
Actual behavior
No error was thrown
Expected behavior
No response
Minimal config
LSP log
I don't know where is it