From 4cb82c334d98d7eb608d076fda95923647d61043 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Tue, 14 Jan 2020 11:49:14 -0500 Subject: More UI friendly labels --- crates/ra_assists/src/assists/raw_string.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_assists/src/assists/raw_string.rs') diff --git a/crates/ra_assists/src/assists/raw_string.rs b/crates/ra_assists/src/assists/raw_string.rs index 93912a470..3583b636a 100644 --- a/crates/ra_assists/src/assists/raw_string.rs +++ b/crates/ra_assists/src/assists/raw_string.rs @@ -25,7 +25,7 @@ use crate::{Assist, AssistCtx, AssistId}; pub(crate) fn make_raw_string(ctx: AssistCtx) -> Option { let token = ctx.find_token_at_offset(STRING).and_then(ast::String::cast)?; let value = token.value()?; - ctx.add_assist(AssistId("make_raw_string"), "make raw string", |edit| { + ctx.add_assist(AssistId("make_raw_string"), "Rewrite as Raw String", |edit| { edit.target(token.syntax().text_range()); let max_hash_streak = count_hashes(&value); let mut hashes = String::with_capacity(max_hash_streak + 1); @@ -54,7 +54,7 @@ pub(crate) fn make_raw_string(ctx: AssistCtx) -> Option) -> Option { let token = ctx.find_token_at_offset(RAW_STRING).and_then(ast::RawString::cast)?; let value = token.value()?; - ctx.add_assist(AssistId("make_usual_string"), "make usual string", |edit| { + ctx.add_assist(AssistId("make_usual_string"), "Rewrite as Regular String", |edit| { edit.target(token.syntax().text_range()); // parse inside string to escape `"` let escaped = value.escape_default().to_string(); @@ -79,7 +79,7 @@ pub(crate) fn make_usual_string(ctx: AssistCtx) -> Option) -> Option { let token = ctx.find_token_at_offset(RAW_STRING)?; - ctx.add_assist(AssistId("add_hash"), "add hash to raw string", |edit| { + ctx.add_assist(AssistId("add_hash"), "Add # to Raw String", |edit| { edit.target(token.text_range()); edit.insert(token.text_range().start() + TextUnit::of_char('r'), "#"); edit.insert(token.text_range().end(), "#"); -- cgit v1.2.3 From e04661e495cde89827d768788f123eafdbd43911 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Tue, 14 Jan 2020 12:32:26 -0500 Subject: Fix casing --- crates/ra_assists/src/assists/raw_string.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_assists/src/assists/raw_string.rs') diff --git a/crates/ra_assists/src/assists/raw_string.rs b/crates/ra_assists/src/assists/raw_string.rs index 3583b636a..e79c51673 100644 --- a/crates/ra_assists/src/assists/raw_string.rs +++ b/crates/ra_assists/src/assists/raw_string.rs @@ -25,7 +25,7 @@ use crate::{Assist, AssistCtx, AssistId}; pub(crate) fn make_raw_string(ctx: AssistCtx) -> Option { let token = ctx.find_token_at_offset(STRING).and_then(ast::String::cast)?; let value = token.value()?; - ctx.add_assist(AssistId("make_raw_string"), "Rewrite as Raw String", |edit| { + ctx.add_assist(AssistId("make_raw_string"), "Rewrite as raw string", |edit| { edit.target(token.syntax().text_range()); let max_hash_streak = count_hashes(&value); let mut hashes = String::with_capacity(max_hash_streak + 1); @@ -54,7 +54,7 @@ pub(crate) fn make_raw_string(ctx: AssistCtx) -> Option) -> Option { let token = ctx.find_token_at_offset(RAW_STRING).and_then(ast::RawString::cast)?; let value = token.value()?; - ctx.add_assist(AssistId("make_usual_string"), "Rewrite as Regular String", |edit| { + ctx.add_assist(AssistId("make_usual_string"), "Rewrite as regular string", |edit| { edit.target(token.syntax().text_range()); // parse inside string to escape `"` let escaped = value.escape_default().to_string(); @@ -79,7 +79,7 @@ pub(crate) fn make_usual_string(ctx: AssistCtx) -> Option) -> Option { let token = ctx.find_token_at_offset(RAW_STRING)?; - ctx.add_assist(AssistId("add_hash"), "Add # to Raw String", |edit| { + ctx.add_assist(AssistId("add_hash"), "Add # to raw string", |edit| { edit.target(token.text_range()); edit.insert(token.text_range().start() + TextUnit::of_char('r'), "#"); edit.insert(token.text_range().end(), "#"); @@ -108,7 +108,7 @@ pub(crate) fn remove_hash(ctx: AssistCtx) -> Option { // no hash to remove return None; } - ctx.add_assist(AssistId("remove_hash"), "remove hash from raw string", |edit| { + ctx.add_assist(AssistId("remove_hash"), "Remove hash from raw string", |edit| { edit.target(token.text_range()); let result = &text[2..text.len() - 1]; let result = if result.starts_with('\"') { -- cgit v1.2.3