+98
-110
Cargo.lock
+98
-110
Cargo.lock
···
1
# This file is automatically @generated by Cargo.
2
# It is not intended for manual editing.
3
-
version = 3
4
-
5
-
[[package]]
6
-
name = "ahash"
7
-
version = "0.4.8"
8
-
source = "registry+https://github.com/rust-lang/crates.io-index"
9
-
checksum = "0453232ace82dee0dd0b4c87a59bd90f7b53b314f3e0f61fe2ee7c8a16482289"
10
11
[[package]]
12
name = "aho-corasick"
13
-
version = "1.1.2"
14
source = "registry+https://github.com/rust-lang/crates.io-index"
15
-
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
16
dependencies = [
17
"memchr",
18
]
19
20
[[package]]
21
name = "cc"
22
-
version = "1.0.83"
23
source = "registry+https://github.com/rust-lang/crates.io-index"
24
-
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
25
dependencies = [
26
-
"libc",
27
]
28
29
[[package]]
30
-
name = "cfg-if"
31
-
version = "1.0.0"
32
-
source = "registry+https://github.com/rust-lang/crates.io-index"
33
-
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
34
-
35
-
[[package]]
36
name = "darling"
37
-
version = "0.20.6"
38
source = "registry+https://github.com/rust-lang/crates.io-index"
39
-
checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955"
40
dependencies = [
41
"darling_core",
42
"darling_macro",
···
44
45
[[package]]
46
name = "darling_core"
47
-
version = "0.20.6"
48
source = "registry+https://github.com/rust-lang/crates.io-index"
49
-
checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855"
50
dependencies = [
51
"fnv",
52
"ident_case",
···
58
59
[[package]]
60
name = "darling_macro"
61
-
version = "0.20.6"
62
source = "registry+https://github.com/rust-lang/crates.io-index"
63
-
checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be"
64
dependencies = [
65
"darling_core",
66
"quote",
···
69
70
[[package]]
71
name = "derive_builder"
72
-
version = "0.20.0"
73
source = "registry+https://github.com/rust-lang/crates.io-index"
74
-
checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7"
75
dependencies = [
76
"derive_builder_macro",
77
]
78
79
[[package]]
80
name = "derive_builder_core"
81
-
version = "0.20.0"
82
source = "registry+https://github.com/rust-lang/crates.io-index"
83
-
checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d"
84
dependencies = [
85
"darling",
86
"proc-macro2",
···
90
91
[[package]]
92
name = "derive_builder_macro"
93
-
version = "0.20.0"
94
source = "registry+https://github.com/rust-lang/crates.io-index"
95
-
checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b"
96
dependencies = [
97
"derive_builder_core",
98
"syn",
···
100
101
[[package]]
102
name = "dissimilar"
103
-
version = "1.0.7"
104
source = "registry+https://github.com/rust-lang/crates.io-index"
105
-
checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632"
106
107
[[package]]
108
name = "equivalent"
109
-
version = "1.0.1"
110
source = "registry+https://github.com/rust-lang/crates.io-index"
111
-
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
112
113
[[package]]
114
name = "expect-test"
115
-
version = "1.4.1"
116
source = "registry+https://github.com/rust-lang/crates.io-index"
117
-
checksum = "30d9eafeadd538e68fb28016364c9732d78e420b9ff8853fa5e4058861e9f8d3"
118
dependencies = [
119
"dissimilar",
120
"once_cell",
···
134
135
[[package]]
136
name = "hashbrown"
137
-
version = "0.9.1"
138
-
source = "registry+https://github.com/rust-lang/crates.io-index"
139
-
checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
140
-
dependencies = [
141
-
"ahash",
142
-
]
143
-
144
-
[[package]]
145
-
name = "hashbrown"
146
-
version = "0.14.3"
147
source = "registry+https://github.com/rust-lang/crates.io-index"
148
-
checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604"
149
150
[[package]]
151
name = "html"
···
170
171
[[package]]
172
name = "indexmap"
173
-
version = "2.2.3"
174
source = "registry+https://github.com/rust-lang/crates.io-index"
175
-
checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177"
176
dependencies = [
177
"equivalent",
178
-
"hashbrown 0.14.3",
179
]
180
181
[[package]]
182
name = "itoa"
183
-
version = "1.0.10"
184
source = "registry+https://github.com/rust-lang/crates.io-index"
185
-
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
186
-
187
-
[[package]]
188
-
name = "libc"
189
-
version = "0.2.153"
190
-
source = "registry+https://github.com/rust-lang/crates.io-index"
191
-
checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
192
193
[[package]]
194
name = "log"
195
-
version = "0.4.20"
196
source = "registry+https://github.com/rust-lang/crates.io-index"
197
-
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
198
199
[[package]]
200
name = "memchr"
201
-
version = "2.7.1"
202
source = "registry+https://github.com/rust-lang/crates.io-index"
203
-
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
204
205
[[package]]
206
name = "once_cell"
207
-
version = "1.19.0"
208
source = "registry+https://github.com/rust-lang/crates.io-index"
209
-
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
210
211
[[package]]
212
name = "petgraph"
213
-
version = "0.6.4"
214
source = "registry+https://github.com/rust-lang/crates.io-index"
215
-
checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
216
dependencies = [
217
"fixedbitset",
218
"indexmap",
···
222
223
[[package]]
224
name = "proc-macro2"
225
-
version = "1.0.78"
226
source = "registry+https://github.com/rust-lang/crates.io-index"
227
-
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
228
dependencies = [
229
"unicode-ident",
230
]
231
232
[[package]]
233
name = "quote"
234
-
version = "1.0.35"
235
source = "registry+https://github.com/rust-lang/crates.io-index"
236
-
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
237
dependencies = [
238
"proc-macro2",
239
]
240
241
[[package]]
242
name = "regex"
243
-
version = "1.10.3"
244
source = "registry+https://github.com/rust-lang/crates.io-index"
245
-
checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
246
dependencies = [
247
"aho-corasick",
248
"memchr",
···
252
253
[[package]]
254
name = "regex-automata"
255
-
version = "0.4.5"
256
source = "registry+https://github.com/rust-lang/crates.io-index"
257
-
checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd"
258
dependencies = [
259
"aho-corasick",
260
"memchr",
···
263
264
[[package]]
265
name = "regex-syntax"
266
-
version = "0.8.2"
267
source = "registry+https://github.com/rust-lang/crates.io-index"
268
-
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
269
270
[[package]]
271
name = "ryu"
272
-
version = "1.0.16"
273
source = "registry+https://github.com/rust-lang/crates.io-index"
274
-
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
275
276
[[package]]
277
name = "serde"
278
-
version = "1.0.196"
279
source = "registry+https://github.com/rust-lang/crates.io-index"
280
-
checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32"
281
dependencies = [
282
"serde_derive",
283
]
284
285
[[package]]
286
name = "serde_derive"
287
-
version = "1.0.196"
288
source = "registry+https://github.com/rust-lang/crates.io-index"
289
-
checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67"
290
dependencies = [
291
"proc-macro2",
292
"quote",
···
295
296
[[package]]
297
name = "serde_json"
298
-
version = "1.0.113"
299
source = "registry+https://github.com/rust-lang/crates.io-index"
300
-
checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79"
301
dependencies = [
302
"itoa",
303
"ryu",
304
"serde",
305
]
306
307
[[package]]
308
name = "smallvec"
309
-
version = "1.13.1"
310
source = "registry+https://github.com/rust-lang/crates.io-index"
311
-
checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
312
313
[[package]]
314
name = "stag"
···
327
]
328
329
[[package]]
330
-
name = "string-interner"
331
-
version = "0.12.2"
332
source = "registry+https://github.com/rust-lang/crates.io-index"
333
-
checksum = "383196d1876517ee6f9f0864d1fc1070331b803335d3c6daaa04bbcccd823c08"
334
-
dependencies = [
335
-
"cfg-if",
336
-
"hashbrown 0.9.1",
337
-
]
338
339
[[package]]
340
name = "strsim"
341
-
version = "0.10.0"
342
source = "registry+https://github.com/rust-lang/crates.io-index"
343
-
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
344
345
[[package]]
346
name = "syn"
347
-
version = "2.0.48"
348
source = "registry+https://github.com/rust-lang/crates.io-index"
349
-
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
350
dependencies = [
351
"proc-macro2",
352
"quote",
···
355
356
[[package]]
357
name = "thiserror"
358
-
version = "1.0.57"
359
source = "registry+https://github.com/rust-lang/crates.io-index"
360
-
checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b"
361
dependencies = [
362
"thiserror-impl",
363
]
364
365
[[package]]
366
name = "thiserror-impl"
367
-
version = "1.0.57"
368
source = "registry+https://github.com/rust-lang/crates.io-index"
369
-
checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81"
370
dependencies = [
371
"proc-macro2",
372
"quote",
···
375
376
[[package]]
377
name = "tree-sitter"
378
-
version = "0.20.10"
379
source = "registry+https://github.com/rust-lang/crates.io-index"
380
-
checksum = "e747b1f9b7b931ed39a548c1fae149101497de3c1fc8d9e18c62c1a66c683d3d"
381
dependencies = [
382
"cc",
383
"regex",
384
]
385
386
[[package]]
387
name = "tree-sitter-graph"
388
-
version = "0.11.3"
389
dependencies = [
390
"log",
391
"regex",
392
"serde",
393
"serde_json",
394
"smallvec",
395
-
"string-interner",
396
"thiserror",
397
"tree-sitter",
398
]
399
400
[[package]]
401
name = "tree-sitter-rust"
402
-
version = "0.20.4"
403
source = "registry+https://github.com/rust-lang/crates.io-index"
404
-
checksum = "b0832309b0b2b6d33760ce5c0e818cb47e1d72b468516bfe4134408926fa7594"
405
dependencies = [
406
"cc",
407
-
"tree-sitter",
408
]
409
410
[[package]]
411
name = "unicode-ident"
412
-
version = "1.0.12"
413
source = "registry+https://github.com/rust-lang/crates.io-index"
414
-
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
···
1
# This file is automatically @generated by Cargo.
2
# It is not intended for manual editing.
3
+
version = 4
4
5
[[package]]
6
name = "aho-corasick"
7
+
version = "1.1.3"
8
source = "registry+https://github.com/rust-lang/crates.io-index"
9
+
checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916"
10
dependencies = [
11
"memchr",
12
]
13
14
[[package]]
15
name = "cc"
16
+
version = "1.2.29"
17
source = "registry+https://github.com/rust-lang/crates.io-index"
18
+
checksum = "5c1599538de2394445747c8cf7935946e3cc27e9625f889d979bfb2aaf569362"
19
dependencies = [
20
+
"shlex",
21
]
22
23
[[package]]
24
name = "darling"
25
+
version = "0.20.11"
26
source = "registry+https://github.com/rust-lang/crates.io-index"
27
+
checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee"
28
dependencies = [
29
"darling_core",
30
"darling_macro",
···
32
33
[[package]]
34
name = "darling_core"
35
+
version = "0.20.11"
36
source = "registry+https://github.com/rust-lang/crates.io-index"
37
+
checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e"
38
dependencies = [
39
"fnv",
40
"ident_case",
···
46
47
[[package]]
48
name = "darling_macro"
49
+
version = "0.20.11"
50
source = "registry+https://github.com/rust-lang/crates.io-index"
51
+
checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead"
52
dependencies = [
53
"darling_core",
54
"quote",
···
57
58
[[package]]
59
name = "derive_builder"
60
+
version = "0.20.2"
61
source = "registry+https://github.com/rust-lang/crates.io-index"
62
+
checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947"
63
dependencies = [
64
"derive_builder_macro",
65
]
66
67
[[package]]
68
name = "derive_builder_core"
69
+
version = "0.20.2"
70
source = "registry+https://github.com/rust-lang/crates.io-index"
71
+
checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8"
72
dependencies = [
73
"darling",
74
"proc-macro2",
···
78
79
[[package]]
80
name = "derive_builder_macro"
81
+
version = "0.20.2"
82
source = "registry+https://github.com/rust-lang/crates.io-index"
83
+
checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c"
84
dependencies = [
85
"derive_builder_core",
86
"syn",
···
88
89
[[package]]
90
name = "dissimilar"
91
+
version = "1.0.10"
92
source = "registry+https://github.com/rust-lang/crates.io-index"
93
+
checksum = "8975ffdaa0ef3661bfe02dbdcc06c9f829dfafe6a3c474de366a8d5e44276921"
94
95
[[package]]
96
name = "equivalent"
97
+
version = "1.0.2"
98
source = "registry+https://github.com/rust-lang/crates.io-index"
99
+
checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
100
101
[[package]]
102
name = "expect-test"
103
+
version = "1.5.1"
104
source = "registry+https://github.com/rust-lang/crates.io-index"
105
+
checksum = "63af43ff4431e848fb47472a920f14fa71c24de13255a5692e93d4e90302acb0"
106
dependencies = [
107
"dissimilar",
108
"once_cell",
···
122
123
[[package]]
124
name = "hashbrown"
125
+
version = "0.15.4"
126
source = "registry+https://github.com/rust-lang/crates.io-index"
127
+
checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5"
128
129
[[package]]
130
name = "html"
···
149
150
[[package]]
151
name = "indexmap"
152
+
version = "2.10.0"
153
source = "registry+https://github.com/rust-lang/crates.io-index"
154
+
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
155
dependencies = [
156
"equivalent",
157
+
"hashbrown",
158
]
159
160
[[package]]
161
name = "itoa"
162
+
version = "1.0.15"
163
source = "registry+https://github.com/rust-lang/crates.io-index"
164
+
checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
165
166
[[package]]
167
name = "log"
168
+
version = "0.4.27"
169
source = "registry+https://github.com/rust-lang/crates.io-index"
170
+
checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94"
171
172
[[package]]
173
name = "memchr"
174
+
version = "2.7.5"
175
source = "registry+https://github.com/rust-lang/crates.io-index"
176
+
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
177
178
[[package]]
179
name = "once_cell"
180
+
version = "1.21.3"
181
source = "registry+https://github.com/rust-lang/crates.io-index"
182
+
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
183
184
[[package]]
185
name = "petgraph"
186
+
version = "0.6.5"
187
source = "registry+https://github.com/rust-lang/crates.io-index"
188
+
checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db"
189
dependencies = [
190
"fixedbitset",
191
"indexmap",
···
195
196
[[package]]
197
name = "proc-macro2"
198
+
version = "1.0.95"
199
source = "registry+https://github.com/rust-lang/crates.io-index"
200
+
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
201
dependencies = [
202
"unicode-ident",
203
]
204
205
[[package]]
206
name = "quote"
207
+
version = "1.0.40"
208
source = "registry+https://github.com/rust-lang/crates.io-index"
209
+
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
210
dependencies = [
211
"proc-macro2",
212
]
213
214
[[package]]
215
name = "regex"
216
+
version = "1.11.1"
217
source = "registry+https://github.com/rust-lang/crates.io-index"
218
+
checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191"
219
dependencies = [
220
"aho-corasick",
221
"memchr",
···
225
226
[[package]]
227
name = "regex-automata"
228
+
version = "0.4.9"
229
source = "registry+https://github.com/rust-lang/crates.io-index"
230
+
checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908"
231
dependencies = [
232
"aho-corasick",
233
"memchr",
···
236
237
[[package]]
238
name = "regex-syntax"
239
+
version = "0.8.5"
240
source = "registry+https://github.com/rust-lang/crates.io-index"
241
+
checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
242
243
[[package]]
244
name = "ryu"
245
+
version = "1.0.20"
246
source = "registry+https://github.com/rust-lang/crates.io-index"
247
+
checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
248
249
[[package]]
250
name = "serde"
251
+
version = "1.0.219"
252
source = "registry+https://github.com/rust-lang/crates.io-index"
253
+
checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6"
254
dependencies = [
255
"serde_derive",
256
]
257
258
[[package]]
259
name = "serde_derive"
260
+
version = "1.0.219"
261
source = "registry+https://github.com/rust-lang/crates.io-index"
262
+
checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00"
263
dependencies = [
264
"proc-macro2",
265
"quote",
···
268
269
[[package]]
270
name = "serde_json"
271
+
version = "1.0.140"
272
source = "registry+https://github.com/rust-lang/crates.io-index"
273
+
checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373"
274
dependencies = [
275
+
"indexmap",
276
"itoa",
277
+
"memchr",
278
"ryu",
279
"serde",
280
]
281
282
[[package]]
283
+
name = "shlex"
284
+
version = "1.3.0"
285
+
source = "registry+https://github.com/rust-lang/crates.io-index"
286
+
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
287
+
288
+
[[package]]
289
name = "smallvec"
290
+
version = "1.15.1"
291
source = "registry+https://github.com/rust-lang/crates.io-index"
292
+
checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
293
294
[[package]]
295
name = "stag"
···
308
]
309
310
[[package]]
311
+
name = "streaming-iterator"
312
+
version = "0.1.9"
313
source = "registry+https://github.com/rust-lang/crates.io-index"
314
+
checksum = "2b2231b7c3057d5e4ad0156fb3dc807d900806020c5ffa3ee6ff2c8c76fb8520"
315
316
[[package]]
317
name = "strsim"
318
+
version = "0.11.1"
319
source = "registry+https://github.com/rust-lang/crates.io-index"
320
+
checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f"
321
322
[[package]]
323
name = "syn"
324
+
version = "2.0.104"
325
source = "registry+https://github.com/rust-lang/crates.io-index"
326
+
checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40"
327
dependencies = [
328
"proc-macro2",
329
"quote",
···
332
333
[[package]]
334
name = "thiserror"
335
+
version = "1.0.69"
336
source = "registry+https://github.com/rust-lang/crates.io-index"
337
+
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
338
dependencies = [
339
"thiserror-impl",
340
]
341
342
[[package]]
343
name = "thiserror-impl"
344
+
version = "1.0.69"
345
source = "registry+https://github.com/rust-lang/crates.io-index"
346
+
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
347
dependencies = [
348
"proc-macro2",
349
"quote",
···
352
353
[[package]]
354
name = "tree-sitter"
355
+
version = "0.25.6"
356
source = "registry+https://github.com/rust-lang/crates.io-index"
357
+
checksum = "a7cf18d43cbf0bfca51f657132cc616a5097edc4424d538bae6fa60142eaf9f0"
358
dependencies = [
359
"cc",
360
"regex",
361
+
"regex-syntax",
362
+
"serde_json",
363
+
"streaming-iterator",
364
+
"tree-sitter-language",
365
]
366
367
[[package]]
368
name = "tree-sitter-graph"
369
+
version = "0.12.0"
370
+
source = "git+https://tangled.sh/@oppi.li/tree-sitter-graph#36785dff28c7a6e496d46ffa70f5d0f98d61bbf0"
371
dependencies = [
372
"log",
373
"regex",
374
"serde",
375
"serde_json",
376
"smallvec",
377
+
"streaming-iterator",
378
"thiserror",
379
"tree-sitter",
380
]
381
382
[[package]]
383
+
name = "tree-sitter-language"
384
+
version = "0.1.5"
385
+
source = "registry+https://github.com/rust-lang/crates.io-index"
386
+
checksum = "c4013970217383f67b18aef68f6fb2e8d409bc5755227092d32efb0422ba24b8"
387
+
388
+
[[package]]
389
name = "tree-sitter-rust"
390
+
version = "0.24.0"
391
source = "registry+https://github.com/rust-lang/crates.io-index"
392
+
checksum = "4b9b18034c684a2420722be8b2a91c9c44f2546b631c039edf575ccba8c61be1"
393
dependencies = [
394
"cc",
395
+
"tree-sitter-language",
396
]
397
398
[[package]]
399
name = "unicode-ident"
400
+
version = "1.0.18"
401
source = "registry+https://github.com/rust-lang/crates.io-index"
402
+
checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512"
+4
-5
Cargo.toml
+4
-5
Cargo.toml
···
3
version = "0.1.0"
4
edition = "2021"
5
6
-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
-
8
[lib]
9
10
[dependencies]
···
12
serde = {version = "1.0.188", features = ["derive"]}
13
once_cell = "1.19.0"
14
thiserror = "1.0.56"
15
-
tree-sitter-graph = { path = "../tree-sitter-graph/"}
16
-
tree-sitter-rust = "0.20.4"
17
-
tree-sitter = "0.20"
18
derive_builder = "0.20.0"
19
expect-test = "1.4.1"
20
html = "0.6.3"
···
3
version = "0.1.0"
4
edition = "2021"
5
6
[lib]
7
8
[dependencies]
···
10
serde = {version = "1.0.188", features = ["derive"]}
11
once_cell = "1.19.0"
12
thiserror = "1.0.56"
13
+
tree-sitter-graph = { git = "https://tangled.sh/@oppi.li/tree-sitter-graph"}
14
+
# tree-sitter-graph = { path = "../tree-sitter-graph"}
15
+
tree-sitter-rust = "0.24"
16
+
tree-sitter = "0.25"
17
derive_builder = "0.20.0"
18
expect-test = "1.4.1"
19
html = "0.6.3"
+4
-2
src/bin/html.rs
+4
-2
src/bin/html.rs
···
7
fn main() {
8
let src = include_str!("html.rs");
9
10
let sg = StagBuilder::default()
11
.with_source(src)
12
.with_stag_file(stag::RUST)
13
-
.with_language(tree_sitter_rust::language())
14
.execute()
15
.unwrap();
16
17
let mut parser = Parser::new();
18
-
let _ = parser.set_language(tree_sitter_rust::language());
19
20
let tree = parser.parse(&src, None).unwrap();
21
let root = tree.root_node();
···
7
fn main() {
8
let src = include_str!("html.rs");
9
10
+
let language = tree_sitter_rust::LANGUAGE;
11
+
12
let sg = StagBuilder::default()
13
.with_source(src)
14
.with_stag_file(stag::RUST)
15
+
.with_language(language.into())
16
.execute()
17
.unwrap();
18
19
let mut parser = Parser::new();
20
+
let _ = parser.set_language(&language.into());
21
22
let tree = parser.parse(&src, None).unwrap();
23
let root = tree.root_node();
+3
-3
src/debug.rs
+3
-3
src/debug.rs
···
1
use std::fmt;
2
3
-
use crate::stag::{EdgeKind, NodeKind};
4
use crate::text_range::TextRange;
5
6
use petgraph::{
···
74
}
75
}
76
77
-
fn build(&mut self, graph: &Graph<NodeKind, EdgeKind>, start: NodeIndex<u32>, src: &[u8]) {
78
let mut defs = graph
79
.edges_directed(start, Direction::Incoming)
80
.filter(|edge| *edge.weight() == EdgeKind::DefToScope)
···
152
self.scopes = scopes;
153
}
154
155
-
pub fn new(graph: &Graph<NodeKind, EdgeKind>, start: NodeIndex<u32>, src: &[u8]) -> Self {
156
let mut scope_debug = Self::empty(graph[start].range());
157
scope_debug.build(graph, start, src);
158
scope_debug
···
1
use std::fmt;
2
3
+
use crate::stag::{EdgeKind, Node};
4
use crate::text_range::TextRange;
5
6
use petgraph::{
···
74
}
75
}
76
77
+
fn build(&mut self, graph: &Graph<Node, EdgeKind>, start: NodeIndex<u32>, src: &[u8]) {
78
let mut defs = graph
79
.edges_directed(start, Direction::Incoming)
80
.filter(|edge| *edge.weight() == EdgeKind::DefToScope)
···
152
self.scopes = scopes;
153
}
154
155
+
pub fn new(graph: &Graph<Node, EdgeKind>, start: NodeIndex<u32>, src: &[u8]) -> Self {
156
let mut scope_debug = Self::empty(graph[start].range());
157
scope_debug.build(graph, start, src);
158
scope_debug
+67
-36
src/stag.rs
+67
-36
src/stag.rs
···
41
42
pub fn execute(&self) -> Result<ScopeGraph, StagError> {
43
let mut parser = tree_sitter::Parser::new();
44
-
let language = self.language.ok_or(ConfigError::MissingLanguage)?;
45
-
parser.set_language(language)?;
46
47
let file = File::from_str(
48
language,
···
163
}
164
}
165
166
-
/// The type of a node in the ScopeGraph
167
#[derive(Serialize, Deserialize, Debug, Clone)]
168
pub enum NodeKind {
169
/// A scope node
···
179
Ref(Reference),
180
}
181
182
-
impl NodeKind {
183
-
/// Construct a scope node from a range
184
-
pub fn scope(range: TextRange) -> Self {
185
-
Self::Scope(LocalScope::new(range))
186
-
}
187
-
188
-
/// Produce the range spanned by this node
189
-
pub fn range(&self) -> TextRange {
190
-
match self {
191
-
Self::Scope(l) => l.range,
192
-
Self::Def(d) => d.range,
193
-
Self::Ref(r) => r.range,
194
-
Self::Import(i) => i.range,
195
-
}
196
-
}
197
-
}
198
-
199
/// Describes the relation between two nodes in the ScopeGraph
200
#[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone, Debug)]
201
pub enum EdgeKind {
···
219
#[derive(Debug, Serialize, Deserialize, Clone)]
220
pub struct ScopeGraph {
221
/// The raw graph
222
-
pub graph: Graph<NodeKind, EdgeKind>,
223
224
// Graphs do not have the concept of a `root`, but lexical scopes follow the syntax
225
// tree, and as a result, have a "root" node. The root_idx points to a scope node that
···
230
impl ScopeGraph {
231
pub fn new(range: TextRange) -> Self {
232
let mut graph = Graph::new();
233
-
let root_idx = graph.add_node(NodeKind::scope(range));
234
Self { graph, root_idx }
235
}
236
237
-
pub fn get_node(&self, node_idx: NodeIndex) -> Option<&NodeKind> {
238
self.graph.node_weight(node_idx)
239
}
240
241
/// Insert a local scope into the scope-graph
242
-
fn insert_local_scope(&mut self, new: LocalScope) {
243
if let Some(parent_scope) = self.scope_by_range(new.range, self.root_idx) {
244
-
let new_scope = NodeKind::Scope(new);
245
let new_idx = self.graph.add_node(new_scope);
246
self.graph
247
.add_edge(new_idx, parent_scope, EdgeKind::ScopeToScope);
248
}
249
}
250
251
/// Insert a def into the scope-graph
252
fn insert_local_def(&mut self, new: LocalDef) {
253
if let Some(defining_scope) = self.scope_by_range(new.range, self.root_idx) {
254
-
let new_def = NodeKind::Def(new);
255
let new_idx = self.graph.add_node(new_def);
256
self.graph
257
.add_edge(new_idx, defining_scope, EdgeKind::DefToScope);
···
261
/// Insert a def into the scope-graph, at the root scope
262
#[allow(unused)]
263
fn insert_global_def(&mut self, new: LocalDef) {
264
-
let new_def = NodeKind::Def(new);
265
let new_idx = self.graph.add_node(new_def);
266
self.graph
267
.add_edge(new_idx, self.root_idx, EdgeKind::DefToScope);
···
270
/// Insert an import into the scope-graph
271
fn insert_local_import(&mut self, new: LocalImport) {
272
if let Some(defining_scope) = self.scope_by_range(new.range, self.root_idx) {
273
-
let new_imp = NodeKind::Import(new);
274
let new_idx = self.graph.add_node(new_imp);
275
self.graph
276
.add_edge(new_idx, defining_scope, EdgeKind::ImportToScope);
···
291
.filter(|edge| *edge.weight() == EdgeKind::DefToScope)
292
.map(|edge| edge.source())
293
{
294
-
if let NodeKind::Def(def) = &self.graph[local_def] {
295
if new.text == def.text {
296
match (def.symbol.as_ref(), new.symbol.as_ref()) {
297
// both contain symbols, but they don't belong to the same namepspace
···
318
.filter(|edge| *edge.weight() == EdgeKind::ImportToScope)
319
.map(|edge| edge.source())
320
{
321
-
if let NodeKind::Import(import) = &self.graph[local_import] {
322
if new.text == import.text {
323
possible_imports.push(local_import);
324
}
···
328
}
329
330
if !possible_defs.is_empty() || !possible_imports.is_empty() {
331
-
let new_ref = NodeKind::Ref(new);
332
let ref_idx = self.graph.add_node(new_ref);
333
for def_idx in possible_defs {
334
self.graph.add_edge(ref_idx, def_idx, EdgeKind::RefToDef);
···
384
let iterator =
385
self.graph
386
.node_indices()
387
-
.filter_map(|node_idx| match &self.graph[node_idx] {
388
NodeKind::Scope(_) => None,
389
NodeKind::Def(d) => Some(d.range),
390
NodeKind::Ref(r) => Some(r.range),
···
471
}
472
473
pub fn is_definition(&self, node_idx: NodeIndex) -> bool {
474
-
matches!(self.graph[node_idx], NodeKind::Def(_))
475
}
476
477
pub fn is_reference(&self, node_idx: NodeIndex) -> bool {
478
-
matches!(self.graph[node_idx], NodeKind::Ref(_))
479
}
480
481
pub fn is_scope(&self, node_idx: NodeIndex) -> bool {
482
-
matches!(self.graph[node_idx], NodeKind::Scope(_))
483
}
484
485
pub fn is_import(&self, node_idx: NodeIndex) -> bool {
486
-
matches!(self.graph[node_idx], NodeKind::Import(_))
487
}
488
}
489
···
41
42
pub fn execute(&self) -> Result<ScopeGraph, StagError> {
43
let mut parser = tree_sitter::Parser::new();
44
+
let language = self.language.clone().ok_or(ConfigError::MissingLanguage)?;
45
+
parser.set_language(&language)?;
46
47
let file = File::from_str(
48
language,
···
163
}
164
}
165
166
+
/// A node in the ScopeGraph
167
+
#[derive(Serialize, Deserialize, Debug, Clone)]
168
+
pub struct Node {
169
+
kind: NodeKind,
170
+
metadata: Metadata,
171
+
}
172
+
173
+
impl Node {
174
+
pub fn new(kind: NodeKind) -> Self {
175
+
Self {
176
+
kind,
177
+
metadata: Default::default(),
178
+
}
179
+
}
180
+
181
+
pub fn scope(s: LocalScope) -> Self {
182
+
Self::new(NodeKind::Scope(s))
183
+
}
184
+
185
+
pub fn local_def(d: LocalDef) -> Self {
186
+
Self::new(NodeKind::Def(d))
187
+
}
188
+
189
+
pub fn reference(r: Reference) -> Self {
190
+
Self::new(NodeKind::Ref(r))
191
+
}
192
+
193
+
pub fn import(i: LocalImport) -> Self {
194
+
Self::new(NodeKind::Import(i))
195
+
}
196
+
197
+
/// Produce the range spanned by this node
198
+
pub fn range(&self) -> TextRange {
199
+
match &self.kind {
200
+
NodeKind::Scope(l) => l.range,
201
+
NodeKind::Def(d) => d.range,
202
+
NodeKind::Ref(r) => r.range,
203
+
NodeKind::Import(i) => i.range,
204
+
}
205
+
}
206
+
}
207
+
208
+
#[derive(Serialize, Deserialize, Default, Debug, Clone)]
209
+
struct Metadata {}
210
+
211
+
/// The kind of a lexical node in the ScopeGraph
212
#[derive(Serialize, Deserialize, Debug, Clone)]
213
pub enum NodeKind {
214
/// A scope node
···
224
Ref(Reference),
225
}
226
227
/// Describes the relation between two nodes in the ScopeGraph
228
#[derive(Serialize, Deserialize, PartialEq, Eq, Copy, Clone, Debug)]
229
pub enum EdgeKind {
···
247
#[derive(Debug, Serialize, Deserialize, Clone)]
248
pub struct ScopeGraph {
249
/// The raw graph
250
+
pub graph: Graph<Node, EdgeKind>,
251
252
// Graphs do not have the concept of a `root`, but lexical scopes follow the syntax
253
// tree, and as a result, have a "root" node. The root_idx points to a scope node that
···
258
impl ScopeGraph {
259
pub fn new(range: TextRange) -> Self {
260
let mut graph = Graph::new();
261
+
let root_idx = graph.add_node(Node::scope(LocalScope::new(range)));
262
Self { graph, root_idx }
263
}
264
265
+
pub fn get_node(&self, node_idx: NodeIndex) -> Option<&Node> {
266
self.graph.node_weight(node_idx)
267
}
268
269
/// Insert a local scope into the scope-graph
270
+
fn insert_local_scope(&mut self, new: LocalScope) -> Option<NodeIndex> {
271
if let Some(parent_scope) = self.scope_by_range(new.range, self.root_idx) {
272
+
let new_scope = Node::scope(new);
273
let new_idx = self.graph.add_node(new_scope);
274
self.graph
275
.add_edge(new_idx, parent_scope, EdgeKind::ScopeToScope);
276
+
Some(new_idx)
277
+
} else {
278
+
None
279
}
280
}
281
282
/// Insert a def into the scope-graph
283
fn insert_local_def(&mut self, new: LocalDef) {
284
if let Some(defining_scope) = self.scope_by_range(new.range, self.root_idx) {
285
+
let new_def = Node::local_def(new);
286
let new_idx = self.graph.add_node(new_def);
287
self.graph
288
.add_edge(new_idx, defining_scope, EdgeKind::DefToScope);
···
292
/// Insert a def into the scope-graph, at the root scope
293
#[allow(unused)]
294
fn insert_global_def(&mut self, new: LocalDef) {
295
+
let new_def = Node::local_def(new);
296
let new_idx = self.graph.add_node(new_def);
297
self.graph
298
.add_edge(new_idx, self.root_idx, EdgeKind::DefToScope);
···
301
/// Insert an import into the scope-graph
302
fn insert_local_import(&mut self, new: LocalImport) {
303
if let Some(defining_scope) = self.scope_by_range(new.range, self.root_idx) {
304
+
let new_imp = Node::import(new);
305
let new_idx = self.graph.add_node(new_imp);
306
self.graph
307
.add_edge(new_idx, defining_scope, EdgeKind::ImportToScope);
···
322
.filter(|edge| *edge.weight() == EdgeKind::DefToScope)
323
.map(|edge| edge.source())
324
{
325
+
if let NodeKind::Def(def) = &self.graph[local_def].kind {
326
if new.text == def.text {
327
match (def.symbol.as_ref(), new.symbol.as_ref()) {
328
// both contain symbols, but they don't belong to the same namepspace
···
349
.filter(|edge| *edge.weight() == EdgeKind::ImportToScope)
350
.map(|edge| edge.source())
351
{
352
+
if let NodeKind::Import(import) = &self.graph[local_import].kind {
353
if new.text == import.text {
354
possible_imports.push(local_import);
355
}
···
359
}
360
361
if !possible_defs.is_empty() || !possible_imports.is_empty() {
362
+
let new_ref = Node::reference(new);
363
let ref_idx = self.graph.add_node(new_ref);
364
for def_idx in possible_defs {
365
self.graph.add_edge(ref_idx, def_idx, EdgeKind::RefToDef);
···
415
let iterator =
416
self.graph
417
.node_indices()
418
+
.filter_map(|node_idx| match &self.graph[node_idx].kind {
419
NodeKind::Scope(_) => None,
420
NodeKind::Def(d) => Some(d.range),
421
NodeKind::Ref(r) => Some(r.range),
···
502
}
503
504
pub fn is_definition(&self, node_idx: NodeIndex) -> bool {
505
+
matches!(self.graph[node_idx].kind, NodeKind::Def(_))
506
}
507
508
pub fn is_reference(&self, node_idx: NodeIndex) -> bool {
509
+
matches!(self.graph[node_idx].kind, NodeKind::Ref(_))
510
}
511
512
pub fn is_scope(&self, node_idx: NodeIndex) -> bool {
513
+
matches!(self.graph[node_idx].kind, NodeKind::Scope(_))
514
}
515
516
pub fn is_import(&self, node_idx: NodeIndex) -> bool {
517
+
matches!(self.graph[node_idx].kind, NodeKind::Import(_))
518
}
519
}
520