Skip to content

Raw string assists #1730

Closed
Closed
@matklad

Description

@matklad

Add the following assists:

  • make raw string: "hello" -> r#"hello"#
  • add hash: r#"hello"# -> r##"hello"##
  • remove hash: r#"hello"# -> r"hello"
  • make usual string: r"hello" -> "hello"

Note that, ideally, we should apply escape/unescape for the first and last assist, but it's ok to not do it for the first pass.

Example assits are here: https://github.com/rust-analyzer/rust-analyzer/blob/e055cfacdfe3b3451484dae5d6ed08aefba133ca/crates/ra_assists/src/lib.rs

Each familiy lives in a separate mode, which contains the tests as well. See #1281 for an example of PR which adds an assist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions