Open stevearc opened 7 months ago
this only happens if using :compiler
and not :compiler!
.
:comp[iler][!] {name} Set options to work with compiler {name}.
Without the "!" options are set for the
current buffer. With "!" global options are
set.
I cannot reproduce this problem. I'm also confused because in your report you have the lines
on_output_quickfix (Set all task output into the quickfix (on complete))
errorformat: %E%f(%l\,%c): %trror %m,%W%f(%l\,%c): %tarning %m,%-G%.%#
which indicates that it's using the dotnet errorformat explicitly. I found something that might cause us to not use the correct errorformat in some cases, but it wouldn't be happening for you since you're passing in the efm explicitly.
I'm really not sure what this could be. I'll need a way to repro this on my computer or a lot more debugging from you (lots of logging of the efm and getqflist
results in the component).
to add context I did the following
:compiler dotnet
dotnet run
in overseer cmd:cope
the resulting quickfix list did not consume / show any errors as the global efm is gcc
what I would like to happen is if local efm is consumed by on_output_quickfix
so quickfixlist can show errors/warnings with location and everything. This uses efm set by neovim/runtime/compiler.
For now I'm using the following workarounds:
:Make
(as above) (uses buffer efm)
compiler!
(set global compiler & efm)
I cannot reproduce this problem. I'm also confused because in your report you have the lines
on_output_quickfix (Set all task output into the quickfix (on complete)) errorformat: %E%f(%l\,%c): %trror %m,%W%f(%l\,%c): %tarning %m,%-G%.%#
which indicates that it's using the dotnet errorformat explicitly. I found something that might cause us to not use the correct errorformat in some cases, but it wouldn't be happening for you since you're passing in the efm explicitly.
I'm really not sure what this could be. I'll need a way to repro this on my computer or a lot more debugging from you (lots of logging of the efm and
getqflist
results in the component).
yup, deliberately set efm using :Make
(copies efm from the local buffer instead of the global efm).
So it uses dotnet efm because I did :compiler dotnet
.
If I did :compiler csc
, it should switch to csc efm
In that case, the change that I just made might fix the issue you were having with the efm not being picked up by tasks.json
just checked, didn't work. still uses global efm (default efm from :comp gcc
) tho efm is explicitly defined in (edit: set on_output_quickfix
errorformat{ "on_output_quickfix", errorformat = vim.o.efm }
in component_aliases)
FAILURE: (vscode) make run current file
dotnet run
display_duration (Display the run duration)
detail_level: 1
00:01
on_output_summarize (Summarize task output in the task list)
max_lines: 4
out: /home/zspher/personal/test/src/c_sharp/src/hello-world/Program.cs(4,54): error CS1525: Invalid expression term ')' [/home/zspher/personal/test/src/c_sharp/src/hello-world/hello-world.csproj]
out:
out: The build failed. Fix the build errors and run again.
on_exit_set_status (Sets final task status based on exit code)
on_complete_notify (vim.notify when task is completed)
on_change: false
statuses: FAILURE, SUCCESS
system: never
on_complete_dispose (After task is completed, dispose it after a timeout)
statuses: SUCCESS, FAILURE, CANCELED
timeout: 300
on_output_quickfix (Set all task output into the quickfix (on complete))
errorformat: %*[^"]"%f"%*\D%l: %m,"%f"%*\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c:,%-GIn file included from %f:%l:%c\,,%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-G%*[ ]from %f:%l:%c,%-G%*[ ]from %f:%l:,%-G%*[ ]from %f:%l\,,%-G%*[ ]from %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,"%f"\, line %l%*\D%c%*[^ ] %m,%D%*\a[%*\d]: Entering directory %*[`']%f',%X%*\a[%*\d]: Leaving directory %*[`']%f',%D%*\a: Entering directory %*[`']%f',%X%*\a: Leaving directory %*[`']%f',%DMaking %*\a in %f,%f|%l| %m
close: false
tail: true
open_on_exit: never
set_diagnostics: false
open_on_match: false
items_only: false
open: false
on_result_diagnostics (If task result contains diagnostics, display them)
on_result_diagnostics_quickfix (If task result contains diagnostics, add them to the quickfix)
set_empty_results: false
close: false
use_loclist: false
open: false
I wouldn't expect it to work if you use { "on_output_quickfix", errorformat = vim.o.efm }
in component_aliases, because it will be resolved whenever config
is imported and never updated. Have you tried without explicitly passing the vim.o.efm
?
have removed errorformat and the problem still persists
Program.cs
for (int i = 0; i < 10; i++)
{
Console.WriteLine("Hello, World!")
}
Tests:
when using :comp dotnet
FAILURE: (vscode) make run current file
dotnet run
display_duration (Display the run duration)
detail_level: 1
00:01
on_output_summarize (Summarize task output in the task list)
max_lines: 4
out: /home/zspher/personal/test/src/c_sharp/src/blank-proj/Program.cs(4,39): error CS1002: ; expected [/home/zspher/personal/test/src/c_sharp/src/blank-proj/blank-proj.csproj]
out:
out: The build failed. Fix the build errors and run again.
on_exit_set_status (Sets final task status based on exit code)
on_complete_notify (vim.notify when task is completed)
system: never
on_change: false
statuses: FAILURE, SUCCESS
on_complete_dispose (After task is completed, dispose it after a timeout)
statuses: SUCCESS, FAILURE, CANCELED
timeout: 300
on_output_quickfix (Set all task output into the quickfix (on complete))
close: false
open: false
open_on_exit: never
set_diagnostics: false
open_on_match: false
tail: true
items_only: false
on_result_diagnostics (If task result contains diagnostics, display them)
on_result_diagnostics_quickfix (If task result contains diagnostics, add them to the quickfix)
set_empty_results: false
open: false
use_loclist: false
close: false
quickfixlist
|| /home/.../blank-proj/Program.cs(4,39): error CS1002: ; expected [/home/.../blank-proj/blank-proj.csproj]
||
|| The build failed. Fix the build errors and run again.
||
|| [Process exited 1]
when using :comp! dotnet
FAILURE: (vscode) make run current file
dotnet run
display_duration (Display the run duration)
detail_level: 1
00:01
on_output_summarize (Summarize task output in the task list)
max_lines: 4
out: /home/zspher/personal/test/src/c_sharp/src/blank-proj/Program.cs(4,39): error CS1002: ; expected [/home/zspher/personal/test/src/c_sharp/src/blank-proj/blank-proj.csproj]
out:
out: The build failed. Fix the build errors and run again.
on_exit_set_status (Sets final task status based on exit code)
on_complete_notify (vim.notify when task is completed)
on_change: false
statuses: FAILURE, SUCCESS
system: never
on_complete_dispose (After task is completed, dispose it after a timeout)
statuses: SUCCESS, FAILURE, CANCELED
timeout: 300
on_output_quickfix (Set all task output into the quickfix (on complete))
open_on_exit: never
close: false
open_on_match: false
items_only: false
tail: true
set_diagnostics: false
open: false
on_result_diagnostics (If task result contains diagnostics, display them)
on_result_diagnostics_quickfix (If task result contains diagnostics, add them to the quickfix)
set_empty_results: false
close: false
open: false
use_loclist: false
quickfixlist
Program.cs|4 col 39 error| CS1002: ; expected [/home/.../blank-proj/blank-proj.csproj]
I can't find anything obviously wrong anymore; this is going to take more investigation. Filing this as a P1 (would like to work on it, but given my current support load probably not any time soon)
:Make
Program.cs
:Make
result uses:compiler dotnet
Normal result
Originally posted by @portus-zephyr in https://github.com/stevearc/overseer.nvim/issues/246#issuecomment-1868433568