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

Commit bc779d0

Browse files
committed
Add a few more missing rules discovered in testing
1 parent a4577b7 commit bc779d0

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

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

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,14 @@ attribute node_symbol = node => symbol = (source-text node), source_n
5252
;; Top level declarations
5353
;; =======================
5454

55-
(import_declaration) @import {
56-
node @import.defs
57-
node @import.lexical_scope
55+
[
56+
(module_declaration)
57+
(package_declaration)
58+
(import_declaration)
59+
] @decl
60+
{
61+
node @decl.defs
62+
node @decl.lexical_scope
5863
}
5964

6065
(import_declaration
@@ -161,6 +166,11 @@ attribute node_symbol = node => symbol = (source-text node), source_n
161166
attr (@this.def) node_definition = @id
162167
}
163168

169+
(spread_parameter) @spread_param {
170+
node @spread_param.lexical_scope
171+
node @spread_param.def
172+
}
173+
164174
(class_declaration interfaces: (super_interfaces (type_list (_) @type))) @this {
165175
edge @type.lexical_scope -> @this.lexical_scope
166176
}
@@ -264,6 +274,11 @@ attribute node_symbol = node => symbol = (source-text node), source_n
264274
edge @value.lexical_scope -> @this.lexical_scope
265275
}
266276

277+
(element_value_array_initializer) @this {
278+
node @this.def
279+
node @this.lexical_scope
280+
}
281+
267282
(element_value_pair value: (_) @value) @this {
268283
node @this.lexical_scope
269284
edge @value.lexical_scope -> @this.lexical_scope

0 commit comments

Comments
 (0)