From 7c284f44fe7b120cf1e5b63d2b0648c3831c4048 Mon Sep 17 00:00:00 2001 From: jyn Date: Thu, 6 Feb 2025 10:06:15 -0500 Subject: docs(lua_ls): don't skip VIMRUNTIME ~/.config/nvim/.luarc.json exists #3603 .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. --- lua/lspconfig/configs/lua_ls.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua/lspconfig/configs/lua_ls.lua') diff --git a/lua/lspconfig/configs/lua_ls.lua b/lua/lspconfig/configs/lua_ls.lua index abdef096..a545b34b 100644 --- a/lua/lspconfig/configs/lua_ls.lua +++ b/lua/lspconfig/configs/lua_ls.lua @@ -48,7 +48,7 @@ require'lspconfig'.lua_ls.setup { on_init = function(client) if client.workspace_folders then local path = client.workspace_folders[1].name - if vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc') then + if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path..'/.luarc.json') or vim.loop.fs_stat(path..'/.luarc.jsonc')) then return end end -- cgit v1.2.3-70-g09d2