mirror of
https://github.com/neovim/neovim.git
synced 2026-07-30 17:24:41 +08:00
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...
32 lines
614 B
JSON
32 lines
614 B
JSON
{
|
|
"$schema": "https://raw.githubusercontent.com/LuaLS/vscode-lua/master/setting/schema.json",
|
|
"runtime": {
|
|
"version": "LuaJIT"
|
|
},
|
|
"workspace": {
|
|
"ignoreDir": [
|
|
".deps",
|
|
"build"
|
|
],
|
|
"ignoreGlobs": [
|
|
"test/**/fixtures/**"
|
|
],
|
|
"preloadFileSize": 1000,
|
|
"checkThirdParty": "Disable"
|
|
},
|
|
"diagnostics": {
|
|
"groupFileStatus": {
|
|
"strict": "Opened",
|
|
"strong": "Opened"
|
|
},
|
|
"groupSeverity": {
|
|
"strong": "Warning",
|
|
"strict": "Warning"
|
|
},
|
|
"unusedLocalExclude": [ "_*" ],
|
|
"disable": [
|
|
"luadoc-miss-see-name"
|
|
]
|
|
}
|
|
}
|