diff options
author | Jeremy Kolb <[email protected]> | 2020-06-28 23:36:05 +0100 |
---|---|---|
committer | kjeremy <[email protected]> | 2020-07-02 22:13:02 +0100 |
commit | b98c16a034620913f3dbc67bd3f48ad2686face7 (patch) | |
tree | 10f90c96791cfd82bb160a1a5c7474ccc17d5b8b /crates/ra_assists/src/handlers/flip_comma.rs | |
parent | 4cb8bf03c588dcf244d25785de3878b6ef3f7958 (diff) |
Categorize assists
Diffstat (limited to 'crates/ra_assists/src/handlers/flip_comma.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/flip_comma.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/crates/ra_assists/src/handlers/flip_comma.rs b/crates/ra_assists/src/handlers/flip_comma.rs index a57a1c463..9971ffa71 100644 --- a/crates/ra_assists/src/handlers/flip_comma.rs +++ b/crates/ra_assists/src/handlers/flip_comma.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use ra_syntax::{algo::non_trivia_sibling, Direction, T}; | 1 | use ra_syntax::{algo::non_trivia_sibling, Direction, T}; |
2 | 2 | ||
3 | use crate::{AssistContext, AssistId, Assists}; | 3 | use crate::{AssistContext, AssistId, AssistKind, Assists}; |
4 | 4 | ||
5 | // Assist: flip_comma | 5 | // Assist: flip_comma |
6 | // | 6 | // |
@@ -28,10 +28,16 @@ pub(crate) fn flip_comma(acc: &mut Assists, ctx: &AssistContext) -> Option<()> { | |||
28 | return None; | 28 | return None; |
29 | } | 29 | } |
30 | 30 | ||
31 | acc.add(AssistId("flip_comma"), "Flip comma", comma.text_range(), |edit| { | 31 | acc.add( |
32 | edit.replace(prev.text_range(), next.to_string()); | 32 | AssistId("flip_comma"), |
33 | edit.replace(next.text_range(), prev.to_string()); | 33 | AssistKind::RefactorRewrite, |
34 | }) | 34 | "Flip comma", |
35 | comma.text_range(), | ||
36 | |edit| { | ||
37 | edit.replace(prev.text_range(), next.to_string()); | ||
38 | edit.replace(next.text_range(), prev.to_string()); | ||
39 | }, | ||
40 | ) | ||
35 | } | 41 | } |
36 | 42 | ||
37 | #[cfg(test)] | 43 | #[cfg(test)] |