From 6d5b774362e9d9b586280c723060813ed7ca8757 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Tue, 21 Jul 2026 08:56:42 -0400 Subject: [PATCH] build(luals): drop src/.luarc.json, test/.luarc.json #40887 Problem: emmylua reports `unresolved-require` for `require('test.testutil')` and friends, and a file under `test/` cannot even resolve its own siblings. This happens because `test/.emmyrc.json` and `test/.luarc.json`, cause vim.lsp to root the workspace at `test/` instead of the repo top-level. Solution: Drop the nested configs: src/.luarc.json test/.luarc.json test/.emmyrc.json Outcomes: - No "libraries" needed: luv types come from `runtime/lua/uv/_meta.lua`, not `${3rd}/luv` (which would only duplicate them). - Drop `test/` from the root `.luarc.json` `ignoreDir` so its modules are resolvable by LuaLS/Emmylua. - Note: this means that LuaLS diagnostics will now be reported for `test/`, but that is not a bad thing... --- .luarc.json | 6 ++++-- src/.luarc.json | 25 ------------------------- test/.emmyrc.json | 25 ------------------------- test/.luarc.json | 24 ------------------------ 4 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 src/.luarc.json delete mode 100644 test/.emmyrc.json delete mode 100644 test/.luarc.json diff --git a/.luarc.json b/.luarc.json index 56d397f28c..9fd1e38a96 100644 --- a/.luarc.json +++ b/.luarc.json @@ -6,8 +6,10 @@ "workspace": { "ignoreDir": [ ".deps", - "build", - "test" + "build" + ], + "ignoreGlobs": [ + "test/**/fixtures/**" ], "preloadFileSize": 1000, "checkThirdParty": "Disable" diff --git a/src/.luarc.json b/src/.luarc.json deleted file mode 100644 index 0ede8b1dba..0000000000 --- a/src/.luarc.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", - "runtime": { - "version": "LuaJIT" - }, - "workspace": { - "library": [ - "../runtime/lua", - "${3rd}/luv/library" - ], - "preloadFileSize": 1000, - "checkThirdParty": "Disable" - }, - "diagnostics": { - "groupFileStatus": { - "strict": "Any", - "strong": "Any" - }, - "groupSeverity": { - "strong": "Warning", - "strict": "Warning" - }, - "unusedLocalExclude": [ "_*" ] - } -} diff --git a/test/.emmyrc.json b/test/.emmyrc.json deleted file mode 100644 index 34d1e0b860..0000000000 --- a/test/.emmyrc.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/heads/main/crates/emmylua_code_analysis/resources/schema.json", - "format": { - "externalTool": { - "program": "stylua", - "args": [ - "-", - "--stdin-filepath", - "${file}" - ] - } - }, - "diagnostics": { - "disable": [ - "unnecessary-if" - ] - }, - "codeAction": { - "insertSpace": true - }, - "strict": { - "typeCall": true, - "arrayIndex": true - } -} diff --git a/test/.luarc.json b/test/.luarc.json deleted file mode 100644 index 343ed38a53..0000000000 --- a/test/.luarc.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json", - "runtime": { - "version": "LuaJIT" - }, - "workspace": { - "library": [ - "../runtime/lua", - "../src" - ], - "checkThirdParty": "Disable" - }, - "diagnostics": { - "groupFileStatus": { - "strict": "Opened", - "strong": "Opened" - }, - "groupSeverity": { - "strong": "Warning", - "strict": "Warning" - }, - "unusedLocalExclude": [ "_*" ] - } -}