aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_assists
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-19 18:54:34 +0100
committerGitHub <[email protected]>2021-04-19 18:54:34 +0100
commit9cfbb56afac972b317f3a2b314302a7b4cc92edc (patch)
tree450dfa87c6e3a8c9f64b93d583f82b8dcc5df576 /crates/ide_assists
parent0741de87e7697a221b56e9cb458e7c3f81afc9c9 (diff)
parentec051863780bdd4389f72cb279cf4e84f21a2c2d (diff)
Merge #8587
8587: Fix some find_path bugs around inner items r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8519 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ide_assists')
-rw-r--r--crates/ide_assists/src/handlers/auto_import.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/auto_import.rs b/crates/ide_assists/src/handlers/auto_import.rs
index 5ccd7f7a2..49aa70f74 100644
--- a/crates/ide_assists/src/handlers/auto_import.rs
+++ b/crates/ide_assists/src/handlers/auto_import.rs
@@ -934,4 +934,37 @@ fn main() {
934", 934",
935 ); 935 );
936 } 936 }
937
938 #[test]
939 fn inner_items() {
940 check_assist(
941 auto_import,
942 r#"
943mod baz {
944 pub struct Foo {}
945}
946
947mod bar {
948 fn bar() {
949 Foo$0;
950 println!("Hallo");
951 }
952}
953"#,
954 r#"
955mod baz {
956 pub struct Foo {}
957}
958
959mod bar {
960 use crate::baz::Foo;
961
962 fn bar() {
963 Foo;
964 println!("Hallo");
965 }
966}
967"#,
968 );
969 }
937} 970}