diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-24 12:52:44 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-24 12:52:44 +0000 |
commit | 043991662c648d86876be44bc3405ee3a60c37a1 (patch) | |
tree | 45fcbfb58cce8650f67ce4f41e1b5564ef49bfb3 /crates/ra_assists/src/remove_dbg.rs | |
parent | f6f160391db945a0dcc2f73b38926d6919f7c566 (diff) | |
parent | c110e72a115bbec36413bd440812dfe9194c58e2 (diff) |
Merge #889
889: Refactor assits r=matklad a=matklad
* assign unique IDs to assists so that clients could do custom stuff
* specify kinds for assists,
* make introduce_variable a `refactoring.extract` and make it available only when expression is selected
* introduce marks to assists
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/remove_dbg.rs')
-rw-r--r-- | crates/ra_assists/src/remove_dbg.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/remove_dbg.rs b/crates/ra_assists/src/remove_dbg.rs index 2bed270a1..6ea48d909 100644 --- a/crates/ra_assists/src/remove_dbg.rs +++ b/crates/ra_assists/src/remove_dbg.rs | |||
@@ -6,7 +6,7 @@ use ra_syntax::{ | |||
6 | L_PAREN, R_PAREN, L_CURLY, R_CURLY, L_BRACK, R_BRACK, EXCL | 6 | L_PAREN, R_PAREN, L_CURLY, R_CURLY, L_BRACK, R_BRACK, EXCL |
7 | }, | 7 | }, |
8 | }; | 8 | }; |
9 | use crate::{AssistCtx, Assist}; | 9 | use crate::{AssistCtx, Assist, AssistId}; |
10 | 10 | ||
11 | pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 11 | pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
12 | let macro_call = ctx.node_at_offset::<ast::MacroCall>()?; | 12 | let macro_call = ctx.node_at_offset::<ast::MacroCall>()?; |
@@ -46,7 +46,7 @@ pub(crate) fn remove_dbg(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> | |||
46 | macro_args.text().slice(start..end).to_string() | 46 | macro_args.text().slice(start..end).to_string() |
47 | }; | 47 | }; |
48 | 48 | ||
49 | ctx.add_action("remove dbg!()", |edit| { | 49 | ctx.add_action(AssistId("remove_dbg"), "remove dbg!()", |edit| { |
50 | edit.target(macro_call.syntax().range()); | 50 | edit.target(macro_call.syntax().range()); |
51 | edit.replace(macro_range, macro_content); | 51 | edit.replace(macro_range, macro_content); |
52 | edit.set_cursor(cursor_pos); | 52 | edit.set_cursor(cursor_pos); |