rust-lang/rust-analyzer

matching_brace function not correct when jumping from open brace to close brace

オープン

#1,942 opened on 2019/10/02

 (8 件のコメント) (0 件のリアクション) (0 人の担当者)Rust (1,726 件のフォーク)batch import
E-has-instructionsE-mediumS-actionablegood first issue

Repository metrics

Stars
 (14,924 個のスター)
PR merge metrics
 (PR metrics pending)

説明

https://github.com/rust-analyzer/rust-analyzer/blob/31f22d85491d9e7eaadf5fd4f9754c83fc0f3ea6/crates/ra_ide_api/src/matching_brace.rs#L41

swap the order of do_check parameters the makes the test case failed

do_check("struct Foo <|>{ a: i32, }", "struct Foo { a: i32, }<|>");

this matching behavior should be symmetrical

https://github.com/rust-analyzer/rust-analyzer/blob/31f22d85491d9e7eaadf5fd4f9754c83fc0f3ea6/crates/ra_ide_api/src/matching_brace.rs#L18-L19

if the matching node is a left brace, we use start(), if the matching node is a right brace, we should use end()

コントリビューターガイド