diff options
author | Aleksey Kladov <[email protected]> | 2019-07-19 09:24:41 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-07-19 11:16:25 +0100 |
commit | 0343c4a815a0e82d5e55e76a01d21b0f7a00ff5b (patch) | |
tree | 126bafdfcbcb04741b87876d6204c449113d96b5 /crates/ra_assists/src/flip_binexpr.rs | |
parent | e2b28f5bb8043e92b10f6a40696131007fc9dfe2 (diff) |
migrate ra_assists to the new AST
Diffstat (limited to 'crates/ra_assists/src/flip_binexpr.rs')
-rw-r--r-- | crates/ra_assists/src/flip_binexpr.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_assists/src/flip_binexpr.rs b/crates/ra_assists/src/flip_binexpr.rs index 5e41f9346..2e591ad3b 100644 --- a/crates/ra_assists/src/flip_binexpr.rs +++ b/crates/ra_assists/src/flip_binexpr.rs | |||
@@ -6,8 +6,8 @@ use crate::{Assist, AssistCtx, AssistId}; | |||
6 | /// Flip binary expression assist. | 6 | /// Flip binary expression assist. |
7 | pub(crate) fn flip_binexpr(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { | 7 | pub(crate) fn flip_binexpr(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assist> { |
8 | let expr = ctx.node_at_offset::<BinExpr>()?; | 8 | let expr = ctx.node_at_offset::<BinExpr>()?; |
9 | let lhs = expr.lhs()?.syntax(); | 9 | let lhs = expr.lhs()?.syntax().clone(); |
10 | let rhs = expr.rhs()?.syntax(); | 10 | let rhs = expr.rhs()?.syntax().clone(); |
11 | let op_range = expr.op_token()?.range(); | 11 | let op_range = expr.op_token()?.range(); |
12 | // The assist should be applied only if the cursor is on the operator | 12 | // The assist should be applied only if the cursor is on the operator |
13 | let cursor_in_range = ctx.frange.range.is_subrange(&op_range); | 13 | let cursor_in_range = ctx.frange.range.is_subrange(&op_range); |