diff options
Diffstat (limited to 'crates/ide_assists/src/handlers')
-rw-r--r-- | crates/ide_assists/src/handlers/auto_import.rs | 33 |
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#" | ||
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 | } | ||
937 | } | 970 | } |