diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-07 12:27:17 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-07 12:27:17 +0000 |
commit | 7967ce85cfc5fc2b1996425b44f2a45d0841c8ff (patch) | |
tree | 4495b9de7ea6c8e9dd9fd347d42517e9dee511fa /crates/assists/src/handlers/replace_qualified_name_with_use.rs | |
parent | c3e9fb183bc287d83b97b776edc87c54d18d1a73 (diff) | |
parent | 72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 (diff) |
Merge #7184
7184: Changes Cursor Marker To $0 r=matklad a=kevaundray
Co-authored-by: Kevaundray Wedderburn <[email protected]>
Diffstat (limited to 'crates/assists/src/handlers/replace_qualified_name_with_use.rs')
-rw-r--r-- | crates/assists/src/handlers/replace_qualified_name_with_use.rs | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/crates/assists/src/handlers/replace_qualified_name_with_use.rs b/crates/assists/src/handlers/replace_qualified_name_with_use.rs index 8193e45a8..f3bc6cf39 100644 --- a/crates/assists/src/handlers/replace_qualified_name_with_use.rs +++ b/crates/assists/src/handlers/replace_qualified_name_with_use.rs | |||
@@ -9,7 +9,7 @@ use crate::{AssistContext, AssistId, AssistKind, Assists}; | |||
9 | // Adds a use statement for a given fully-qualified name. | 9 | // Adds a use statement for a given fully-qualified name. |
10 | // | 10 | // |
11 | // ``` | 11 | // ``` |
12 | // fn process(map: std::collections::<|>HashMap<String, String>) {} | 12 | // fn process(map: std::collections::$0HashMap<String, String>) {} |
13 | // ``` | 13 | // ``` |
14 | // -> | 14 | // -> |
15 | // ``` | 15 | // ``` |
@@ -127,7 +127,7 @@ mod tests { | |||
127 | r"use std::fs; | 127 | r"use std::fs; |
128 | 128 | ||
129 | fn main() { | 129 | fn main() { |
130 | std::f<|>s::Path | 130 | std::f$0s::Path |
131 | }", | 131 | }", |
132 | r"use std::fs; | 132 | r"use std::fs; |
133 | 133 | ||
@@ -142,7 +142,7 @@ fn main() { | |||
142 | check_assist( | 142 | check_assist( |
143 | replace_qualified_name_with_use, | 143 | replace_qualified_name_with_use, |
144 | r" | 144 | r" |
145 | std::fmt::Debug<|> | 145 | std::fmt::Debug$0 |
146 | ", | 146 | ", |
147 | r" | 147 | r" |
148 | use std::fmt::Debug; | 148 | use std::fmt::Debug; |
@@ -156,7 +156,7 @@ Debug | |||
156 | check_assist( | 156 | check_assist( |
157 | replace_qualified_name_with_use, | 157 | replace_qualified_name_with_use, |
158 | r" | 158 | r" |
159 | std::fmt::Debug<|> | 159 | std::fmt::Debug$0 |
160 | 160 | ||
161 | fn main() { | 161 | fn main() { |
162 | } | 162 | } |
@@ -180,7 +180,7 @@ fn main() { | |||
180 | fn main() { | 180 | fn main() { |
181 | } | 181 | } |
182 | 182 | ||
183 | std::fmt::Debug<|> | 183 | std::fmt::Debug$0 |
184 | ", | 184 | ", |
185 | r" | 185 | r" |
186 | use std::fmt::Debug; | 186 | use std::fmt::Debug; |
@@ -198,7 +198,7 @@ Debug | |||
198 | check_assist( | 198 | check_assist( |
199 | replace_qualified_name_with_use, | 199 | replace_qualified_name_with_use, |
200 | r" | 200 | r" |
201 | std::fmt<|>::Debug | 201 | std::fmt$0::Debug |
202 | ", | 202 | ", |
203 | r" | 203 | r" |
204 | use std::fmt; | 204 | use std::fmt; |
@@ -215,7 +215,7 @@ fmt::Debug | |||
215 | r" | 215 | r" |
216 | use stdx; | 216 | use stdx; |
217 | 217 | ||
218 | impl std::fmt::Debug<|> for Foo { | 218 | impl std::fmt::Debug$0 for Foo { |
219 | } | 219 | } |
220 | ", | 220 | ", |
221 | r" | 221 | r" |
@@ -234,7 +234,7 @@ impl Debug for Foo { | |||
234 | check_assist( | 234 | check_assist( |
235 | replace_qualified_name_with_use, | 235 | replace_qualified_name_with_use, |
236 | r" | 236 | r" |
237 | impl std::fmt::Debug<|> for Foo { | 237 | impl std::fmt::Debug$0 for Foo { |
238 | } | 238 | } |
239 | ", | 239 | ", |
240 | r" | 240 | r" |
@@ -251,7 +251,7 @@ impl Debug for Foo { | |||
251 | check_assist( | 251 | check_assist( |
252 | replace_qualified_name_with_use, | 252 | replace_qualified_name_with_use, |
253 | r" | 253 | r" |
254 | impl std::fmt::Debug<|> for Foo { | 254 | impl std::fmt::Debug$0 for Foo { |
255 | } | 255 | } |
256 | ", | 256 | ", |
257 | r" | 257 | r" |
@@ -270,7 +270,7 @@ impl Debug for Foo { | |||
270 | r" | 270 | r" |
271 | use std::fmt; | 271 | use std::fmt; |
272 | 272 | ||
273 | impl std::io<|> for Foo { | 273 | impl std::io$0 for Foo { |
274 | } | 274 | } |
275 | ", | 275 | ", |
276 | r" | 276 | r" |
@@ -289,7 +289,7 @@ impl io for Foo { | |||
289 | r" | 289 | r" |
290 | use std::fmt; | 290 | use std::fmt; |
291 | 291 | ||
292 | impl std::fmt::Debug<|> for Foo { | 292 | impl std::fmt::Debug$0 for Foo { |
293 | } | 293 | } |
294 | ", | 294 | ", |
295 | r" | 295 | r" |
@@ -308,7 +308,7 @@ impl Debug for Foo { | |||
308 | r" | 308 | r" |
309 | use std::fmt::Debug; | 309 | use std::fmt::Debug; |
310 | 310 | ||
311 | impl std::fmt<|> for Foo { | 311 | impl std::fmt$0 for Foo { |
312 | } | 312 | } |
313 | ", | 313 | ", |
314 | r" | 314 | r" |
@@ -327,7 +327,7 @@ impl fmt for Foo { | |||
327 | r" | 327 | r" |
328 | use std::fmt::{Debug, nested::{Display}}; | 328 | use std::fmt::{Debug, nested::{Display}}; |
329 | 329 | ||
330 | impl std::fmt::nested<|> for Foo { | 330 | impl std::fmt::nested$0 for Foo { |
331 | } | 331 | } |
332 | ", | 332 | ", |
333 | r" | 333 | r" |
@@ -346,7 +346,7 @@ impl nested for Foo { | |||
346 | r" | 346 | r" |
347 | use std::fmt::{Debug, nested::{self, Display}}; | 347 | use std::fmt::{Debug, nested::{self, Display}}; |
348 | 348 | ||
349 | impl std::fmt::nested<|> for Foo { | 349 | impl std::fmt::nested$0 for Foo { |
350 | } | 350 | } |
351 | ", | 351 | ", |
352 | r" | 352 | r" |
@@ -365,7 +365,7 @@ impl nested for Foo { | |||
365 | r" | 365 | r" |
366 | use std::fmt::{Debug, nested::{Display}}; | 366 | use std::fmt::{Debug, nested::{Display}}; |
367 | 367 | ||
368 | impl std::fmt::nested::Debug<|> for Foo { | 368 | impl std::fmt::nested::Debug$0 for Foo { |
369 | } | 369 | } |
370 | ", | 370 | ", |
371 | r" | 371 | r" |
@@ -384,7 +384,7 @@ impl Debug for Foo { | |||
384 | r" | 384 | r" |
385 | use std::fmt::Debug; | 385 | use std::fmt::Debug; |
386 | 386 | ||
387 | impl std::fmt::nested::Display<|> for Foo { | 387 | impl std::fmt::nested::Display$0 for Foo { |
388 | } | 388 | } |
389 | ", | 389 | ", |
390 | r" | 390 | r" |
@@ -403,7 +403,7 @@ impl Display for Foo { | |||
403 | r" | 403 | r" |
404 | use std::fmt::nested::Debug; | 404 | use std::fmt::nested::Debug; |
405 | 405 | ||
406 | impl std::fmt::Display<|> for Foo { | 406 | impl std::fmt::Display$0 for Foo { |
407 | } | 407 | } |
408 | ", | 408 | ", |
409 | r" | 409 | r" |
@@ -425,7 +425,7 @@ use crate::{ | |||
425 | AssocItem, | 425 | AssocItem, |
426 | }; | 426 | }; |
427 | 427 | ||
428 | fn foo() { crate::ty::lower<|>::trait_env() } | 428 | fn foo() { crate::ty::lower$0::trait_env() } |
429 | ", | 429 | ", |
430 | r" | 430 | r" |
431 | use crate::{AssocItem, ty::{Substs, Ty, lower}}; | 431 | use crate::{AssocItem, ty::{Substs, Ty, lower}}; |
@@ -442,7 +442,7 @@ fn foo() { lower::trait_env() } | |||
442 | r" | 442 | r" |
443 | use std::fmt as foo; | 443 | use std::fmt as foo; |
444 | 444 | ||
445 | impl foo::Debug<|> for Foo { | 445 | impl foo::Debug$0 for Foo { |
446 | } | 446 | } |
447 | ", | 447 | ", |
448 | r" | 448 | r" |
@@ -462,7 +462,7 @@ impl Debug for Foo { | |||
462 | check_assist_not_applicable( | 462 | check_assist_not_applicable( |
463 | replace_qualified_name_with_use, | 463 | replace_qualified_name_with_use, |
464 | r" | 464 | r" |
465 | impl foo<|> for Foo { | 465 | impl foo$0 for Foo { |
466 | } | 466 | } |
467 | ", | 467 | ", |
468 | ); | 468 | ); |
@@ -473,7 +473,7 @@ impl foo<|> for Foo { | |||
473 | check_assist_not_applicable( | 473 | check_assist_not_applicable( |
474 | replace_qualified_name_with_use, | 474 | replace_qualified_name_with_use, |
475 | r" | 475 | r" |
476 | use std::fmt<|>; | 476 | use std::fmt$0; |
477 | ", | 477 | ", |
478 | ); | 478 | ); |
479 | } | 479 | } |
@@ -485,7 +485,7 @@ use std::fmt<|>; | |||
485 | r" | 485 | r" |
486 | mod foo { | 486 | mod foo { |
487 | mod bar { | 487 | mod bar { |
488 | std::fmt::Debug<|> | 488 | std::fmt::Debug$0 |
489 | } | 489 | } |
490 | } | 490 | } |
491 | ", | 491 | ", |
@@ -509,7 +509,7 @@ mod foo { | |||
509 | #![allow(dead_code)] | 509 | #![allow(dead_code)] |
510 | 510 | ||
511 | fn main() { | 511 | fn main() { |
512 | std::fmt::Debug<|> | 512 | std::fmt::Debug$0 |
513 | } | 513 | } |
514 | ", | 514 | ", |
515 | r" | 515 | r" |
@@ -530,7 +530,7 @@ fn main() { | |||
530 | replace_qualified_name_with_use, | 530 | replace_qualified_name_with_use, |
531 | r" | 531 | r" |
532 | fn main() { | 532 | fn main() { |
533 | std::fmt::Debug<|>; | 533 | std::fmt::Debug$0; |
534 | let x: std::fmt::Debug = std::fmt::Debug; | 534 | let x: std::fmt::Debug = std::fmt::Debug; |
535 | } | 535 | } |
536 | ", | 536 | ", |
@@ -552,7 +552,7 @@ fn main() { | |||
552 | r" | 552 | r" |
553 | mod m { | 553 | mod m { |
554 | fn f() { | 554 | fn f() { |
555 | std::fmt::Debug<|>; | 555 | std::fmt::Debug$0; |
556 | let x: std::fmt::Debug = std::fmt::Debug; | 556 | let x: std::fmt::Debug = std::fmt::Debug; |
557 | } | 557 | } |
558 | fn g() { | 558 | fn g() { |
@@ -590,7 +590,7 @@ fn f() { | |||
590 | replace_qualified_name_with_use, | 590 | replace_qualified_name_with_use, |
591 | r" | 591 | r" |
592 | fn main() { | 592 | fn main() { |
593 | std::fmt::Debug<|>; | 593 | std::fmt::Debug$0; |
594 | } | 594 | } |
595 | 595 | ||
596 | mod sub { | 596 | mod sub { |
@@ -623,7 +623,7 @@ mod sub { | |||
623 | use std::fmt::Display; | 623 | use std::fmt::Display; |
624 | 624 | ||
625 | fn main() { | 625 | fn main() { |
626 | std::fmt<|>; | 626 | std::fmt$0; |
627 | } | 627 | } |
628 | ", | 628 | ", |
629 | r" | 629 | r" |
@@ -643,7 +643,7 @@ fn main() { | |||
643 | r" | 643 | r" |
644 | pub use std::fmt; | 644 | pub use std::fmt; |
645 | 645 | ||
646 | impl std::io<|> for Foo { | 646 | impl std::io$0 for Foo { |
647 | } | 647 | } |
648 | ", | 648 | ", |
649 | r" | 649 | r" |
@@ -663,7 +663,7 @@ impl io for Foo { | |||
663 | r" | 663 | r" |
664 | pub(crate) use std::fmt; | 664 | pub(crate) use std::fmt; |
665 | 665 | ||
666 | impl std::io<|> for Foo { | 666 | impl std::io$0 for Foo { |
667 | } | 667 | } |
668 | ", | 668 | ", |
669 | r" | 669 | r" |