Skip to content

Commit 24c5602

Browse files
committed
refactor: Reuse code
1 parent 6dce17e commit 24c5602

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

crates/roughly/src/definition.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ pub fn goto(
3535
)));
3636
}
3737

38-
let is_local_scope = std::iter::successors(Some(start), |node| node.parent())
39-
.any(|node| node.kind_id() == kind::FUNCTION_DEFINITION);
38+
let is_local_scope = tree::find_containing_function(start).is_some();
4039

4140
let globals = symbols_map.filter_map(
4241
|path, symbols| {

0 commit comments

Comments
 (0)