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