Open joshtriplett opened 4 years ago
I think it never worked with Cbuild
, even without terminal (i.e. let g:cargo_shell_command_runner = '!'
). But if we want this for terminals, we would need to hack around execution of runtime compiler/cargo.vim | caddbuffer
in the terminal buffer so that the terminal output is processed into quickfix with the proper errorformat
. Maybe @rhysd got an idea?
An alternative is to use builtin supported :make build
(with rust.vim make
is wrapper for Cargo with quickfix parsing), or Syntastic, or the external ale.
I'd love to have the terminal output processed for errors. On the fly would be nice, for long compiles, but even if I have to wait until the compile completes that would be better than nothing.
I'm aware of :make build
, but that doesn't allow continuing to work while it runs; it also doesn't support color. I greatly prefer :Cbuild
, except for the missing quickfix list.
Populating the quickfix output also keeps the output around after the build, which is useful for reviewing.
Perhaps there's even a wider need in Vim/NeoVim world to populate quickfix from terminal output, as further rationale to the reason terminal buffers exists in the first place. This should be either a plugin library or an editor feature that we could use. It's hard in a sense that it needs to work similarly in Vim and NeoVim, for which terminal API interfaces are different. Anyway, it's not quite simple, I'd need to do some research to find how to come up with this functionality.
@joshtriplett you can use :Make
provided by https://github.com/tpope/vim-dispatch/.
It's a wrapper for :make
that will populate the quickfix list upon completion. It's async so you can keep working while it runs.
Steps to reproduce:
:Cbuild
, and observe the nice error output in the terminal.:cn
to try to go to the next error.Paste debugging info from the Rust Vim plugin via one of the following commands:
:RustInfo
,:RustInfoToClipboard
, or:RustInfoToFile <filename>
.