mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
8619058d3d
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> |
||
---|---|---|
.. | ||
base_db | ||
cfg | ||
flycheck | ||
hir | ||
hir_def | ||
hir_expand | ||
hir_ty | ||
ide | ||
ide_assists | ||
ide_completion | ||
ide_db | ||
ide_diagnostics | ||
ide_ssr | ||
limit | ||
mbe | ||
parser | ||
paths | ||
proc_macro_api | ||
proc_macro_srv | ||
proc_macro_test | ||
profile | ||
project_model | ||
rust-analyzer | ||
sourcegen | ||
stdx | ||
syntax | ||
test_utils | ||
text_edit | ||
toolchain | ||
tt | ||
vfs | ||
vfs-notify |