aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-01-14 14:27:58 +0000
committerGitHub <[email protected]>2020-01-14 14:27:58 +0000
commite406f2bed66cbe13ef6441a3fb84791a3ca09299 (patch)
tree0c983c52ab17aaefdf84682f1a40e383b596163b /crates
parente5cb836448d818275275d73dedbddfdac77abe2e (diff)
parent325912f01ea11ae2e16e01ffaa7ff71329ff1702 (diff)
Merge #2839
2839: Tweak add_custom_impl r=matklad a=kjeremy Display a nicer label and categorize Co-authored-by: Jeremy Kolb <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_assists/src/assists/add_custom_impl.rs5
-rw-r--r--crates/ra_lsp_server/src/main_loop/handlers.rs1
2 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_assists/src/assists/add_custom_impl.rs b/crates/ra_assists/src/assists/add_custom_impl.rs
index 9b8955710..52e8c693d 100644
--- a/crates/ra_assists/src/assists/add_custom_impl.rs
+++ b/crates/ra_assists/src/assists/add_custom_impl.rs
@@ -49,7 +49,10 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist
49 let annotated_name = annotated.syntax().text().to_string(); 49 let annotated_name = annotated.syntax().text().to_string();
50 let start_offset = annotated.syntax().parent()?.text_range().end(); 50 let start_offset = annotated.syntax().parent()?.text_range().end();
51 51
52 ctx.add_assist(AssistId("add_custom_impl"), "add custom impl", |edit| { 52 let label =
53 format!("Add Custom impl '{}' for '{}'", trait_token.text().as_str(), annotated_name);
54
55 ctx.add_assist(AssistId("add_custom_impl"), label, |edit| {
53 edit.target(attr.syntax().text_range()); 56 edit.target(attr.syntax().text_range());
54 57
55 let new_attr_input = input 58 let new_attr_input = input
diff --git a/crates/ra_lsp_server/src/main_loop/handlers.rs b/crates/ra_lsp_server/src/main_loop/handlers.rs
index a592f0a12..d5a8bbe4d 100644
--- a/crates/ra_lsp_server/src/main_loop/handlers.rs
+++ b/crates/ra_lsp_server/src/main_loop/handlers.rs
@@ -710,6 +710,7 @@ pub fn handle_code_action(
710 title: command.title.clone(), 710 title: command.title.clone(),
711 kind: match assist.id { 711 kind: match assist.id {
712 AssistId("introduce_variable") => Some("refactor.extract.variable".to_string()), 712 AssistId("introduce_variable") => Some("refactor.extract.variable".to_string()),
713 AssistId("add_custom_impl") => Some("refactor.rewrite.add_custom_impl".to_string()),
713 _ => None, 714 _ => None,
714 }, 715 },
715 diagnostics: None, 716 diagnostics: None,