aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/handlers/remove_dbg.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/remove_dbg.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/remove_dbg.rs')
-rw-r--r--crates/ra_assists/src/handlers/remove_dbg.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/remove_dbg.rs b/crates/ra_assists/src/handlers/remove_dbg.rs
index ddfb21a7e..e6e02f2ae 100644
--- a/crates/ra_assists/src/handlers/remove_dbg.rs
+++ b/crates/ra_assists/src/handlers/remove_dbg.rs
@@ -57,8 +57,8 @@ pub(crate) fn remove_dbg(ctx: AssistCtx) -> Option<Assist> {
57 text.slice(without_parens).to_string() 57 text.slice(without_parens).to_string()
58 }; 58 };
59 59
60 ctx.add_assist(AssistId("remove_dbg"), "Remove dbg!()", |edit| { 60 let target = macro_call.syntax().text_range();
61 edit.target(macro_call.syntax().text_range()); 61 ctx.add_assist(AssistId("remove_dbg"), "Remove dbg!()", target, |edit| {
62 edit.replace(macro_range, macro_content); 62 edit.replace(macro_range, macro_content);
63 edit.set_cursor(cursor_pos); 63 edit.set_cursor(cursor_pos);
64 }) 64 })