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

Commit 9b07e0f

Browse files
committed
Give types lexical scope.
1 parent 31d62ff commit 9b07e0f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ attribute node_symbol = node => symbol = (source-text node), source_n
249249
edge @local_var.after_scope -> @local_var.before_scope
250250
attr (@local_var.after_scope -> @local_var.before_scope) precedence = 1
251251

252+
edge @type.lexical_scope -> @local_var.before_scope
253+
252254
node def__typeof
253255
attr (def__typeof) pop_symbol = ":"
254256

@@ -445,9 +447,16 @@ attribute node_symbol = node => symbol = (source-text node), source_n
445447
(void_type)
446448
] @type
447449
{
450+
node @type.lexical_scope
448451
node @type.type
449452
}
450453

454+
(type_identifier) @this
455+
{
456+
attr (@this.type) node_reference = @this
457+
edge @this.type -> @this.lexical_scope
458+
}
459+
451460
;; ==========
452461
;; Comments
453462
;; ==========

0 commit comments

Comments
 (0)