Skip to content

Commit 51e04c5

Browse files
changie
1 parent f0b2965 commit 51e04c5

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

crates/pgls_treesitter/src/context/ancestors.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
use std::{
2-
collections::{HashMap, HashSet},
3-
process::Child,
4-
};
5-
6-
use crate::TreesitterContext;
1+
use std::collections::{HashMap, HashSet};
72

83
#[derive(Debug)]
94
pub struct Scope {

crates/pgls_treesitter/src/context/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ impl<'a> TreesitterContext<'a> {
153153
ctx.gather_tree_context();
154154
ctx.gather_info_from_ts_queries();
155155

156-
println!("{:#?}", ctx);
157156
ctx
158157
}
159158

@@ -296,6 +295,8 @@ impl<'a> TreesitterContext<'a> {
296295
let parent_node_kind = parent_node.kind();
297296
let current_node_kind = current_node.kind();
298297

298+
self.scope_tracker.register(current_node, self.position);
299+
299300
// prevent infinite recursion – this can happen with ERROR nodes
300301
if current_node_kind == parent_node_kind && ["ERROR", "program"].contains(&parent_node_kind)
301302
{
@@ -375,7 +376,6 @@ impl<'a> TreesitterContext<'a> {
375376
return;
376377
}
377378

378-
self.scope_tracker.register(current_node, self.position);
379379
cursor.goto_first_child_for_byte(self.position);
380380
self.gather_context_from_node(cursor, current_node);
381381
}

0 commit comments

Comments
 (0)