diff options
-rw-r--r-- | crates/ra_assists/src/assists/add_custom_impl.rs | 5 | ||||
-rw-r--r-- | crates/ra_lsp_server/src/main_loop/handlers.rs | 1 |
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, |