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

Commit 02bd28a

Browse files
committed
Look up methods in the receiver.
1 parent 8b6d462 commit 02bd28a

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

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

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,24 @@ attribute node_symbol = node => symbol = (source-text node), source_n
368368
}
369369

370370
(method_invocation
371-
object: (super)
371+
object: (_) @object
372372
name: (identifier) @method_name) @method_invocation {
373+
node member
374+
375+
edge @object.lexical_scope -> @method_invocation.lexical_scope
376+
373377
node expr_ref
374378
attr (expr_ref) node_reference = @method_name
375-
node expr_ref__ns
376-
attr (expr_ref__ns) push_symbol = "%E"
377-
edge @method_name.value -> expr_ref__ns
378-
attr(@method_name.value -> expr_ref__ns) precedence = 1
379-
edge expr_ref__ns -> @method_invocation.lexical_scope
379+
edge expr_ref -> member
380+
381+
attr (member) push_symbol = "."
382+
edge member -> @object.type
383+
384+
node expr_ref__typeof
385+
edge @method_invocation.type -> expr_ref__typeof
386+
387+
attr (expr_ref__typeof) push_symbol = ":"
388+
edge expr_ref__typeof -> expr_ref
380389
}
381390

382391
;; ==========

0 commit comments

Comments
 (0)