skywind3000 / asyncrun.vim

:rocket: Run Async Shell Commands in Vim 8.0 / NeoVim and Output to the Quickfix Window !!
https://www.vim.org/scripts/script.php?script_id=5431
MIT License
1.86k stars 111 forks source link

How to make asyncrun use Elixir `exunit` compiler to display failures like in Dispatch? #31

Open jmgarnier opened 7 years ago

jmgarnier commented 7 years ago

First, I wanted to say thank you for work. I have the feeling asyncrun will be a plugin I will use a lot. Kudos for neovim support 😄 .

I have read your FAQ about how to process the content in quickfix but I am not sure how to tell asyncrun to use the exunit compiler.

Screenshot: image

See https://github.com/elixir-lang/vim-elixir/issues/76 explains how it was fixed with vim-test + Dispatch.

a screenshot with Dispatch: image

I am also wondering how Tim Pope does to have some syntax highlighting in color here but that's for another issue

skywind3000 commented 7 years ago

Multi-line error output is just broken in vim, I agree that.

Not familiar with elixir, so it takes me time to understand what the problem is . After comparing two screenshots, it seems that exunit is using the local value of errorformat, instead of global value.

asyncrun uses caddexpr to populate the quickfix list. caddexpr only works with global value of errorformat, but exunit may set the local value of errorformat instead of global value.

why can't caddexpr use local errorformat value ? see https://github.com/vim/vim/issues/569

currently, there is nothing I can do to fix the behavior of caddexpr , but you can change your global errorformat settings by:

:set &g:errorformat = &l:errorformat

Rust/Cargo also get the same problem, which has been disucssed and solved here: https://github.com/skywind3000/asyncrun.vim/issues/16

skywind3000 commented 7 years ago

You can see the syntax highlight if the error output of exunit is correctly matched by errorformat in quickfix window:

![asyncrun-highlight]asyncrun-highlight

See line 4-6 in quickfix window

btw, Cargo + Rustc can change the output format from multi-line mode to single line mode (just like gcc), which is more friendly to vim.