Skip to content

Raw string assists #1730

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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