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

Commit 7fae2ec

Browse files
committed
Variable references are typed.
1 parent 8fae205 commit 7fae2ec

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,13 +289,18 @@ attribute node_symbol = node => symbol = (source-text node), source_n
289289

290290
(primary_expression/identifier) @ident
291291
{
292-
node @ident.value
293-
attr (@ident.value) node_reference = @ident
294-
node @ident.before_scope
295-
node @ident.after_scope
292+
node ref
293+
node ref__typeof
294+
295+
attr (ref) node_reference = @ident
296+
296297
node @ident.lexical_scope
298+
edge ref -> @ident.lexical_scope
299+
300+
edge @ident.type -> ref__typeof
297301

298-
edge @ident.value -> @ident.lexical_scope
302+
attr (ref__typeof) push_symbol = ":"
303+
edge ref__typeof -> ref
299304
}
300305

301306
(field_access) @field_access {

0 commit comments

Comments
 (0)