diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-06 11:52:57 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-06 11:52:57 +0100 |
commit | 4de3c3eedc1f6576d59e00f0ddde3c70c97be066 (patch) | |
tree | 7922dca3f7c4133e2616257be537428337e479d6 /crates/ra_assists/src/handlers/flip_trait_bound.rs | |
parent | ede8906844e206f252810d58533538cf1fb326d4 (diff) | |
parent | 233f01c9ba555e5d06f336cb0ff64e7a83e4a23a (diff) |
Merge #4341
4341: Move target to AssistLabel r=matklad a=matklad
Target is used for assists sorting, so we need it before we compute
the action.
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_assists/src/handlers/flip_trait_bound.rs')
-rw-r--r-- | crates/ra_assists/src/handlers/flip_trait_bound.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/handlers/flip_trait_bound.rs b/crates/ra_assists/src/handlers/flip_trait_bound.rs index f186da585..6a3b2df67 100644 --- a/crates/ra_assists/src/handlers/flip_trait_bound.rs +++ b/crates/ra_assists/src/handlers/flip_trait_bound.rs | |||
@@ -32,8 +32,8 @@ pub(crate) fn flip_trait_bound(ctx: AssistCtx) -> Option<Assist> { | |||
32 | non_trivia_sibling(plus.clone().into(), Direction::Next)?, | 32 | non_trivia_sibling(plus.clone().into(), Direction::Next)?, |
33 | ); | 33 | ); |
34 | 34 | ||
35 | ctx.add_assist(AssistId("flip_trait_bound"), "Flip trait bounds", |edit| { | 35 | let target = plus.text_range(); |
36 | edit.target(plus.text_range()); | 36 | ctx.add_assist(AssistId("flip_trait_bound"), "Flip trait bounds", target, |edit| { |
37 | edit.replace(before.text_range(), after.to_string()); | 37 | edit.replace(before.text_range(), after.to_string()); |
38 | edit.replace(after.text_range(), before.to_string()); | 38 | edit.replace(after.text_range(), before.to_string()); |
39 | }) | 39 | }) |