rust/crates
bors[bot] 8619058d3d
Merge #10538
10538: fix: matching brace should prefer brace on cursor's right r=Veykril a=codgician

I observed a brace matching issue with the following Rust code:

```rust
let x = (1 + (2 + 3)) * 4;
```

In a situation like `<|>(1 + (2 + 3)) * 4`, the cursor will go to `(1 + (2 + 3)<|>) * 4`, and if user tries to match bracket again it will go like  `(1 + <|>(2 + 3)) * 4` while logically the expected result should be `<|>(1 + (2 + 3)) * 4`. This behavior exists in both line cursor style and block cursor style.

This PR fixes this by letting `matching_brace` prefer the brace to cursor's right when the cursor lies between multiple consecutive braces. It **does NOT** fix #1942 but could be related. Please review.


Co-authored-by: codgician <15964984+codgician@users.noreply.github.com>
2021-10-14 11:50:14 +00:00
..
base_db internal: add integrated test for token censoring 2021-10-10 16:52:21 +03:00
cfg internal: update expect 2021-10-09 17:17:16 +03:00
flycheck
hir Saw a FIXME comment and decided to fix it. 2021-10-12 11:52:31 -04:00
hir_def internal: add integrated test for token censoring 2021-10-10 16:52:21 +03:00
hir_expand Merge #10514 2021-10-10 18:09:13 +00:00
hir_ty internal: update expect 2021-10-09 17:17:16 +03:00
ide Merge #10538 2021-10-14 11:50:14 +00:00
ide_assists Merge #10309 2021-10-14 10:47:11 +00:00
ide_completion Saw a FIXME comment and decided to fix it. 2021-10-12 11:52:31 -04:00
ide_db resolve ControlFlow ourself instead of hard coding. 2021-10-13 21:19:41 +08:00
ide_diagnostics Merge #10504 2021-10-10 07:17:52 +00:00
ide_ssr internal: update expect 2021-10-09 17:17:16 +03:00
limit
mbe internal: clean up code duplication 2021-10-10 21:08:10 +03:00
parser Support let...else 2021-10-07 17:06:24 +02:00
paths
proc_macro_api
proc_macro_srv internal: update expect 2021-10-09 17:17:16 +03:00
proc_macro_test
profile
project_model Merge #10503 2021-10-14 11:42:53 +00:00
rust-analyzer Merge #10503 2021-10-14 11:42:53 +00:00
sourcegen
stdx
syntax Make selections in assists with trailing/leading whitespace more forgiving 2021-10-12 14:41:59 +02:00
test_utils internal: move tests 2021-10-10 12:39:58 +03:00
text_edit
toolchain
tt
vfs Merge #10423 2021-10-12 18:35:03 +00:00
vfs-notify