Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 0fd3fa3

Browse files
committed
Scope constructor bodies.
1 parent 957ad16 commit 0fd3fa3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

languages/tree-sitter-stack-graphs-java/src/stack-graphs.tsg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,21 @@ attribute node_symbol = node => symbol = (source-text node), source_n
196196
edge @annotation.defs -> def
197197
}
198198

199+
(constructor_declaration body: (constructor_body) @body) @this {
200+
edge @body.lexical_scope -> @this.lexical_scope
201+
}
202+
203+
(constructor_body) @this {
204+
node @this.lexical_scope
205+
}
206+
207+
(constructor_body . (_) @first) @this {
208+
edge @first.before_scope -> @this.lexical_scope
209+
}
210+
211+
(constructor_body (_) @a . (_) @b) {
212+
edge @b.before_scope -> @a.after_scope
213+
}
199214

200215
(field_declaration
201216
type: (_) @type

0 commit comments

Comments
 (0)