Open
Description
rust-analyzer version: rust-analyzer 1.86.0 (05f9846 2025-03-31)
rustc version: rustc 1.86.0 (05f9846f8 2025-03-31)
editor or extension: Helix
repository link (if public, optional): (eg. rust-analyzer)
code snippet to reproduce:
[package]
name = "rust-analyzer-bug"
version = "0.1.0"
edition = "2024"
[dependencies]
svg = "0.18.0"
use svg::node::element::Path;
use svg::node::element::tag::Path;
use svg::parser::Event;
fn main() {
let a = Path;
let mut content = String::new();
for event in svg::open("whatever.svg", &mut content).unwrap() {
match event {
Event::Tag(Path, _, _) => {
println!("This is a path")
}
_ => {}
}
}
}
Hitting hover on the Path
in Event::Tag
returns info about the element::Path
(a struct) and not about tag::Path
(a const &'static str). Doing it on the Path in let a = ...
correctly shows the tag version.
Recording showing the issue
https://asciinema.org/a/Aolx1UaOxaINhDinOvVXwl905
P.S. Obviously it's very bad practice to import multiple things with the same name, but in this case the compiler allows it and the code builds and runs, so we should have correct hover info