From b6d55290a1e416e68bb258bb1e19861692476bd2 Mon Sep 17 00:00:00 2001 From: Geobert Quach Date: Sun, 15 Sep 2019 18:51:34 +0100 Subject: feat(assists): raw string <-> usual string manipulation Fixes #1730 --- docs/user/features.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'docs/user') 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>() {} fn foo() where T: u32, F: FnOnce(T) -> T {} ``` +- Make raw string + +```rust +// before: +fn f() { + let s = <|>"abcd"; +} + +// after: +fn f() { + let s = <|>r"abcd"; +} +``` + +- Make usual string + +```rust +// before: +fn f() { + let s = <|>r#"abcd"#; +} + +// after: +fn f() { + let s = <|>"abcd"; +} +``` + +- Add hash + +```rust +// before: +fn f() { + let s = <|>r"abcd"; +} + +// after: +fn f() { + let s = <|>r#"abcd"#; +} +``` + +- Remove hash + +```rust +// before: +fn f() { + let s = <|>r#"abcd"#; +} + +// after: +fn f() { + let s = <|>r"abcd"; +} +``` + ### Magic Completions In addition to usual reference completion, rust-analyzer provides some ✨magic✨ -- cgit v1.2.3