aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_assists/src/flip_binexpr.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
committerAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
commitf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch)
treef2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_assists/src/flip_binexpr.rs
parent6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff)
rename range -> text_range
Diffstat (limited to 'crates/ra_assists/src/flip_binexpr.rs')
-rw-r--r--crates/ra_assists/src/flip_binexpr.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_assists/src/flip_binexpr.rs b/crates/ra_assists/src/flip_binexpr.rs
index 2e591ad3b..b55b36a8e 100644
--- a/crates/ra_assists/src/flip_binexpr.rs
+++ b/crates/ra_assists/src/flip_binexpr.rs
@@ -8,7 +8,7 @@ pub(crate) fn flip_binexpr(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis
8 let expr = ctx.node_at_offset::<BinExpr>()?; 8 let expr = ctx.node_at_offset::<BinExpr>()?;
9 let lhs = expr.lhs()?.syntax().clone(); 9 let lhs = expr.lhs()?.syntax().clone();
10 let rhs = expr.rhs()?.syntax().clone(); 10 let rhs = expr.rhs()?.syntax().clone();
11 let op_range = expr.op_token()?.range(); 11 let op_range = expr.op_token()?.text_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);
14 if !cursor_in_range { 14 if !cursor_in_range {
@@ -25,8 +25,8 @@ pub(crate) fn flip_binexpr(mut ctx: AssistCtx<impl HirDatabase>) -> Option<Assis
25 if let FlipAction::FlipAndReplaceOp(new_op) = action { 25 if let FlipAction::FlipAndReplaceOp(new_op) = action {
26 edit.replace(op_range, new_op); 26 edit.replace(op_range, new_op);
27 } 27 }
28 edit.replace(lhs.range(), rhs.text()); 28 edit.replace(lhs.text_range(), rhs.text());
29 edit.replace(rhs.range(), lhs.text()); 29 edit.replace(rhs.text_range(), lhs.text());
30 }); 30 });
31 31
32 ctx.build() 32 ctx.build()