File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed
crates/ra_assists/src/handlers Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -865,6 +865,7 @@ fn main() {
865
865
866
866
#[ test]
867
867
fn whole_segment ( ) {
868
+ // Tests that only imports whose last segment matches the identifier get suggested.
868
869
check_assist (
869
870
auto_import,
870
871
r"
@@ -883,6 +884,36 @@ fn main() {
883
884
884
885
struct S;
885
886
impl fmt::Display for S {}
887
+ " ,
888
+ ) ;
889
+ }
890
+
891
+ #[ test]
892
+ fn macro_generated ( ) {
893
+ // Tests that macro-generated items are suggested from external crates.
894
+ check_assist (
895
+ auto_import,
896
+ r"
897
+ //- /lib.rs crate:dep
898
+
899
+ macro_rules! mac {
900
+ () => {
901
+ pub struct Cheese;
902
+ };
903
+ }
904
+
905
+ mac!();
906
+
907
+ //- /main.rs crate:main deps:dep
908
+
909
+ fn main() {
910
+ Cheese<|>;
911
+ }" ,
912
+ r"use dep::Cheese;
913
+
914
+ fn main() {
915
+ Cheese;
916
+ }
886
917
" ,
887
918
) ;
888
919
}
You can’t perform that action at this time.
0 commit comments