Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Rust-analyzer diagnostic paths show `./src/xxx` instead of `src/xxx`, breaking VSCode navigation
I'm experiencing an issue where rust-analyzer reports diagnostic paths in the format ./src/xxx.rs
instead of src/xxx.rs
. This breaks VSCode's Ctrl+Click navigation functionality, as VSCode only recognizes the latter format for file navigation, in my environment.
// src/main.rs
fn error() -> Result<(), ()> {
Err(())
}
fn main() {
error().unwrap();
}
Expected: There's a at src/main.rs:xx
in the stack backtrace
Actual: There's a at ./src/main.rs:xx
in the stack backtrace, which can't be clicked to navigate in VSCode
Cargo.toml
I discovered the rust-analyzer.diagnostics.remapPrefix
setting. But it did not work.
{
"rust-analyzer.diagnostics.remapPrefix": {
"./": ""
}
}
Are there other VSCode settings that might affect diagnostic path formatting? Any insights or alternative solutions would be greatly appreciated!
1 post - 1 participant
🏷️ rust_feed