Skip to content

Commit 4e9457f

Browse files
Merge pull request #269 from github/update-tsg-version
Update tree-sitter-graph to v0.10
2 parents 1a24ee6 + 65be924 commit 4e9457f

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ attribute node_symbol = node => symbol = (source-text node), source_n
104104
}
105105

106106
[
107-
(import_declaration (identifier) @scope @name)
108-
(import_declaration (scoped_identifier scope: (_) @scope name: (identifier) @name))
107+
(import_declaration (identifier) @_scope @name)
108+
(import_declaration (scoped_identifier scope: (_) @_scope name: (identifier) @name))
109109
] @import {
110110
node def
111111
attr (def) node_definition = @name
@@ -401,7 +401,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
401401
type_parameters: (type_parameters
402402
(type_parameter
403403
(type_identifier) @type_identifier))
404-
body: (_) @body) @this {
404+
body: (_) @body) @_this {
405405
node type_ident
406406
attr (type_ident) node_definition = @type_identifier
407407
edge @body.lexical_scope -> type_ident
@@ -421,7 +421,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
421421
(modifiers "static"?@is_static)?
422422
type: (_) @type
423423
name: (identifier) @name
424-
body: (block) @block) @method
424+
body: (block) @_block) @method
425425
{
426426
edge @type.lexical_scope -> @method.lexical_scope
427427

@@ -554,7 +554,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
554554
edge @block.after_scope -> @last.after_scope
555555
}
556556

557-
(break_statement (identifier) @name) @this {
557+
(break_statement (identifier) @_name) @this {
558558
edge @this.after_scope -> @this.before_scope
559559
}
560560

@@ -586,7 +586,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
586586
edge ns -> @this.before_scope
587587
}
588588

589-
(declaration) @decl {}
589+
(declaration) @_decl {}
590590

591591
(do_statement body: (_) @body condition: (_) @cond) @stmt {
592592
edge @body.before_scope -> @stmt.before_scope
@@ -660,7 +660,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
660660
(local_variable_declaration
661661
type: (_) @type
662662
declarator: (variable_declarator) @var_decl
663-
) @local_var
663+
) @_local_var
664664
{
665665
edge @var_decl.def__typeof -> @type.type
666666
}
@@ -692,7 +692,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
692692
declarator: (_) @left
693693
.
694694
declarator: (_) @right
695-
) @local_var {
695+
) @_local_var {
696696
edge @right.before_scope -> @left.after_scope
697697
}
698698

@@ -770,7 +770,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
770770
edge @first.before_scope -> @this.lexical_scope
771771
}
772772

773-
(switch_block (switch_block_statement_group (switch_label)+ (statement) @a . (statement) @b)) @this {
773+
(switch_block (switch_block_statement_group (switch_label)+ (statement) @a . (statement) @b)) @_this {
774774
edge @b.before_scope -> @a.after_scope
775775
}
776776

@@ -838,11 +838,11 @@ attribute node_symbol = node => symbol = (source-text node), source_n
838838
edge @first.before_scope -> @stmt.before_scope
839839
}
840840

841-
(try_with_resources_statement resources: (resource_specification (resource) @a . (resource) @b)) @stmt {
841+
(try_with_resources_statement resources: (resource_specification (resource) @a . (resource) @b)) @_stmt {
842842
edge @b.before_scope -> @a.after_scope
843843
}
844844

845-
(try_with_resources_statement resources: (resource_specification (resource) @last .) body: (_) @body) @stmt {
845+
(try_with_resources_statement resources: (resource_specification (resource) @last .) body: (_) @body) @_stmt {
846846
edge @body.before_scope -> @last.after_scope
847847
}
848848

@@ -1066,7 +1066,7 @@ attribute node_symbol = node => symbol = (source-text node), source_n
10661066
edge expr_ref__typeof -> expr_ref
10671067
}
10681068

1069-
(method_reference . (identifier) @lhs (identifier) @name) @this {
1069+
(method_reference . (identifier) @lhs (identifier) @_name) @this {
10701070
; @lhs could be a type name
10711071
node ref
10721072
attr (ref) node_reference = @lhs

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ attribute node_symbol = node => symbol = (source-text node), source_n
370370

371371
;; hashbang
372372

373-
(hash_bang_line)@hashbang {
373+
(hash_bang_line) {
374374
}
375375

376376

377377
;; Comments
378378

379-
(comment)@comment {
379+
(comment) {
380380
}
381381

382382

@@ -906,7 +906,7 @@ if none @is_default {
906906
; )
907907

908908
(export_statement
909-
(namespace_export (identifier)@ns)
909+
(namespace_export (identifier))
910910
source:(_)@name
911911
)@export_stmt {
912912
; namespace definitions are specified together with (module) and (internal_module)
@@ -954,8 +954,8 @@ if none @is_default {
954954
(import_statement
955955
"type"?
956956
(import_clause)?@has_clause
957-
source:(_)@from
958-
)@import_stmt {
957+
source:(_)
958+
) {
959959
if none @has_clause {
960960
; do nothing, imported for side-effect only
961961
}
@@ -1068,7 +1068,7 @@ if none @is_type {
10681068

10691069
(import_statement
10701070
"type"?
1071-
(import_clause (namespace_import (identifier)@name))
1071+
(import_clause (namespace_import (identifier)))
10721072
source:(_)@from
10731073
)@import_stmt {
10741074
; namespace definitions are specified together with (module) and (internal_module)
@@ -1094,7 +1094,7 @@ if none @is_type {
10941094
; debugger;
10951095
; debugger
10961096

1097-
(debugger_statement)@debugger_stmt {
1097+
(debugger_statement) {
10981098
}
10991099

11001100

@@ -1205,7 +1205,7 @@ if none @is_type {
12051205
(variable_declarator
12061206
type:(_)@type
12071207
value:(_)@value
1208-
)@decl {
1208+
) {
12091209
; match value cotype to type annotation
12101210
edge @value.cotype -> @type.type
12111211
}
@@ -1413,8 +1413,8 @@ if none @is_async {
14131413
edge @class_decl.type_export -> @class_decl.generic_type
14141414
}
14151415
[
1416-
(abstract_class_declaration name:(_)@name)
1417-
(class_declaration name:(_)@name)
1416+
(abstract_class_declaration name:(_))
1417+
(class_declaration name:(_))
14181418
; NOTE not for interface_declaration as body is already a type with an endpoint of needed
14191419
]@class_decl {
14201420
; mark type scope as endpoint
@@ -1716,7 +1716,7 @@ if none @is_async {
17161716
; }
17171717

17181718
(switch_statement
1719-
value:(_)@value
1719+
value:(_)
17201720
body:(_)@body
17211721
)@switch_stmt {
17221722
; propagate lexical scope
@@ -1747,7 +1747,7 @@ if none @is_async {
17471747
}
17481748

17491749
(switch_case
1750-
value:(_)@value
1750+
value:(_)
17511751
body: (_)@stmt
17521752
)@switch_case {
17531753
; propagate lexical scope
@@ -2097,7 +2097,7 @@ if none @is_async {
20972097

20982098
; break;
20992099

2100-
(break_statement)@break_stmt {
2100+
(break_statement) {
21012101
}
21022102

21032103

@@ -2106,7 +2106,7 @@ if none @is_async {
21062106

21072107
; continue;
21082108

2109-
(continue_statement)@continue_stmt {
2109+
(continue_statement) {
21102110
}
21112111

21122112

@@ -2144,7 +2144,7 @@ if none @is_async {
21442144
; if (true) { ; };;;
21452145
; if (true) {} else {}
21462146

2147-
(empty_statement)@empty_stmt {
2147+
(empty_statement) {
21482148
}
21492149

21502150

@@ -2212,7 +2212,7 @@ if none @is_async {
22122212
; FIXME what is this? tsc doesn't recognize this syntax
22132213
(ambient_declaration
22142214
"module"
2215-
(property_identifier)@prop
2215+
(property_identifier)
22162216
(_)@type
22172217
)@amb_decl {
22182218
; propagate lexical scope
@@ -2704,7 +2704,7 @@ if none @is_async {
27042704
; "A double quoted string.";
27052705
; 'A single quoted string.';
27062706

2707-
(string)@string {
2707+
(string) {
27082708
}
27092709

27102710

@@ -2728,7 +2728,7 @@ if none @is_async {
27282728

27292729
; 12345;
27302730

2731-
(number)@number {
2731+
(number) {
27322732
}
27332733

27342734

@@ -2846,7 +2846,7 @@ if none @is_def {
28462846

28472847
; new.target
28482848

2849-
(meta_property)@new_target {
2849+
(meta_property) {
28502850
}
28512851

28522852

@@ -2855,12 +2855,12 @@ if none @is_def {
28552855

28562856
;; true;
28572857

2858-
(true)@true {
2858+
(true) {
28592859
}
28602860

28612861
;; false;
28622862

2863-
(false)@false {
2863+
(false) {
28642864
}
28652865

28662866

@@ -2912,13 +2912,13 @@ if none @is_def {
29122912

29132913

29142914
; null;
2915-
(null)@null {
2915+
(null) {
29162916
}
29172917

29182918

29192919

29202920
; undefined;
2921-
(undefined)@undefined {
2921+
(undefined) {
29222922
}
29232923

29242924

@@ -2932,7 +2932,7 @@ if none @is_def {
29322932
; (regex (regex_pattern))
29332933
; (regex (regex_pattern) (regex_flags))
29342934

2935-
(regex)@regex {
2935+
(regex) {
29362936
}
29372937

29382938

@@ -3429,14 +3429,14 @@ if none @is_async {
34293429
; type application is handled by the generics rules below
34303430

34313431
(call_expression
3432-
function:(_)@fun arguments: (_)@args
3432+
function:(_) arguments: (_)@args
34333433
)@call_expr {
34343434
; propagate lexical scope
34353435
edge @args.lexical_scope -> @call_expr.lexical_scope
34363436
}
34373437

34383438
(call_expression
3439-
function:(_)@fun arguments: (arguments)@args
3439+
function:(_) arguments: (arguments)@args
34403440
)@call_expr {
34413441
; connect cotype to function params
34423442
edge @args.coargs -> @call_expr.callable__params ;; FIXME
@@ -3535,7 +3535,7 @@ if none @is_async {
35353535

35363536
(subscript_expression
35373537
object: (_)@object
3538-
index: (_)@index ; FIXME typeof index == number
3538+
index: (_) ; FIXME typeof index == number
35393539
)@subscript_expr {
35403540
node @subscript_expr.indexable
35413541

@@ -3547,7 +3547,7 @@ if none @is_async {
35473547
}
35483548

35493549
(subscript_expression
3550-
object: (_)@object
3550+
object: (_)
35513551
index: (number)@index
35523552
)@subscript_expr {
35533553
node @subscript_expr.comp_index
@@ -4003,7 +4003,7 @@ if none @is_async {
40034003
; )
40044004

40054005
(type_assertion
4006-
(type_arguments)@type_arguments
4006+
(type_arguments)
40074007
(expression)@expr
40084008
)@type_assert {
40094009
; propagate lexical scope
@@ -4081,7 +4081,7 @@ if none @is_async {
40814081
(variable_declarator name:(identifier)@name)
40824082
(pattern/identifier)@name
40834083
(rest_pattern (_)@name)
4084-
]@pat {
4084+
] {
40854085
node @name.cotype
40864086
node @name.lexical_scope
40874087
}
@@ -4091,7 +4091,7 @@ if none @is_async {
40914091
(variable_declarator name:(identifier)@name)
40924092
(pattern/identifier)@name
40934093
(rest_pattern (_)@name)
4094-
]@pat {
4094+
] {
40954095
node @name.defs
40964096
node @name.expr_def
40974097
node @name.expr_def__ns
@@ -4510,7 +4510,7 @@ if none @is_async {
45104510
name:(_)@name
45114511
!type ; opt
45124512
value:(_)@value ; opt
4513-
)@def {
4513+
) {
45144514
; type of field is type of value
45154515
edge @name.expr_def -> @name.expr_def__typeof
45164516
;

tree-sitter-stack-graphs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ tokio = { version = "1.26", optional = true, features = ["io-std", "rt", "rt-mul
7676
tower-lsp = { version = "0.19", optional = true }
7777
tree-sitter = ">= 0.19"
7878
tree-sitter-config = { version = "0.19", optional = true }
79-
tree-sitter-graph = "0.9.2"
79+
tree-sitter-graph = "0.10"
8080
tree-sitter-loader = "0.20"
8181
walkdir = { version = "2.3", optional = true }
8282

0 commit comments

Comments
 (0)