Closed
Description
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() {
}
// bar.rs
pub fn c() {
}
- Through UI or JSON, change the setting
rust-analyzer.imports.prefix
toplain
(the default). - In the body of
a()
, typeb
and use auto-import. Observe thatfoo::b
is correctly imported. - In the body of
b()
, typec
and use auto-import. Observe thatself::bar::c
is incorrectly imported; it should bebar::c
.
Activity