mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Pick smaller node ancestors first when descending at offset
This commit is contained in:
parent
538ac599d2
commit
d1e489185f
2 changed files with 18 additions and 5 deletions
|
@ -525,7 +525,7 @@ impl InFile<SyntaxNode> {
|
|||
pub fn ancestors_with_macros(
|
||||
self,
|
||||
db: &dyn db::AstDatabase,
|
||||
) -> impl Iterator<Item = InFile<SyntaxNode>> + '_ {
|
||||
) -> impl Iterator<Item = InFile<SyntaxNode>> + Clone + '_ {
|
||||
iter::successors(Some(self), move |node| match node.value.parent() {
|
||||
Some(parent) => Some(node.with_value(parent)),
|
||||
None => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue