File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,33 @@ mod tests {
615615 ) ;
616616 }
617617
618+ #[ test]
619+ fn test_find_all_refs_nested_module ( ) {
620+ let code = r#"
621+ //- /lib.rs
622+ mod foo {
623+ mod bar;
624+ }
625+
626+ fn f<|>() {}
627+
628+ //- /foo/bar.rs
629+ use crate::f;
630+
631+ fn g() {
632+ f();
633+ }
634+ "# ;
635+
636+ let ( analysis, pos) = analysis_and_position ( code) ;
637+ let refs = analysis. find_all_refs ( pos, None ) . unwrap ( ) . unwrap ( ) ;
638+ check_result (
639+ refs,
640+ "f FN_DEF FileId(1) 25..34 28..29 Other" ,
641+ & [ "FileId(2) 11..12 Other" , "FileId(2) 27..28 StructLiteral" ] ,
642+ ) ;
643+ }
644+
618645 fn get_all_refs ( text : & str ) -> ReferenceSearchResult {
619646 let ( analysis, position) = single_file_with_position ( text) ;
620647 analysis. find_all_refs ( position, None ) . unwrap ( ) . unwrap ( )
You can’t perform that action at this time.
0 commit comments