-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Printing unparsed test errors in Vim 8 silently fails #1179
Comments
I've noticed this, too, and started work to parse panic output to populate the errors list. I'd appreciate @fatih's input on this. |
Same thing with GoConvey (https://github.com/smartystreets/goconvey). If test succeeds, I think that issue #1324 shows similar scenario. |
There are two problems here:
The first problem is due to the way async jobs work. With regular synchronous Vim it's easy to detect that multiple messages will be displayed (just finish running the function), but with async it's not, so Vim can't show the prompt. This can be fixed with something like this, which captures the messages in the callback:
The quickfix list can be fixed by tweaking |
Behavior
When I run
:GoTest
on a test file that produces a panic instead of formatted output, I expect to see the contents of the panic. Instead I only seevim-go: <current directory>
, highlighted as an error, at the bottom of the screen.I can use
:messages
to open the previously printed unparsed test output, but I don't think that's what's intended here.I think that this behaviour only arises when Vim 8's jobs API is being used.
Steps to reproduce:
:GoTest
vim-go: /Users/mrnugget/code/go/src/test_vim_go
printed at the bottom of the screen.:messages
to see the previously printed errors:--- FAIL: TestCrash (0.00s) panic: runtime error: index out of range [recovered]
Configuration
Investigation
I traced the the problem down to these two lines:
First the messages that couldn't be parsed are printed, then the directory of the currently running job.
Scanning through
go/cmd.vim
we can see that if neither neovim nor Vim 8 is being used, the errors are simply printed, without the directory being printed.I'd prefer that to having to type
:messages
.But them I'm not sure if the observed behaviour is the intended one. I found default error callback that's being used with Vim 8's jobs API that's supposed to print elapsed time, too. And I don't know if I see that.
Here's the simplest-possible-solution-that-would-work for me:
Remove the mentioned
call go#util#EchoError(self.dir)
ingo/job.vim
.Here's my this-is-perfect-solution:
Change EchoError in such a way that all messages are visible and newlines are escaped! Because at the moment they are not and that makes the output not that readable in
:messages
.I could open a PR for the simplest solution, but I'm not really sure what the way forward is here.
Let me know what you think!
The text was updated successfully, but these errors were encountered: