rust-analyzer version: 0.3.1958-standalone (5bf2f85 2024-05-09)
rustc version: 1.78.0 (9b00956e5 2024-04-29)
editor or extension: VSCode
relevant settings: rust-analyzer.imports.prefix
to reproduce:
- Create a new project with the following
src directory
├── lib.rs
├── foo.rs
├── foo
│ ├── bar.rs
and the following files:
// lib.rs
mod foo;
pub fn a() {
}
// foo.rs
mod bar;
pub fn b() {
}
- Through UI or JSON, change the setting
rust-analyzer.imports.prefix to plain (the default).
- In the body of
a(), type b and use auto-import. Observe that foo::b is correctly imported.
- In the body of
b(), type c and use auto-import. Observe that self::bar::c is incorrectly imported; it should be bar::c.