diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-24 08:32:07 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-24 08:32:07 +0000 |
commit | 7b6aa7c34e5650506924decfee0a77aa9bb0a480 (patch) | |
tree | 8a8fc896efbf5f12ae55da28a370bdfe9e6ce445 /crates/ra_syntax/src/ast/expr_extensions.rs | |
parent | f2c36e5a6f5892532dec9e6523dc0944453a384f (diff) | |
parent | adac4fc2f21117486356063d82d79f8c3add084a (diff) |
Merge #2343
2343: implement assist invert_if r=matklad a=bravomikekilo
fix [issue 2219 invert if condition](https://github.com/rust-analyzer/rust-analyzer/issues/2219)
I put the assist cursor range to `if` of the if expression, because both condition and body will be replaced. Is there any way to replace them without cover the cursor position?
@matklad
Co-authored-by: bravomikekilo <[email protected]>
Diffstat (limited to 'crates/ra_syntax/src/ast/expr_extensions.rs')
-rw-r--r-- | crates/ra_syntax/src/ast/expr_extensions.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ast/expr_extensions.rs b/crates/ra_syntax/src/ast/expr_extensions.rs index 7c53aa934..2fd039837 100644 --- a/crates/ra_syntax/src/ast/expr_extensions.rs +++ b/crates/ra_syntax/src/ast/expr_extensions.rs | |||
@@ -127,7 +127,7 @@ pub enum BinOp { | |||
127 | } | 127 | } |
128 | 128 | ||
129 | impl ast::BinExpr { | 129 | impl ast::BinExpr { |
130 | fn op_details(&self) -> Option<(SyntaxToken, BinOp)> { | 130 | pub fn op_details(&self) -> Option<(SyntaxToken, BinOp)> { |
131 | self.syntax().children_with_tokens().filter_map(|it| it.into_token()).find_map(|c| { | 131 | self.syntax().children_with_tokens().filter_map(|it| it.into_token()).find_map(|c| { |
132 | let bin_op = match c.kind() { | 132 | let bin_op = match c.kind() { |
133 | T![||] => BinOp::BooleanOr, | 133 | T![||] => BinOp::BooleanOr, |