@@ -54,7 +54,6 @@ pub(crate) fn find_all_refs(
54
54
sema : & Semantics < ' _ , RootDatabase > ,
55
55
position : FilePosition ,
56
56
search_scope : Option < SearchScope > ,
57
- exclude_imports : bool ,
58
57
) -> Option < Vec < ReferenceSearchResult > > {
59
58
let _p = profile:: span ( "find_all_refs" ) ;
60
59
let syntax = sema. parse ( position. file_id ) . syntax ( ) . clone ( ) ;
@@ -80,10 +79,6 @@ pub(crate) fn find_all_refs(
80
79
retain_adt_literal_usages ( & mut usages, def, sema) ;
81
80
}
82
81
83
- if exclude_imports {
84
- filter_import_references ( & mut usages) ;
85
- }
86
-
87
82
let references = usages
88
83
. into_iter ( )
89
84
. map ( |( file_id, refs) | {
@@ -117,17 +112,6 @@ pub(crate) fn find_all_refs(
117
112
}
118
113
}
119
114
120
- fn filter_import_references ( usages : & mut UsageSearchResult ) {
121
- for ( _file_id, refs) in & mut usages. references {
122
- refs. retain ( |it| match it. name . as_name_ref ( ) {
123
- Some ( name_ref) => {
124
- !name_ref. syntax ( ) . ancestors ( ) . any ( |it_ref| matches ! ( it_ref. kind( ) , USE ) )
125
- }
126
- None => true ,
127
- } ) ;
128
- }
129
- }
130
-
131
115
pub ( crate ) fn find_defs < ' a > (
132
116
sema : & ' a Semantics < ' _ , RootDatabase > ,
133
117
syntax : & SyntaxNode ,
@@ -758,7 +742,7 @@ pub struct Foo {
758
742
expect ! [ [ r#"
759
743
foo Module FileId(0) 0..8 4..7
760
744
761
- FileId(0) 14..17
745
+ FileId(0) 14..17 Import
762
746
"# ] ] ,
763
747
) ;
764
748
}
@@ -776,7 +760,7 @@ use self$0;
776
760
expect ! [ [ r#"
777
761
foo Module FileId(0) 0..8 4..7
778
762
779
- FileId(1) 4..8
763
+ FileId(1) 4..8 Import
780
764
"# ] ] ,
781
765
) ;
782
766
}
@@ -791,7 +775,7 @@ use self$0;
791
775
expect ! [ [ r#"
792
776
Module FileId(0) 0..10
793
777
794
- FileId(0) 4..8
778
+ FileId(0) 4..8 Import
795
779
"# ] ] ,
796
780
) ;
797
781
}
@@ -819,7 +803,7 @@ pub(super) struct Foo$0 {
819
803
expect ! [ [ r#"
820
804
Foo Struct FileId(2) 0..41 18..21
821
805
822
- FileId(1) 20..23
806
+ FileId(1) 20..23 Import
823
807
FileId(1) 47..50
824
808
"# ] ] ,
825
809
) ;
@@ -982,7 +966,7 @@ fn g() { f(); }
982
966
expect ! [ [ r#"
983
967
f Function FileId(0) 22..31 25..26
984
968
985
- FileId(1) 11..12
969
+ FileId(1) 11..12 Import
986
970
FileId(1) 24..25
987
971
"# ] ] ,
988
972
) ;
@@ -1110,7 +1094,7 @@ impl Foo {
1110
1094
1111
1095
fn check_with_scope ( ra_fixture : & str , search_scope : Option < SearchScope > , expect : Expect ) {
1112
1096
let ( analysis, pos) = fixture:: position ( ra_fixture) ;
1113
- let refs = analysis. find_all_refs ( pos, search_scope, false ) . unwrap ( ) . unwrap ( ) ;
1097
+ let refs = analysis. find_all_refs ( pos, search_scope) . unwrap ( ) . unwrap ( ) ;
1114
1098
1115
1099
let mut actual = String :: new ( ) ;
1116
1100
for refs in refs {
@@ -1440,9 +1424,9 @@ pub use level1::Foo;
1440
1424
expect ! [ [ r#"
1441
1425
Foo Struct FileId(0) 0..15 11..14
1442
1426
1443
- FileId(1) 16..19
1444
- FileId(2) 16..19
1445
- FileId(3) 16..19
1427
+ FileId(1) 16..19 Import
1428
+ FileId(2) 16..19 Import
1429
+ FileId(3) 16..19 Import
1446
1430
"# ] ] ,
1447
1431
) ;
1448
1432
}
@@ -1470,7 +1454,7 @@ lib::foo!();
1470
1454
expect ! [ [ r#"
1471
1455
foo Macro FileId(1) 0..61 29..32
1472
1456
1473
- FileId(0) 46..49
1457
+ FileId(0) 46..49 Import
1474
1458
FileId(2) 0..3
1475
1459
FileId(3) 5..8
1476
1460
"# ] ] ,
@@ -1633,7 +1617,7 @@ struct Foo;
1633
1617
expect ! [ [ r#"
1634
1618
derive_identity Derive FileId(2) 1..107 45..60
1635
1619
1636
- FileId(0) 17..31
1620
+ FileId(0) 17..31 Import
1637
1621
FileId(0) 56..70
1638
1622
"# ] ] ,
1639
1623
) ;
0 commit comments