diff options
-rw-r--r-- | Cargo.lock | 461 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | tree-viz/Cargo.toml | 9 | ||||
-rw-r--r-- | tree-viz/src/app.rs | 17 | ||||
-rw-r--r-- | tree-viz/src/config.rs | 2 | ||||
-rw-r--r-- | tree-viz/src/main.rs | 9 |
6 files changed, 82 insertions, 417 deletions
@@ -3,12 +3,6 @@ | |||
3 | version = 3 | 3 | version = 3 |
4 | 4 | ||
5 | [[package]] | 5 | [[package]] |
6 | name = "ahash" | ||
7 | version = "0.4.7" | ||
8 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
9 | checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" | ||
10 | |||
11 | [[package]] | ||
12 | name = "aho-corasick" | 6 | name = "aho-corasick" |
13 | version = "0.7.19" | 7 | version = "0.7.19" |
14 | source = "registry+https://github.com/rust-lang/crates.io-index" | 8 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -18,51 +12,12 @@ dependencies = [ | |||
18 | ] | 12 | ] |
19 | 13 | ||
20 | [[package]] | 14 | [[package]] |
21 | name = "ansi_term" | ||
22 | version = "0.12.1" | ||
23 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
24 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" | ||
25 | dependencies = [ | ||
26 | "winapi", | ||
27 | ] | ||
28 | |||
29 | [[package]] | ||
30 | name = "anyhow" | ||
31 | version = "1.0.65" | ||
32 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
33 | checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" | ||
34 | |||
35 | [[package]] | ||
36 | name = "autocfg" | ||
37 | version = "1.1.0" | ||
38 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
39 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" | ||
40 | |||
41 | [[package]] | ||
42 | name = "bitflags" | 15 | name = "bitflags" |
43 | version = "1.3.2" | 16 | version = "1.3.2" |
44 | source = "registry+https://github.com/rust-lang/crates.io-index" | 17 | source = "registry+https://github.com/rust-lang/crates.io-index" |
45 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" | 18 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" |
46 | 19 | ||
47 | [[package]] | 20 | [[package]] |
48 | name = "bitvec" | ||
49 | version = "0.22.3" | ||
50 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
51 | checksum = "5237f00a8c86130a0cc317830e558b966dd7850d48a953d998c813f01a41b527" | ||
52 | dependencies = [ | ||
53 | "funty", | ||
54 | "radium", | ||
55 | "tap", | ||
56 | "wyz", | ||
57 | ] | ||
58 | |||
59 | [[package]] | ||
60 | name = "byteorder" | ||
61 | version = "1.4.3" | ||
62 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
63 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" | ||
64 | |||
65 | [[package]] | ||
66 | name = "cc" | 21 | name = "cc" |
67 | version = "1.0.73" | 22 | version = "1.0.73" |
68 | source = "registry+https://github.com/rust-lang/crates.io-index" | 23 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -89,52 +44,6 @@ dependencies = [ | |||
89 | ] | 44 | ] |
90 | 45 | ||
91 | [[package]] | 46 | [[package]] |
92 | name = "controlled-option" | ||
93 | version = "0.4.1" | ||
94 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
95 | checksum = "95abc95db25411571f40a8b0af30a3c386f3927fe6f1460c70e1f49f01bac3ac" | ||
96 | dependencies = [ | ||
97 | "controlled-option-macros", | ||
98 | ] | ||
99 | |||
100 | [[package]] | ||
101 | name = "controlled-option-macros" | ||
102 | version = "0.2.2" | ||
103 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
104 | checksum = "305024255a6c456333e130da2559b7aedd5c2e15388f51dae69f7507517cfbfb" | ||
105 | dependencies = [ | ||
106 | "proc-macro2", | ||
107 | "quote", | ||
108 | "syn", | ||
109 | ] | ||
110 | |||
111 | [[package]] | ||
112 | name = "dirs" | ||
113 | version = "3.0.2" | ||
114 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
115 | checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" | ||
116 | dependencies = [ | ||
117 | "dirs-sys", | ||
118 | ] | ||
119 | |||
120 | [[package]] | ||
121 | name = "dirs-sys" | ||
122 | version = "0.3.7" | ||
123 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
124 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" | ||
125 | dependencies = [ | ||
126 | "libc", | ||
127 | "redox_users", | ||
128 | "winapi", | ||
129 | ] | ||
130 | |||
131 | [[package]] | ||
132 | name = "either" | ||
133 | version = "1.8.0" | ||
134 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
135 | checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" | ||
136 | |||
137 | [[package]] | ||
138 | name = "encode_unicode" | 47 | name = "encode_unicode" |
139 | version = "0.3.6" | 48 | version = "0.3.6" |
140 | source = "registry+https://github.com/rust-lang/crates.io-index" | 49 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -153,57 +62,6 @@ dependencies = [ | |||
153 | ] | 62 | ] |
154 | 63 | ||
155 | [[package]] | 64 | [[package]] |
156 | name = "funty" | ||
157 | version = "1.2.0" | ||
158 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
159 | checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e" | ||
160 | |||
161 | [[package]] | ||
162 | name = "fxhash" | ||
163 | version = "0.2.1" | ||
164 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
165 | checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" | ||
166 | dependencies = [ | ||
167 | "byteorder", | ||
168 | ] | ||
169 | |||
170 | [[package]] | ||
171 | name = "getrandom" | ||
172 | version = "0.2.7" | ||
173 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
174 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" | ||
175 | dependencies = [ | ||
176 | "cfg-if", | ||
177 | "libc", | ||
178 | "wasi", | ||
179 | ] | ||
180 | |||
181 | [[package]] | ||
182 | name = "hashbrown" | ||
183 | version = "0.9.1" | ||
184 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
185 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" | ||
186 | dependencies = [ | ||
187 | "ahash", | ||
188 | ] | ||
189 | |||
190 | [[package]] | ||
191 | name = "hashbrown" | ||
192 | version = "0.12.3" | ||
193 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
194 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" | ||
195 | |||
196 | [[package]] | ||
197 | name = "indexmap" | ||
198 | version = "1.9.1" | ||
199 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
200 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" | ||
201 | dependencies = [ | ||
202 | "autocfg", | ||
203 | "hashbrown 0.12.3", | ||
204 | ] | ||
205 | |||
206 | [[package]] | ||
207 | name = "inotify" | 65 | name = "inotify" |
208 | version = "0.9.6" | 66 | version = "0.9.6" |
209 | source = "registry+https://github.com/rust-lang/crates.io-index" | 67 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -224,21 +82,6 @@ dependencies = [ | |||
224 | ] | 82 | ] |
225 | 83 | ||
226 | [[package]] | 84 | [[package]] |
227 | name = "itertools" | ||
228 | version = "0.10.4" | ||
229 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
230 | checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0" | ||
231 | dependencies = [ | ||
232 | "either", | ||
233 | ] | ||
234 | |||
235 | [[package]] | ||
236 | name = "itoa" | ||
237 | version = "1.0.3" | ||
238 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
239 | checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" | ||
240 | |||
241 | [[package]] | ||
242 | name = "kqueue" | 85 | name = "kqueue" |
243 | version = "1.0.6" | 86 | version = "1.0.6" |
244 | source = "registry+https://github.com/rust-lang/crates.io-index" | 87 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -259,28 +102,12 @@ dependencies = [ | |||
259 | ] | 102 | ] |
260 | 103 | ||
261 | [[package]] | 104 | [[package]] |
262 | name = "lazy_static" | ||
263 | version = "1.4.0" | ||
264 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
265 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" | ||
266 | |||
267 | [[package]] | ||
268 | name = "libc" | 105 | name = "libc" |
269 | version = "0.2.132" | 106 | version = "0.2.132" |
270 | source = "registry+https://github.com/rust-lang/crates.io-index" | 107 | source = "registry+https://github.com/rust-lang/crates.io-index" |
271 | checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" | 108 | checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" |
272 | 109 | ||
273 | [[package]] | 110 | [[package]] |
274 | name = "libloading" | ||
275 | version = "0.7.3" | ||
276 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
277 | checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" | ||
278 | dependencies = [ | ||
279 | "cfg-if", | ||
280 | "winapi", | ||
281 | ] | ||
282 | |||
283 | [[package]] | ||
284 | name = "log" | 111 | name = "log" |
285 | version = "0.4.17" | 112 | version = "0.4.17" |
286 | source = "registry+https://github.com/rust-lang/crates.io-index" | 113 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -290,17 +117,6 @@ dependencies = [ | |||
290 | ] | 117 | ] |
291 | 118 | ||
292 | [[package]] | 119 | [[package]] |
293 | name = "lsp-positions" | ||
294 | version = "0.3.1" | ||
295 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
296 | checksum = "6ce95baee2c4668ed42b67ae7f931abe06169fcef8e853815ffaf53b56ac7f0c" | ||
297 | dependencies = [ | ||
298 | "memchr", | ||
299 | "tree-sitter", | ||
300 | "unicode-segmentation", | ||
301 | ] | ||
302 | |||
303 | [[package]] | ||
304 | name = "memchr" | 120 | name = "memchr" |
305 | version = "2.5.0" | 121 | version = "2.5.0" |
306 | source = "registry+https://github.com/rust-lang/crates.io-index" | 122 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -341,30 +157,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
341 | checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" | 157 | checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" |
342 | 158 | ||
343 | [[package]] | 159 | [[package]] |
344 | name = "proc-macro2" | ||
345 | version = "1.0.43" | ||
346 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
347 | checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" | ||
348 | dependencies = [ | ||
349 | "unicode-ident", | ||
350 | ] | ||
351 | |||
352 | [[package]] | ||
353 | name = "quote" | ||
354 | version = "1.0.21" | ||
355 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
356 | checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" | ||
357 | dependencies = [ | ||
358 | "proc-macro2", | ||
359 | ] | ||
360 | |||
361 | [[package]] | ||
362 | name = "radium" | ||
363 | version = "0.6.2" | ||
364 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
365 | checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb" | ||
366 | |||
367 | [[package]] | ||
368 | name = "redox_syscall" | 160 | name = "redox_syscall" |
369 | version = "0.2.16" | 161 | version = "0.2.16" |
370 | source = "registry+https://github.com/rust-lang/crates.io-index" | 162 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -374,17 +166,6 @@ dependencies = [ | |||
374 | ] | 166 | ] |
375 | 167 | ||
376 | [[package]] | 168 | [[package]] |
377 | name = "redox_users" | ||
378 | version = "0.4.3" | ||
379 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
380 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" | ||
381 | dependencies = [ | ||
382 | "getrandom", | ||
383 | "redox_syscall", | ||
384 | "thiserror", | ||
385 | ] | ||
386 | |||
387 | [[package]] | ||
388 | name = "regex" | 169 | name = "regex" |
389 | version = "1.6.0" | 170 | version = "1.6.0" |
390 | source = "registry+https://github.com/rust-lang/crates.io-index" | 171 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -402,12 +183,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" | |||
402 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" | 183 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" |
403 | 184 | ||
404 | [[package]] | 185 | [[package]] |
405 | name = "ryu" | ||
406 | version = "1.0.11" | ||
407 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
408 | checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" | ||
409 | |||
410 | [[package]] | ||
411 | name = "same-file" | 186 | name = "same-file" |
412 | version = "1.0.6" | 187 | version = "1.0.6" |
413 | source = "registry+https://github.com/rust-lang/crates.io-index" | 188 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -417,102 +192,6 @@ dependencies = [ | |||
417 | ] | 192 | ] |
418 | 193 | ||
419 | [[package]] | 194 | [[package]] |
420 | name = "scope-viz" | ||
421 | version = "0.1.0" | ||
422 | dependencies = [ | ||
423 | "stack-graphs", | ||
424 | "tree-sitter", | ||
425 | "tree-sitter-elm", | ||
426 | "tree-sitter-graph", | ||
427 | "tree-sitter-rust", | ||
428 | "tree-sitter-stack-graphs", | ||
429 | ] | ||
430 | |||
431 | [[package]] | ||
432 | name = "serde" | ||
433 | version = "1.0.144" | ||
434 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
435 | checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" | ||
436 | dependencies = [ | ||
437 | "serde_derive", | ||
438 | ] | ||
439 | |||
440 | [[package]] | ||
441 | name = "serde_derive" | ||
442 | version = "1.0.144" | ||
443 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
444 | checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" | ||
445 | dependencies = [ | ||
446 | "proc-macro2", | ||
447 | "quote", | ||
448 | "syn", | ||
449 | ] | ||
450 | |||
451 | [[package]] | ||
452 | name = "serde_json" | ||
453 | version = "1.0.85" | ||
454 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
455 | checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" | ||
456 | dependencies = [ | ||
457 | "indexmap", | ||
458 | "itoa", | ||
459 | "ryu", | ||
460 | "serde", | ||
461 | ] | ||
462 | |||
463 | [[package]] | ||
464 | name = "smallvec" | ||
465 | version = "1.9.0" | ||
466 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
467 | checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" | ||
468 | |||
469 | [[package]] | ||
470 | name = "stack-graphs" | ||
471 | version = "0.10.1" | ||
472 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
473 | checksum = "9c4fdc37ccc4f64bea4bc3ffa3f94be605342e7e8b9b928e203bbd4bfd313949" | ||
474 | dependencies = [ | ||
475 | "bitvec", | ||
476 | "controlled-option", | ||
477 | "either", | ||
478 | "fxhash", | ||
479 | "itertools", | ||
480 | "libc", | ||
481 | "lsp-positions", | ||
482 | "serde", | ||
483 | "serde_json", | ||
484 | "smallvec", | ||
485 | "thiserror", | ||
486 | ] | ||
487 | |||
488 | [[package]] | ||
489 | name = "string-interner" | ||
490 | version = "0.12.2" | ||
491 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
492 | checksum = "383196d1876517ee6f9f0864d1fc1070331b803335d3c6daaa04bbcccd823c08" | ||
493 | dependencies = [ | ||
494 | "cfg-if", | ||
495 | "hashbrown 0.9.1", | ||
496 | ] | ||
497 | |||
498 | [[package]] | ||
499 | name = "syn" | ||
500 | version = "1.0.100" | ||
501 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
502 | checksum = "52205623b1b0f064a4e71182c3b18ae902267282930c6d5462c91b859668426e" | ||
503 | dependencies = [ | ||
504 | "proc-macro2", | ||
505 | "quote", | ||
506 | "unicode-ident", | ||
507 | ] | ||
508 | |||
509 | [[package]] | ||
510 | name = "tap" | ||
511 | version = "1.0.1" | ||
512 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
513 | checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" | ||
514 | |||
515 | [[package]] | ||
516 | name = "terminal_size" | 195 | name = "terminal_size" |
517 | version = "0.1.17" | 196 | version = "0.1.17" |
518 | source = "registry+https://github.com/rust-lang/crates.io-index" | 197 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -523,26 +202,6 @@ dependencies = [ | |||
523 | ] | 202 | ] |
524 | 203 | ||
525 | [[package]] | 204 | [[package]] |
526 | name = "thiserror" | ||
527 | version = "1.0.35" | ||
528 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
529 | checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" | ||
530 | dependencies = [ | ||
531 | "thiserror-impl", | ||
532 | ] | ||
533 | |||
534 | [[package]] | ||
535 | name = "thiserror-impl" | ||
536 | version = "1.0.35" | ||
537 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
538 | checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" | ||
539 | dependencies = [ | ||
540 | "proc-macro2", | ||
541 | "quote", | ||
542 | "syn", | ||
543 | ] | ||
544 | |||
545 | [[package]] | ||
546 | name = "tree-sitter" | 205 | name = "tree-sitter" |
547 | version = "0.20.9" | 206 | version = "0.20.9" |
548 | source = "registry+https://github.com/rust-lang/crates.io-index" | 207 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -573,91 +232,79 @@ dependencies = [ | |||
573 | ] | 232 | ] |
574 | 233 | ||
575 | [[package]] | 234 | [[package]] |
576 | name = "tree-sitter-graph" | 235 | name = "tree-sitter-javascript" |
577 | version = "0.6.1" | 236 | version = "0.20.0" |
578 | source = "registry+https://github.com/rust-lang/crates.io-index" | 237 | source = "registry+https://github.com/rust-lang/crates.io-index" |
579 | checksum = "18a4875525d5bbb4a27716eac5469f91370b2acb985c6a984c359abb19732e02" | 238 | checksum = "2490fab08630b2c8943c320f7b63473cbf65511c8d83aec551beb9b4375906ed" |
580 | dependencies = [ | 239 | dependencies = [ |
581 | "ansi_term", | 240 | "cc", |
582 | "log", | ||
583 | "regex", | ||
584 | "serde", | ||
585 | "serde_json", | ||
586 | "smallvec", | ||
587 | "string-interner", | ||
588 | "thiserror", | ||
589 | "tree-sitter", | 241 | "tree-sitter", |
590 | ] | 242 | ] |
591 | 243 | ||
592 | [[package]] | 244 | [[package]] |
593 | name = "tree-sitter-highlight" | 245 | name = "tree-sitter-json" |
594 | version = "0.20.1" | 246 | version = "0.20.0" |
595 | source = "registry+https://github.com/rust-lang/crates.io-index" | 247 | source = "git+https://github.com/tree-sitter/tree-sitter-json#73076754005a460947cafe8e03a8cf5fa4fa2938" |
596 | checksum = "042342584c5a7a0b833d9fc4e2bdab3f9868ddc6c4b339a1e01451c6720868bc" | ||
597 | dependencies = [ | 248 | dependencies = [ |
598 | "regex", | 249 | "cc", |
599 | "thiserror", | ||
600 | "tree-sitter", | 250 | "tree-sitter", |
601 | ] | 251 | ] |
602 | 252 | ||
603 | [[package]] | 253 | [[package]] |
604 | name = "tree-sitter-loader" | 254 | name = "tree-sitter-mdx" |
605 | version = "0.20.0" | 255 | version = "0.0.1" |
256 | source = "git+https://github.com/jlopezcur/tree-sitter-mdx#df43681bff333228fa60b69c09a1e7a6f9ed1610" | ||
257 | dependencies = [ | ||
258 | "cc", | ||
259 | "tree-sitter", | ||
260 | ] | ||
261 | |||
262 | [[package]] | ||
263 | name = "tree-sitter-php" | ||
264 | version = "0.19.1" | ||
265 | source = "git+https://github.com/tree-sitter/tree-sitter-php#d43130fd1525301e9826f420c5393a4d169819fc" | ||
266 | dependencies = [ | ||
267 | "cc", | ||
268 | "tree-sitter", | ||
269 | ] | ||
270 | |||
271 | [[package]] | ||
272 | name = "tree-sitter-python" | ||
273 | version = "0.20.2" | ||
606 | source = "registry+https://github.com/rust-lang/crates.io-index" | 274 | source = "registry+https://github.com/rust-lang/crates.io-index" |
607 | checksum = "d0b17eef4833c7c139abed66d562dfa23228e97e647597baf246fd56c21bbfaf" | 275 | checksum = "dda114f58048f5059dcf158aff691dffb8e113e6d2b50d94263fd68711975287" |
608 | dependencies = [ | 276 | dependencies = [ |
609 | "anyhow", | ||
610 | "cc", | 277 | "cc", |
611 | "dirs", | ||
612 | "libloading", | ||
613 | "once_cell", | ||
614 | "regex", | ||
615 | "serde", | ||
616 | "serde_json", | ||
617 | "tree-sitter", | 278 | "tree-sitter", |
618 | "tree-sitter-highlight", | ||
619 | "tree-sitter-tags", | ||
620 | ] | 279 | ] |
621 | 280 | ||
622 | [[package]] | 281 | [[package]] |
623 | name = "tree-sitter-rust" | 282 | name = "tree-sitter-r" |
624 | version = "0.20.1" | 283 | version = "0.19.5" |
625 | source = "registry+https://github.com/rust-lang/crates.io-index" | 284 | source = "registry+https://github.com/rust-lang/crates.io-index" |
626 | checksum = "13470fafb7327a3acf96f5bc1013b5539a899a182f01c59b5af53f6b93195717" | 285 | checksum = "522c13f4cc46213148b19d4ad40a988ffabd51fd90eb7de759844fbde49bda0c" |
627 | dependencies = [ | 286 | dependencies = [ |
628 | "cc", | 287 | "cc", |
629 | "tree-sitter", | 288 | "tree-sitter", |
630 | ] | 289 | ] |
631 | 290 | ||
632 | [[package]] | 291 | [[package]] |
633 | name = "tree-sitter-stack-graphs" | 292 | name = "tree-sitter-ruby" |
634 | version = "0.3.1" | 293 | version = "0.20.0" |
635 | source = "registry+https://github.com/rust-lang/crates.io-index" | 294 | source = "registry+https://github.com/rust-lang/crates.io-index" |
636 | checksum = "510004b313ced434bf04faa5d8e6e12e7cd80bb34231c6b132b0284966244f25" | 295 | checksum = "0ac30cbb1560363ae76e1ccde543d6d99087421e228cc47afcec004b86bb711a" |
637 | dependencies = [ | 296 | dependencies = [ |
638 | "anyhow", | 297 | "cc", |
639 | "controlled-option", | ||
640 | "itertools", | ||
641 | "lazy_static", | ||
642 | "log", | ||
643 | "lsp-positions", | ||
644 | "regex", | ||
645 | "stack-graphs", | ||
646 | "thiserror", | ||
647 | "tree-sitter", | 298 | "tree-sitter", |
648 | "tree-sitter-graph", | ||
649 | "tree-sitter-loader", | ||
650 | ] | 299 | ] |
651 | 300 | ||
652 | [[package]] | 301 | [[package]] |
653 | name = "tree-sitter-tags" | 302 | name = "tree-sitter-rust" |
654 | version = "0.20.2" | 303 | version = "0.20.3" |
655 | source = "registry+https://github.com/rust-lang/crates.io-index" | 304 | source = "registry+https://github.com/rust-lang/crates.io-index" |
656 | checksum = "ccb3f1376219530a37a809751ecf65aa35fd8b9c1c4ab6d4faf5f6a9eeda2c05" | 305 | checksum = "797842733e252dc11ae5d403a18060bf337b822fc2ae5ddfaa6ff4d9cc20bda6" |
657 | dependencies = [ | 306 | dependencies = [ |
658 | "memchr", | 307 | "cc", |
659 | "regex", | ||
660 | "thiserror", | ||
661 | "tree-sitter", | 308 | "tree-sitter", |
662 | ] | 309 | ] |
663 | 310 | ||
@@ -681,23 +328,18 @@ dependencies = [ | |||
681 | "tree-sitter", | 328 | "tree-sitter", |
682 | "tree-sitter-elm", | 329 | "tree-sitter-elm", |
683 | "tree-sitter-go", | 330 | "tree-sitter-go", |
331 | "tree-sitter-javascript", | ||
332 | "tree-sitter-json", | ||
333 | "tree-sitter-mdx", | ||
334 | "tree-sitter-php", | ||
335 | "tree-sitter-python", | ||
336 | "tree-sitter-r", | ||
337 | "tree-sitter-ruby", | ||
684 | "tree-sitter-rust", | 338 | "tree-sitter-rust", |
685 | "tree-sitter-typescript", | 339 | "tree-sitter-typescript", |
686 | ] | 340 | ] |
687 | 341 | ||
688 | [[package]] | 342 | [[package]] |
689 | name = "unicode-ident" | ||
690 | version = "1.0.4" | ||
691 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
692 | checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" | ||
693 | |||
694 | [[package]] | ||
695 | name = "unicode-segmentation" | ||
696 | version = "1.10.0" | ||
697 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
698 | checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" | ||
699 | |||
700 | [[package]] | ||
701 | name = "unicode-width" | 343 | name = "unicode-width" |
702 | version = "0.1.10" | 344 | version = "0.1.10" |
703 | source = "registry+https://github.com/rust-lang/crates.io-index" | 345 | source = "registry+https://github.com/rust-lang/crates.io-index" |
@@ -793,12 +435,3 @@ name = "windows_x86_64_msvc" | |||
793 | version = "0.36.1" | 435 | version = "0.36.1" |
794 | source = "registry+https://github.com/rust-lang/crates.io-index" | 436 | source = "registry+https://github.com/rust-lang/crates.io-index" |
795 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" | 437 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" |
796 | |||
797 | [[package]] | ||
798 | name = "wyz" | ||
799 | version = "0.4.0" | ||
800 | source = "registry+https://github.com/rust-lang/crates.io-index" | ||
801 | checksum = "129e027ad65ce1453680623c3fb5163cbf7107bfe1aa32257e7d0e63f9ced188" | ||
802 | dependencies = [ | ||
803 | "tap", | ||
804 | ] | ||
@@ -1,6 +1,5 @@ | |||
1 | [workspace] | 1 | [workspace] |
2 | 2 | ||
3 | members = [ | 3 | members = [ |
4 | "scope-viz", | ||
5 | "tree-viz" | 4 | "tree-viz" |
6 | ] | 5 | ] |
diff --git a/tree-viz/Cargo.toml b/tree-viz/Cargo.toml index 04107d3..ddac4f8 100644 --- a/tree-viz/Cargo.toml +++ b/tree-viz/Cargo.toml | |||
@@ -7,12 +7,19 @@ edition = "2021" | |||
7 | 7 | ||
8 | [dependencies] | 8 | [dependencies] |
9 | tree-sitter-elm = "5.6.3" | 9 | tree-sitter-elm = "5.6.3" |
10 | tree-sitter-rust = "0.20.1" | 10 | tree-sitter-ruby = "0.20.0" |
11 | tree-sitter-rust = "0.20.3" | ||
11 | tree-sitter = "^0.20.8" | 12 | tree-sitter = "^0.20.8" |
12 | console = "^0.15" | 13 | console = "^0.15" |
13 | once_cell = "1.14.0" | 14 | once_cell = "1.14.0" |
14 | tree-sitter-go = "0.19.1" | 15 | tree-sitter-go = "0.19.1" |
15 | tree-sitter-typescript = "0.20.1" | 16 | tree-sitter-typescript = "0.20.1" |
17 | tree-sitter-javascript = "0.20.0" | ||
18 | tree-sitter-mdx = { git = "https://github.com/jlopezcur/tree-sitter-mdx" } | ||
19 | tree-sitter-json = { git = "https://github.com/tree-sitter/tree-sitter-json" } | ||
20 | tree-sitter-python = "0.20.2" | ||
21 | tree-sitter-r = "0.19.5" | ||
22 | tree-sitter-php = { git = "https://github.com/tree-sitter/tree-sitter-php" } | ||
16 | 23 | ||
17 | [dependencies.notify] | 24 | [dependencies.notify] |
18 | version = "5.0.0" | 25 | version = "5.0.0" |
diff --git a/tree-viz/src/app.rs b/tree-viz/src/app.rs index 68d3641..8581084 100644 --- a/tree-viz/src/app.rs +++ b/tree-viz/src/app.rs | |||
@@ -105,6 +105,23 @@ impl App { | |||
105 | ) | 105 | ) |
106 | .unwrap(); | 106 | .unwrap(); |
107 | 107 | ||
108 | if self.config.show_field_name { | ||
109 | if let Some(f) = cursor.field_name() { | ||
110 | write!( | ||
111 | tree_string, | ||
112 | "{} ", | ||
113 | if in_capture.is_some() { | ||
114 | Style::new().on_yellow().on_bright() | ||
115 | } else { | ||
116 | Style::new() | ||
117 | } | ||
118 | .yellow() | ||
119 | .apply_to(f) | ||
120 | ) | ||
121 | .unwrap() | ||
122 | } | ||
123 | } | ||
124 | |||
108 | write!( | 125 | write!( |
109 | tree_string, | 126 | tree_string, |
110 | "{} ", | 127 | "{} ", |
diff --git a/tree-viz/src/config.rs b/tree-viz/src/config.rs index 6f34291..18ed5cc 100644 --- a/tree-viz/src/config.rs +++ b/tree-viz/src/config.rs | |||
@@ -5,6 +5,7 @@ pub struct Config { | |||
5 | pub indent_level: usize, | 5 | pub indent_level: usize, |
6 | pub show_ranges: bool, | 6 | pub show_ranges: bool, |
7 | pub show_src: bool, | 7 | pub show_src: bool, |
8 | pub show_field_name: bool, | ||
8 | } | 9 | } |
9 | 10 | ||
10 | impl Default for Config { | 11 | impl Default for Config { |
@@ -19,6 +20,7 @@ impl Config { | |||
19 | indent_level: 2, | 20 | indent_level: 2, |
20 | show_ranges: true, | 21 | show_ranges: true, |
21 | show_src: true, | 22 | show_src: true, |
23 | show_field_name: true, | ||
22 | } | 24 | } |
23 | } | 25 | } |
24 | } | 26 | } |
diff --git a/tree-viz/src/main.rs b/tree-viz/src/main.rs index 79964cb..9c73062 100644 --- a/tree-viz/src/main.rs +++ b/tree-viz/src/main.rs | |||
@@ -16,7 +16,14 @@ use once_cell::sync::Lazy; | |||
16 | use tree_sitter::Language; | 16 | use tree_sitter::Language; |
17 | 17 | ||
18 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_rust::language); | 18 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_rust::language); |
19 | pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_typescript::language_typescript); | 19 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_typescript::language_tsx); |
20 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_javascript::language); | ||
21 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_mdx::language); | ||
22 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_json::language); | ||
23 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_python::language); | ||
24 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_ruby::language); | ||
25 | //pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_r::language); | ||
26 | pub static LANGUAGE: Lazy<Language> = Lazy::new(tree_sitter_php::language); | ||
20 | 27 | ||
21 | fn main() { | 28 | fn main() { |
22 | let mut args = env::args(); | 29 | let mut args = env::args(); |