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

Commit b3edb51

Browse files
committed
Update interface rules and test
1 parent 16bc806 commit b3edb51

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,11 @@ attribute node_symbol = node => symbol = (source-text node), source_n
360360
(interface_declaration
361361
type_parameters: (type_parameters
362362
(type_parameter
363-
(type_identifier) @type_identifier))) @this {
363+
(type_identifier) @type_identifier))
364+
body:(_) @body) @this {
364365
node type_ident
365366
attr (type_ident) node_definition = @type_identifier
366-
edge @this.defs -> type_ident
367+
edge @body.lexical_scope -> type_ident
367368
}
368369

369370
(interface_body) @this {

languages/tree-sitter-stack-graphs-java/test/decl/interface.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ interface Iterator<E> {
1010
public E next() {}
1111
// ^ defined: 9
1212
}
13+
14+
interface Set<E> {
15+
public Iterator<E> iterator() {}
16+
}

0 commit comments

Comments
 (0)