File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed
crates/pgls_treesitter/src/context Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change 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 ) ]
94pub struct Scope {
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments