Skip to content

Commit ec05186

Browse files
Add autoimport test with inner items
1 parent 5963097 commit ec05186

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

crates/ide_assists/src/handlers/auto_import.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -934,4 +934,37 @@ fn main() {
934934
",
935935
);
936936
}
937+
938+
#[test]
939+
fn inner_items() {
940+
check_assist(
941+
auto_import,
942+
r#"
943+
mod baz {
944+
pub struct Foo {}
945+
}
946+
947+
mod bar {
948+
fn bar() {
949+
Foo$0;
950+
println!("Hallo");
951+
}
952+
}
953+
"#,
954+
r#"
955+
mod baz {
956+
pub struct Foo {}
957+
}
958+
959+
mod bar {
960+
use crate::baz::Foo;
961+
962+
fn bar() {
963+
Foo;
964+
println!("Hallo");
965+
}
966+
}
967+
"#,
968+
);
969+
}
937970
}

0 commit comments

Comments
 (0)