rust-lang / rust-lang/rust-analyzer
Work on whitespace for find_node_at_offset_with_descend
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
AssistContext::find_node_at_offset_with_descend Return None on the whitespace within the macro, as the whitespace does not have descended
macro_rules! m { ($($t:tt)*) => {$($t)*} }
m!(match Some(2) {
None => 3,
$0
});
$0 cannot descend a token on WHITESPACE, unless $0 is on the }
Related #21453
Problem
Avoid descended cases that do not contain the this whitespace, e.g
call find_node_at_offset_with_descend::<ast::WildcardPat>() on $0 _ => 2
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 at AssistContext::find_node_at_offset_with_descend and reproduce the macro example with the offset on whitespace. Trace descended cases to ensure they contain the whitespace being queried; done means whitespace returns None and does not descend into unrelated cases such as WildcardPat.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100