Open iainsmith opened 7 months ago
I cannot replicate this. I'm using this task
overseer.register_template({
name = "quickfix",
builder = function()
return {
cmd = "./quick.sh",
components = {
"default",
{ "on_output_quickfix", open_on_match = true, items_only = true, set_diagnostics = true },
{ "on_result_diagnostics", remove_on_restart = true },
{ "on_result_diagnostics_quickfix", set_empty_results = true },
},
}
end,
})
With this helper script as quick.sh
#!/bin/bash
echo 'lua/overseer/init.lua:22: error: this is an error'
echo 'lua/overseer/init.lua:44: error: this is an error'
# echo "success"
I run the task once, see the quickfix populated, comment/uncomment the quick.sh
script to have it output no errors, then run a new task. The quickfix gets cleared for me.
Can you provide a minimal configuration that reproduces the issue?
Hey @stevearc, I am also facing the same issue with yarn tsc-watch
command.
I am using the following template for the task:
local tsc_errorformat = {
"%E%f:%l:%c: error %m", -- Error: file, line, column, message
"%E%f:%l:%c - error %m", -- Another common error format (seen in newer versions)
"%C%m", -- Continued error messages
"%-G%.%#", -- Ignore any other lines
}
return {
name = "yarn-tsc-watch",
builder = function()
return {
cmd = "yarn",
args = { "tsc-watch" },
cwd = vim.fn.getcwd(),
name = "yarn-tsc-watch",
components = {
{ "on_output_quickfix", set_diagnostics = true, open = false, errorformat = table.concat(tsc_errorformat, ","), open_on_match = true, close = true },
{ "on_result_diagnostics", remove_on_restart = true },
{ "on_result_diagnostics_quickfix", close = true, open = true, set_empty_result = true },
{ "on_result_notify", system = "unfocused" },
"default",
},
}
end,
desc = "Run TypeScript compiler in watch mode (yarn tsc-watch)",
condition = {
callback = function()
return vim.fn.filereadable("package.json") == 1
end,
},
}
Neovim version (nvim -v)
NVIM v0.9.5 Build type: Release LuaJIT 2.1.1703358377
Operating system/version
MacOS 14.4 (23E214)
Describe the bug
👋 thanks for the great plugin!
After running a failing job that correctly sets diagnostics, a second successful job does not clear out the diagnostics. Re running the initial failing job does reset the diagnostics.
IMO, this is surprising and requires scripting to workaround, which could ideally be handled by the components. Maybe this is a bug with
on_result_diagnostics_quickfix.set_empty_results = true
or user error.PS. Apologise for the minimal detail in the bug report, I'll try to follow up with some more screenshots / better reproduction steps.
What is the severity of this bug?
breaking (some functionality is broken)
Steps To Reproduce
Expected Behavior
on_result_diagnostics_quickfix.set_empty_result
should clear out the diagnostics of a previous jobMinimal example file
No response
Minimal init.lua
Additional context
No response