Skip to content

Commit 71c002e

Browse files
It's fookin' raw
1 parent 5d66bfe commit 71c002e

File tree

1 file changed

+48
-48
lines changed

1 file changed

+48
-48
lines changed

crates/ra_assists/src/handlers/replace_qualified_name_with_use.rs

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ mod tests {
152152
fn test_replace_add_use_no_anchor() {
153153
check_assist(
154154
replace_qualified_name_with_use,
155-
"
155+
r"
156156
std::fmt::Debug<|>
157157
",
158-
"
158+
r"
159159
use std::fmt::Debug;
160160
161161
Debug
@@ -166,13 +166,13 @@ Debug
166166
fn test_replace_add_use_no_anchor_with_item_below() {
167167
check_assist(
168168
replace_qualified_name_with_use,
169-
"
169+
r"
170170
std::fmt::Debug<|>
171171
172172
fn main() {
173173
}
174174
",
175-
"
175+
r"
176176
use std::fmt::Debug;
177177
178178
Debug
@@ -187,13 +187,13 @@ fn main() {
187187
fn test_replace_add_use_no_anchor_with_item_above() {
188188
check_assist(
189189
replace_qualified_name_with_use,
190-
"
190+
r"
191191
fn main() {
192192
}
193193
194194
std::fmt::Debug<|>
195195
",
196-
"
196+
r"
197197
use std::fmt::Debug;
198198
199199
fn main() {
@@ -208,10 +208,10 @@ Debug
208208
fn test_replace_add_use_no_anchor_2seg() {
209209
check_assist(
210210
replace_qualified_name_with_use,
211-
"
211+
r"
212212
std::fmt<|>::Debug
213213
",
214-
"
214+
r"
215215
use std::fmt;
216216
217217
fmt::Debug
@@ -223,13 +223,13 @@ fmt::Debug
223223
fn test_replace_add_use() {
224224
check_assist(
225225
replace_qualified_name_with_use,
226-
"
226+
r"
227227
use stdx;
228228
229229
impl std::fmt::Debug<|> for Foo {
230230
}
231231
",
232-
"
232+
r"
233233
use stdx;
234234
use std::fmt::Debug;
235235
@@ -243,11 +243,11 @@ impl Debug for Foo {
243243
fn test_replace_file_use_other_anchor() {
244244
check_assist(
245245
replace_qualified_name_with_use,
246-
"
246+
r"
247247
impl std::fmt::Debug<|> for Foo {
248248
}
249249
",
250-
"
250+
r"
251251
use std::fmt::Debug;
252252
253253
impl Debug for Foo {
@@ -260,11 +260,11 @@ impl Debug for Foo {
260260
fn test_replace_add_use_other_anchor_indent() {
261261
check_assist(
262262
replace_qualified_name_with_use,
263-
"
263+
r"
264264
impl std::fmt::Debug<|> for Foo {
265265
}
266266
",
267-
"
267+
r"
268268
use std::fmt::Debug;
269269
270270
impl Debug for Foo {
@@ -277,13 +277,13 @@ impl Debug for Foo {
277277
fn test_replace_split_different() {
278278
check_assist(
279279
replace_qualified_name_with_use,
280-
"
280+
r"
281281
use std::fmt;
282282
283283
impl std::io<|> for Foo {
284284
}
285285
",
286-
"
286+
r"
287287
use std::{io, fmt};
288288
289289
impl io for Foo {
@@ -296,13 +296,13 @@ impl io for Foo {
296296
fn test_replace_split_self_for_use() {
297297
check_assist(
298298
replace_qualified_name_with_use,
299-
"
299+
r"
300300
use std::fmt;
301301
302302
impl std::fmt::Debug<|> for Foo {
303303
}
304304
",
305-
"
305+
r"
306306
use std::fmt::{self, Debug, };
307307
308308
impl Debug for Foo {
@@ -315,13 +315,13 @@ impl Debug for Foo {
315315
fn test_replace_split_self_for_target() {
316316
check_assist(
317317
replace_qualified_name_with_use,
318-
"
318+
r"
319319
use std::fmt::Debug;
320320
321321
impl std::fmt<|> for Foo {
322322
}
323323
",
324-
"
324+
r"
325325
use std::fmt::{self, Debug};
326326
327327
impl fmt for Foo {
@@ -334,13 +334,13 @@ impl fmt for Foo {
334334
fn test_replace_add_to_nested_self_nested() {
335335
check_assist(
336336
replace_qualified_name_with_use,
337-
"
337+
r"
338338
use std::fmt::{Debug, nested::{Display}};
339339
340340
impl std::fmt::nested<|> for Foo {
341341
}
342342
",
343-
"
343+
r"
344344
use std::fmt::{Debug, nested::{Display, self}};
345345
346346
impl nested for Foo {
@@ -353,13 +353,13 @@ impl nested for Foo {
353353
fn test_replace_add_to_nested_self_already_included() {
354354
check_assist(
355355
replace_qualified_name_with_use,
356-
"
356+
r"
357357
use std::fmt::{Debug, nested::{self, Display}};
358358
359359
impl std::fmt::nested<|> for Foo {
360360
}
361361
",
362-
"
362+
r"
363363
use std::fmt::{Debug, nested::{self, Display}};
364364
365365
impl nested for Foo {
@@ -372,13 +372,13 @@ impl nested for Foo {
372372
fn test_replace_add_to_nested_nested() {
373373
check_assist(
374374
replace_qualified_name_with_use,
375-
"
375+
r"
376376
use std::fmt::{Debug, nested::{Display}};
377377
378378
impl std::fmt::nested::Debug<|> for Foo {
379379
}
380380
",
381-
"
381+
r"
382382
use std::fmt::{Debug, nested::{Display, Debug}};
383383
384384
impl Debug for Foo {
@@ -391,13 +391,13 @@ impl Debug for Foo {
391391
fn test_replace_split_common_target_longer() {
392392
check_assist(
393393
replace_qualified_name_with_use,
394-
"
394+
r"
395395
use std::fmt::Debug;
396396
397397
impl std::fmt::nested::Display<|> for Foo {
398398
}
399399
",
400-
"
400+
r"
401401
use std::fmt::{nested::Display, Debug};
402402
403403
impl Display for Foo {
@@ -410,13 +410,13 @@ impl Display for Foo {
410410
fn test_replace_split_common_use_longer() {
411411
check_assist(
412412
replace_qualified_name_with_use,
413-
"
413+
r"
414414
use std::fmt::nested::Debug;
415415
416416
impl std::fmt::Display<|> for Foo {
417417
}
418418
",
419-
"
419+
r"
420420
use std::fmt::{Display, nested::Debug};
421421
422422
impl Display for Foo {
@@ -429,15 +429,15 @@ impl Display for Foo {
429429
fn test_replace_use_nested_import() {
430430
check_assist(
431431
replace_qualified_name_with_use,
432-
"
432+
r"
433433
use crate::{
434434
ty::{Substs, Ty},
435435
AssocItem,
436436
};
437437
438438
fn foo() { crate::ty::lower<|>::trait_env() }
439439
",
440-
"
440+
r"
441441
use crate::{
442442
ty::{Substs, Ty, lower},
443443
AssocItem,
@@ -452,13 +452,13 @@ fn foo() { lower::trait_env() }
452452
fn test_replace_alias() {
453453
check_assist(
454454
replace_qualified_name_with_use,
455-
"
455+
r"
456456
use std::fmt as foo;
457457
458458
impl foo::Debug<|> for Foo {
459459
}
460460
",
461-
"
461+
r"
462462
use std::fmt as foo;
463463
464464
impl Debug for Foo {
@@ -471,7 +471,7 @@ impl Debug for Foo {
471471
fn test_replace_not_applicable_one_segment() {
472472
check_assist_not_applicable(
473473
replace_qualified_name_with_use,
474-
"
474+
r"
475475
impl foo<|> for Foo {
476476
}
477477
",
@@ -482,7 +482,7 @@ impl foo<|> for Foo {
482482
fn test_replace_not_applicable_in_use() {
483483
check_assist_not_applicable(
484484
replace_qualified_name_with_use,
485-
"
485+
r"
486486
use std::fmt<|>;
487487
",
488488
);
@@ -492,14 +492,14 @@ use std::fmt<|>;
492492
fn test_replace_add_use_no_anchor_in_mod_mod() {
493493
check_assist(
494494
replace_qualified_name_with_use,
495-
"
495+
r"
496496
mod foo {
497497
mod bar {
498498
std::fmt::Debug<|>
499499
}
500500
}
501501
",
502-
"
502+
r"
503503
mod foo {
504504
mod bar {
505505
use std::fmt::Debug;
@@ -515,14 +515,14 @@ mod foo {
515515
fn inserts_imports_after_inner_attributes() {
516516
check_assist(
517517
replace_qualified_name_with_use,
518-
"
518+
r"
519519
#![allow(dead_code)]
520520
521521
fn main() {
522522
std::fmt::Debug<|>
523523
}
524524
",
525-
"
525+
r"
526526
#![allow(dead_code)]
527527
use std::fmt::Debug;
528528
@@ -537,13 +537,13 @@ fn main() {
537537
fn replaces_all_affected_paths() {
538538
check_assist(
539539
replace_qualified_name_with_use,
540-
"
540+
r"
541541
fn main() {
542542
std::fmt::Debug<|>;
543543
let x: std::fmt::Debug = std::fmt::Debug;
544544
}
545545
",
546-
"
546+
r"
547547
use std::fmt::Debug;
548548
549549
fn main() {
@@ -558,7 +558,7 @@ fn main() {
558558
fn replaces_all_affected_paths_mod() {
559559
check_assist(
560560
replace_qualified_name_with_use,
561-
"
561+
r"
562562
mod m {
563563
fn f() {
564564
std::fmt::Debug<|>;
@@ -573,7 +573,7 @@ fn f() {
573573
std::fmt::Debug;
574574
}
575575
",
576-
"
576+
r"
577577
mod m {
578578
use std::fmt::Debug;
579579
@@ -597,7 +597,7 @@ fn f() {
597597
fn does_not_replace_in_submodules() {
598598
check_assist(
599599
replace_qualified_name_with_use,
600-
"
600+
r"
601601
fn main() {
602602
std::fmt::Debug<|>;
603603
}
@@ -608,7 +608,7 @@ mod sub {
608608
}
609609
}
610610
",
611-
"
611+
r"
612612
use std::fmt::Debug;
613613
614614
fn main() {
@@ -628,14 +628,14 @@ mod sub {
628628
fn does_not_replace_in_use() {
629629
check_assist(
630630
replace_qualified_name_with_use,
631-
"
631+
r"
632632
use std::fmt::Display;
633633
634634
fn main() {
635635
std::fmt<|>;
636636
}
637637
",
638-
"
638+
r"
639639
use std::fmt::{self, Display};
640640
641641
fn main() {

0 commit comments

Comments
 (0)