How do you display the full error in vim?

I installed rust.vim and syntastic, as adviced on the rust website. I correctly get the errors in the location list. However, there is only the first line of the error, not the full detailed version like what you can get if you manually run cargo check. I was expecting to be able to see it either as a multiline error in the location list, or in a balloon (I didn't found how the error in a balloon even if syntastic advertise that it supports them).

I tested in vim 8.2 and nvim 0.3.8. If it's needed I can rebuild either from source. I'm on fedora 30.

Any help would be welcome.

I don't know if it is possible, but in my workflow I ctrl+z to go back to the terminal if I want to see full errors, and directly run cargo check. I can then use fg to go back into vim.

I was using a not properly configured errorformat + makeprg=cargo, then used :make test to populate the quickfix list (that you can open with :copen). This gave me the list of errors (the full error description, since --message-format is human by default), but since errorformat wasn't rightly configured, I couldn't jump easily from one error to another witch is a huge hit in productivity compare to have the error easily accessible. I was expecting to get the best of both world with rust.vim + systastic, especially since on of the possible--message-format is json-diagnostic-rendered-ansi witch could be used to have colors in the terminal (I'm not 100% confident that vim/neovim would support it).

not sure if it helps, but sometimes an error in a specific line would reference another line.
for example, match arms returning different value, so it will error in the second arm referencing the first.
so in vim, you would see an error mark in both those lines, so the actual error message is split to those 2 lines.
its not great and it doesn't help in many cases.
with neovim lsp and rust analyzer its same partial error message, just inline with the code.

so for me, in most cases, if the single line doesn't help, as others stated, i run in the terminal (i use neovim built in terminal).

What I have currently in the location windows:

dice_system.rs|34 col 5 error| struct is not supported in `trait`s or `impl`s
dice_system.rs|41 col 5 error| associated type in `impl` without body

What I would like

dice_system.rs|34 col 5 error| struct is not supported in `trait`s or `impl`s
|| ../  --> lib/dice_system.rs:34:5
||    |
|| 34 |     struct DiceInformation {
||    |     ^^^^^^^^^^^^^^^^^^^^^^
|| associated type in `impl` without body
dice_system.rs|41 col 5 error| associated type in `impl` without body
|| ../  --> lib/dice_system.rs:41:5
||    |
|| 41 |     type DiceDisplay: Display;
||    |     ^^^^^^^^^^^^^^^^^^^^^^^^^-
||    |                              |
||    |                              help: provide a definition for the type: `= <type>;`

There is two way to provide it, either by using multi line errors (the best option), or just by not filtering out messages that don't look like an error. I am not certain that I can have the color (I'm not sure ANSI sequences are handle within vim), but even the black-and-white version would be better than nothing.

If I need to modify myself the error format, I can do it (I already did it for a custom compiler a few years ago), I just don't know where rust.vim/syntastic set it. I was hopping I could have the long option just through an existing option, but it look like I will have to do the job myself. Do you know witch project (syntastic or rust.vim) I should contact for help?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.