diff options
author | Lukas Wirth <[email protected]> | 2021-05-13 01:17:41 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-05-13 01:53:32 +0100 |
commit | 69e0b10150a3a426e7796841156e788c3866b27c (patch) | |
tree | af927b7eb6389ff98d12235e048cb5ff485fe71c /crates/ide_assists | |
parent | 77f0c92fd8311bccc001ddaf9eb72662d35e9836 (diff) |
Return absolute paths in find_path if crate start is ambiguous
Diffstat (limited to 'crates/ide_assists')
-rw-r--r-- | crates/ide_assists/src/handlers/auto_import.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crates/ide_assists/src/handlers/auto_import.rs b/crates/ide_assists/src/handlers/auto_import.rs index a454a2af3..506cc292c 100644 --- a/crates/ide_assists/src/handlers/auto_import.rs +++ b/crates/ide_assists/src/handlers/auto_import.rs | |||
@@ -969,4 +969,30 @@ mod bar { | |||
969 | "#, | 969 | "#, |
970 | ); | 970 | ); |
971 | } | 971 | } |
972 | |||
973 | #[test] | ||
974 | fn uses_abs_path_with_extern_crate_clash() { | ||
975 | check_assist( | ||
976 | auto_import, | ||
977 | r#" | ||
978 | //- /main.rs crate:main deps:foo | ||
979 | mod foo {} | ||
980 | |||
981 | const _: () = { | ||
982 | Foo$0 | ||
983 | }; | ||
984 | //- /foo.rs crate:foo | ||
985 | pub struct Foo | ||
986 | "#, | ||
987 | r#" | ||
988 | use ::foo::Foo; | ||
989 | |||
990 | mod foo {} | ||
991 | |||
992 | const _: () = { | ||
993 | Foo | ||
994 | }; | ||
995 | "#, | ||
996 | ); | ||
997 | } | ||
972 | } | 998 | } |