]> git.lizzy.rs Git - rust.git/commitdiff
Tweak add_custom_impl
authorJeremy Kolb <kjeremy@gmail.com>
Tue, 14 Jan 2020 14:07:28 +0000 (09:07 -0500)
committerJeremy Kolb <kjeremy@gmail.com>
Tue, 14 Jan 2020 14:08:45 +0000 (09:08 -0500)
crates/ra_assists/src/assists/add_custom_impl.rs
crates/ra_lsp_server/src/main_loop/handlers.rs

index 9b89557104a38579806e752352925883719f7bc5..52e8c693d373ccfbe5f97003882abe1fca8fdaf3 100644 (file)
@@ -49,7 +49,10 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx<impl HirDatabase>) -> Option<Assist
     let annotated_name = annotated.syntax().text().to_string();
     let start_offset = annotated.syntax().parent()?.text_range().end();
 
-    ctx.add_assist(AssistId("add_custom_impl"), "add custom impl", |edit| {
+    let label =
+        format!("Add Custom impl '{}' for '{}'", trait_token.text().as_str(), annotated_name);
+
+    ctx.add_assist(AssistId("add_custom_impl"), label, |edit| {
         edit.target(attr.syntax().text_range());
 
         let new_attr_input = input
index a592f0a1266bd15358122a8648ba50c5e3e43494..d5a8bbe4db78fc4baa3ad05afdd044191bc585da 100644 (file)
@@ -710,6 +710,7 @@ pub fn handle_code_action(
             title: command.title.clone(),
             kind: match assist.id {
                 AssistId("introduce_variable") => Some("refactor.extract.variable".to_string()),
+                AssistId("add_custom_impl") => Some("refactor.rewrite.add_custom_impl".to_string()),
                 _ => None,
             },
             diagnostics: None,