rust-lang / rust-lang/rust-analyzer
matching_brace function not correct when jumping from open brace to close brace
Open
Nobody has claimed this yet.
E-has-instructions
E-medium
good first issue
S-actionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
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
if the matching node is a left brace, we use start(), if the matching node is a right brace, we should use end()
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in crates/ra_ide_api/src/matching_brace.rs, especially the matching_brace function and its do_check test helper. Reproduce the supplied struct Foo case with the parameter order swapped, then verify that jumping from an opening brace to its closing brace is symmetrical with the reverse direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100