Skip to content

Commit b6691b9

Browse files
committed
fix(lua_ls): don't skip VIMRUNTIME in lua lsp if ~/.config/nvim/.luarc.json exists
.luarc is created by lua-lsp itself (e.g. if you hit "disable diagnostics" in a code action), at which point the lsp will start showing errors that the vim global is undefined after the next restart.
1 parent 00dae9f commit b6691b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/lspconfig/configs/lua_ls.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ require'lspconfig'.lua_ls.setup {
4848
on_init = function(client)
4949
if client.workspace_folders then
5050
local path = client.workspace_folders[1].name
51-
if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then
51+
if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc')) then
5252
return
5353
end
5454
end

0 commit comments

Comments
 (0)