@@ -182,13 +182,26 @@ fn check_hover_no_markdown(ra_fixture: &str, expect: Expect) {
182
182
183
183
fn check_actions ( ra_fixture : & str , expect : Expect ) {
184
184
let ( analysis, file_id, position) = fixture:: range_or_position ( ra_fixture) ;
185
- let hover = analysis
185
+ let mut hover = analysis
186
186
. hover (
187
187
& HoverConfig { links_in_hover : true , ..HOVER_BASE_CONFIG } ,
188
188
FileRange { file_id, range : position. range_or_empty ( ) } ,
189
189
)
190
190
. unwrap ( )
191
191
. unwrap ( ) ;
192
+ // stub out ranges into minicore as they can change every now and then
193
+ hover. info . actions . iter_mut ( ) . for_each ( |action| match action {
194
+ super :: HoverAction :: GoToType ( act) => act. iter_mut ( ) . for_each ( |data| {
195
+ if data. nav . file_id == file_id {
196
+ return ;
197
+ }
198
+ data. nav . full_range = TextRange :: empty ( span:: TextSize :: new ( !0 ) ) ;
199
+ if let Some ( range) = & mut data. nav . focus_range {
200
+ * range = TextRange :: empty ( span:: TextSize :: new ( !0 ) ) ;
201
+ }
202
+ } ) ,
203
+ _ => ( ) ,
204
+ } ) ;
192
205
expect. assert_debug_eq ( & hover. info . actions )
193
206
}
194
207
@@ -200,10 +213,23 @@ fn check_hover_range(ra_fixture: &str, expect: Expect) {
200
213
201
214
fn check_hover_range_actions ( ra_fixture : & str , expect : Expect ) {
202
215
let ( analysis, range) = fixture:: range ( ra_fixture) ;
203
- let hover = analysis
216
+ let mut hover = analysis
204
217
. hover ( & HoverConfig { links_in_hover : true , ..HOVER_BASE_CONFIG } , range)
205
218
. unwrap ( )
206
219
. unwrap ( ) ;
220
+ // stub out ranges into minicore as they can change every now and then
221
+ hover. info . actions . iter_mut ( ) . for_each ( |action| match action {
222
+ super :: HoverAction :: GoToType ( act) => act. iter_mut ( ) . for_each ( |data| {
223
+ if data. nav . file_id == range. file_id {
224
+ return ;
225
+ }
226
+ data. nav . full_range = TextRange :: empty ( span:: TextSize :: new ( !0 ) ) ;
227
+ if let Some ( range) = & mut data. nav . focus_range {
228
+ * range = TextRange :: empty ( span:: TextSize :: new ( !0 ) ) ;
229
+ }
230
+ } ) ,
231
+ _ => ( ) ,
232
+ } ) ;
207
233
expect. assert_debug_eq ( & hover. info . actions ) ;
208
234
}
209
235
@@ -483,8 +509,13 @@ fn main() {
483
509
file_id: FileId(
484
510
1,
485
511
),
512
+ <<<<<<< HEAD
486
513
full_range: 633..868,
487
514
focus_range: 694..700,
515
+ =======
516
+ full_range: 4294967295..4294967295,
517
+ focus_range: 4294967295..4294967295,
518
+ >>>>>>> 33e4a08d5b (minor: Reduce friction for updating minicore)
488
519
name: "FnOnce",
489
520
kind: Trait,
490
521
container_name: "function",
@@ -3104,26 +3135,26 @@ struct S{ f1: u32 }
3104
3135
fn main() { let s$0t = S{ f1:0 }; }
3105
3136
"# ,
3106
3137
expect ! [ [ r#"
3107
- [
3108
- GoToType(
3109
- [
3110
- HoverGotoTypeData {
3111
- mod_path: "test::S",
3112
- nav: NavigationTarget {
3113
- file_id: FileId(
3114
- 0,
3115
- ),
3116
- full_range: 0..19,
3117
- focus_range: 7..8,
3118
- name: "S",
3119
- kind: Struct,
3120
- description: "struct S",
3121
- },
3138
+ [
3139
+ GoToType(
3140
+ [
3141
+ HoverGotoTypeData {
3142
+ mod_path: "test::S",
3143
+ nav: NavigationTarget {
3144
+ file_id: FileId(
3145
+ 0,
3146
+ ),
3147
+ full_range: 0..19,
3148
+ focus_range: 7..8,
3149
+ name: "S",
3150
+ kind: Struct,
3151
+ description: "struct S",
3122
3152
},
3123
- ],
3124
- ),
3125
- ]
3126
- "# ] ] ,
3153
+ },
3154
+ ],
3155
+ ),
3156
+ ]
3157
+ "# ] ] ,
3127
3158
) ;
3128
3159
}
3129
3160
@@ -3616,8 +3647,8 @@ pub mod future {
3616
3647
file_id: FileId(
3617
3648
1,
3618
3649
),
3619
- full_range: 21..69 ,
3620
- focus_range: 60..66 ,
3650
+ full_range: 4294967295..4294967295 ,
3651
+ focus_range: 4294967295..4294967295 ,
3621
3652
name: "Future",
3622
3653
kind: Trait,
3623
3654
container_name: "future",
@@ -8479,8 +8510,8 @@ impl Iterator for S {
8479
8510
file_id: FileId(
8480
8511
1,
8481
8512
),
8482
- full_range: 7802..8044 ,
8483
- focus_range: 7867..7873 ,
8513
+ full_range: 4294967295..4294967295 ,
8514
+ focus_range: 4294967295..4294967295 ,
8484
8515
name: "Future",
8485
8516
kind: Trait,
8486
8517
container_name: "future",
@@ -8493,8 +8524,8 @@ impl Iterator for S {
8493
8524
file_id: FileId(
8494
8525
1,
8495
8526
),
8496
- full_range: 8674..9173 ,
8497
- focus_range: 8751..8759 ,
8527
+ full_range: 4294967295..4294967295 ,
8528
+ focus_range: 4294967295..4294967295 ,
8498
8529
name: "Iterator",
8499
8530
kind: Trait,
8500
8531
container_name: "iterator",
0 commit comments