aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/add_custom_impl.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-05-06 11:51:28 +0100
committerAleksey Kladov <[email protected]>2020-05-06 11:51:28 +0100
commit233f01c9ba555e5d06f336cb0ff64e7a83e4a23a (patch)
tree7922dca3f7c4133e2616257be537428337e479d6 /crates/ra_assists/src/handlers/add_custom_impl.rs
parentede8906844e206f252810d58533538cf1fb326d4 (diff)
Move target to AssistLabel
Target is used for assists sorting, so we need it before we compute the action.
Diffstat (limited to 'crates/ra_assists/src/handlers/add_custom_impl.rs')
-rw-r--r--crates/ra_assists/src/handlers/add_custom_impl.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/ra_assists/src/handlers/add_custom_impl.rs b/crates/ra_assists/src/handlers/add_custom_impl.rs
index b72f7aeac..869d4dc04 100644
--- a/crates/ra_assists/src/handlers/add_custom_impl.rs
+++ b/crates/ra_assists/src/handlers/add_custom_impl.rs
@@ -48,9 +48,8 @@ pub(crate) fn add_custom_impl(ctx: AssistCtx) -> Option<Assist> {
48 let label = 48 let label =
49 format!("Add custom impl '{}' for '{}'", trait_token.text().as_str(), annotated_name); 49 format!("Add custom impl '{}' for '{}'", trait_token.text().as_str(), annotated_name);
50 50
51 ctx.add_assist(AssistId("add_custom_impl"), label, |edit| { 51 let target = attr.syntax().text_range();
52 edit.target(attr.syntax().text_range()); 52 ctx.add_assist(AssistId("add_custom_impl"), label, target, |edit| {
53
54 let new_attr_input = input 53 let new_attr_input = input
55 .syntax() 54 .syntax()
56 .descendants_with_tokens() 55 .descendants_with_tokens()