Rust error reporting does not work correctly #4120
Unanswered
vmsh0
asked this question in
Q&A - Ask for help with problems
Replies: 1 comment 4 replies
-
Start by inspecting the output of ALEInfo. It may provide some insights on what is going on. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm using the plugin with the default settings in the latest neovim. It works fine for most languages, but I'm seeing some weird behaviour with Rust.
In short, it looks like ALE is taking error information from two different sources, as sometimes programs report the same errors as I would get when compiling with
cargo build
, and sometimes they report something entirely different. That is usually fixed by doing Ctrl-Z, givingcargo build
manually in the project directory, going back to neovim, and forcing a refresh of ALE with:w
.As a practical example, I'm not writing a small client program for a REST API. I'm working at a proof-of-concept, which consists of a single file. At the top of the file I have
As you can see, ALE reports an error at line 2 (and corresponding errors wherever the
bail
macro is used in the file). However, the program compiles just fine - and right after compiling and refreshing, as mentioned, ALE correctly reports no errors. But then if I change as little as some whitespace somewhere in the file, ALE goes back to reporting the "false" errors.I don't know how ALE works internally, but I can imagine that if there's a fresh compilation result it gets its information for that - thus getting it right after a
cargo build
. But when the source file is newer than the last compile, it does something different - and apparently gets it wrong.Can someone help me figure this out? I really don't know where to look.
Beta Was this translation helpful? Give feedback.
All reactions