diff options
Diffstat (limited to 'crates/ra_assists')
-rw-r--r-- | crates/ra_assists/src/assists/add_custom_impl.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/crates/ra_assists/src/assists/add_custom_impl.rs b/crates/ra_assists/src/assists/add_custom_impl.rs index 037306fd6..52e8c693d 100644 --- a/crates/ra_assists/src/assists/add_custom_impl.rs +++ b/crates/ra_assists/src/assists/add_custom_impl.rs | |||
@@ -10,7 +10,7 @@ use ra_syntax::{ | |||
10 | TextRange, TextUnit, | 10 | TextRange, TextUnit, |
11 | }; | 11 | }; |
12 | 12 | ||
13 | const DERIVE_TRAIT: &'static str = "derive"; | 13 | const DERIVE_TRAIT: &str = "derive"; |
14 | 14 | ||
15 | // Assist: add_custom_impl | 15 | // Assist: add_custom_impl |
16 | // | 16 | // |
@@ -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 |