corrosion: Rust editor doesn't show errors
I have the following rust code in the editor:
fn main() {
let a = "Foo";
println!("Hello, world!" + a);
}
However, trying to run this from the IDE I do get:
Compiling new_rust_project v0.1.0 (/home/jreimann/Development/workspace-rust/new_rust_project)
error: format argument must be a string literal
--> src/main.rs:3:14
|
3 | println!("Hello, world!" + a);
| ^^^^^^^^^^^^^^^^^^^
help: you might be missing a string literal to format with
|
3 | println!("{}", "Hello, world!" + a);
| ^^^^^
error: aborting due to previous error
error: Could not compile `new_rust_project`.
To learn more, run the command again with --verbose.
Also see:

My expectations would be:
- The editor shows the same errors, at least when I save the file, or after it got compiled
- Locations (file + line number) in the log output can be clicked in, to open the file in the IDE
- I see some error markers in the project explorer
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 42 (22 by maintainers)
I just tested this with 2019-06 RC1 and it works now! Thanks!
Now I can see my code is full of issues đ
I was having this same problem. The RLS didnât seem to be working, but it worked when I would start it from the terminal. However, after looking at this comment, I ran
cargo cleanon each of the projects. After that, I started Eclipse from the UI Desktop and when it started up, the RLS worked as usual.Try running
cargo cleanon all of your projects.Yes.
I have noticed a strange behavior When lunched from CLI as @norru suggested:
RLS does not fail, builds everything successfully and starts indexing.
But then I close Eclipse, and run it through macos launchpad it fails again on âfailed to compile dependent crateâ.
My best guess is that there are some environment variable differences, or something that causes difference in behavior.
Ok ⌠now I got something.
The
RUST_LOGvariable didnât trigger any logs. But ⌠it did start eclipse from the command line for doing that, instead of starting it from the file manager.Et voilà ⌠now I got the error in the editor. Re-starting again from the file manager, and I do run into the same issue again. So I definitely can re-produce this now.
Unfortunately the error highlighting works, the IDE stalls with a âtimeoutâ exception towards the language server and fails to âindexâ. But that is another issue for another day.