diff options
author | Geobert Quach <[email protected]> | 2019-09-15 18:51:34 +0100 |
---|---|---|
committer | Geobert Quach <[email protected]> | 2019-09-19 22:12:28 +0100 |
commit | b6d55290a1e416e68bb258bb1e19861692476bd2 (patch) | |
tree | 42b7241a3792a586ffffeded74e53924b5fad98d /docs/user/features.md | |
parent | 58dc3b16496cbcce14101605aa1214e263b91c87 (diff) |
feat(assists): raw string <-> usual string manipulation
Fixes #1730
Diffstat (limited to 'docs/user/features.md')
-rw-r--r-- | docs/user/features.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index 1034a5117..93e565315 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -445,6 +445,62 @@ fn foo<T: u32, F: FnOnce(T) -> T>() {} | |||
445 | fn foo<T, F>() where T: u32, F: FnOnce(T) -> T {} | 445 | fn foo<T, F>() where T: u32, F: FnOnce(T) -> T {} |
446 | ``` | 446 | ``` |
447 | 447 | ||
448 | - Make raw string | ||
449 | |||
450 | ```rust | ||
451 | // before: | ||
452 | fn f() { | ||
453 | let s = <|>"abcd"; | ||
454 | } | ||
455 | |||
456 | // after: | ||
457 | fn f() { | ||
458 | let s = <|>r"abcd"; | ||
459 | } | ||
460 | ``` | ||
461 | |||
462 | - Make usual string | ||
463 | |||
464 | ```rust | ||
465 | // before: | ||
466 | fn f() { | ||
467 | let s = <|>r#"abcd"#; | ||
468 | } | ||
469 | |||
470 | // after: | ||
471 | fn f() { | ||
472 | let s = <|>"abcd"; | ||
473 | } | ||
474 | ``` | ||
475 | |||
476 | - Add hash | ||
477 | |||
478 | ```rust | ||
479 | // before: | ||
480 | fn f() { | ||
481 | let s = <|>r"abcd"; | ||
482 | } | ||
483 | |||
484 | // after: | ||
485 | fn f() { | ||
486 | let s = <|>r#"abcd"#; | ||
487 | } | ||
488 | ``` | ||
489 | |||
490 | - Remove hash | ||
491 | |||
492 | ```rust | ||
493 | // before: | ||
494 | fn f() { | ||
495 | let s = <|>r#"abcd"#; | ||
496 | } | ||
497 | |||
498 | // after: | ||
499 | fn f() { | ||
500 | let s = <|>r"abcd"; | ||
501 | } | ||
502 | ``` | ||
503 | |||
448 | ### Magic Completions | 504 | ### Magic Completions |
449 | 505 | ||
450 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ | 506 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ |