bug: `$eslint-stylish` triggers error
thenbe opened this issue · comments
Neovim version (nvim -v)
NVIM v0.10.0-dev-4e59422
Operating system/version
NixOS 24.05
Repro
-
Create a
.vscode/tasks.json
with the following task:{ "version": "2.0.0", "tasks": [ { "type": "shell", "command": "pnpm eslint .", "problemMatcher": ["$eslint-stylish"] } ] }
-
Run the task
-
Observe the following error:
Error executing vim.schedule lua callback: ...er.nvim/lua/overseer/template/vscode/problem_matcher.lua:422: attempt to concatenate field 'regexp' (a nil value) stack traceback: ...er.nvim/lua/overseer/template/vscode/problem_matcher.lua:422: in function 'convert_pattern' ...er.nvim/lua/overseer/template/vscode/problem_matcher.lua:568: in function 'get_parser_from_problem_matcher' ...er.nvim/lua/overseer/template/vscode/problem_matcher.lua:532: in function 'get_parser_from_problem_matcher' ...overseer.nvim/lua/overseer/component/on_output_parse.lua:47: in function 'constructor' .../nvim/lazy/overseer.nvim/lua/overseer/component/init.lua:264: in function 'instantiate' .../nvim/lazy/overseer.nvim/lua/overseer/component/init.lua:303: in function 'load' ...ocal/share/nvim/lazy/overseer.nvim/lua/overseer/task.lua:265: in function 'add_components' ...ocal/share/nvim/lazy/overseer.nvim/lua/overseer/task.lua:122: in function 'new_uninitialized' ...ocal/share/nvim/lazy/overseer.nvim/lua/overseer/task.lua:130: in function 'new' .../share/nvim/lazy/overseer.nvim/lua/overseer/commands.lua:297: in function 'callback' ...e/nvim/lazy/overseer.nvim/lua/overseer/template/init.lua:361: in function 'build_task_args' .../share/nvim/lazy/overseer.nvim/lua/overseer/commands.lua:288: in function 'handle_tmpl' .../share/nvim/lazy/overseer.nvim/lua/overseer/commands.lua:329: in function 'cb' ...ocal/share/nvim/lazy/dressing.nvim/lua/dressing/util.lua:203: in function <...ocal/share/nvim/lazy/dressing.nvim/lua/dressing/util.lua:202>
The error occurs here. An error is thrown when attempting to concatenate a non-existent regexp
key. The reason it fails is because pattern
is a table of tables (as opposed to a flat table) when using $eslint-stylish
.
Workaround
$eslint-compact
, on the other hand, works perfectly fine as it is a flat table.
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"command": "pnpm eslint --format compact .",
"problemMatcher": ["$eslint-compact"]
}
]
}
Other
After the error is encountered for the first time, OverseerRun
ceases to work until neovim is restarted. This makes the issue slightly more annoying as eslint defaults to the stylish
formatter.
Versions
- overseer.nvim: 68a2d34
What is the severity of this bug?
tolerable (can work around it)
Hi!
I experienced the same issue when I added a custom vscode problem matcher, with a nested pattern like $eslint-stylish
:
["$pytest-django-pattern"] = {
{
regexp = "^([a-zA-Z0-9\\/_\\-\\.]+):(\\d+): (in .+)$",
kind = "location",
file = 1,
line = 2,
message = 3,
},
{
regexp = "^([^-_=].*)$",
message = 1,
loop = true,
},
},
I made this fix locally: 6bd0b09
And it seems to work for my case, but I'm sure it is covering all the cases. So I just share it in case it can help 🙂
Should be fixed. Thanks for the report!