#tree-sitter #stack-graphs #java

bin+lib tree-sitter-stack-graphs-java

Stack graphs for the Java programming language

3 releases (breaking)

0.2.0 Mar 22, 2023
0.1.0 Feb 14, 2023
0.0.1 Feb 1, 2023

#482 in Development tools

Download history 5/week @ 2023-02-05 29/week @ 2023-02-12 6/week @ 2023-02-19 22/week @ 2023-02-26 285/week @ 2023-03-05 388/week @ 2023-03-12 289/week @ 2023-03-19 333/week @ 2023-03-26 110/week @ 2023-04-02 328/week @ 2023-04-09 302/week @ 2023-04-16 303/week @ 2023-04-23 343/week @ 2023-04-30 211/week @ 2023-05-07 78/week @ 2023-05-14 79/week @ 2023-05-21

730 downloads per month

MIT/Apache

170KB
3.5K SLoC

Rust 3K SLoC // 0.0% comments Java 459 SLoC // 0.2% comments JavaScript 37 SLoC

tree-sitter-stack-graphs definition for Java

This project defines tree-sitter-stack-graphs rules for Java using the tree-sitter-java grammar.

Local Development

The project is organized as follows:

  • The stack graph rules are defined in src/stack-graphs.tsg.
  • Tests are put into the test directory.

The following commands are intended to be run from the repo root.

Run all tests in the project by executing the following:

cargo test -p tree-sitter-stack-graphs-java

Parse a single test file: cargo run -p tree-sitter-stack-graphs-java -- parse OPTIONS FILENAME

Test a single file: cargo run -p tree-sitter-stack-graphs-java -- test OPTIONS FILENAME

For debugging purposes, it is useful to run the visualization tool to generate graphs for the tests being run.

To run a test and generate the visualization:

cargo run -p tree-sitter-stack-graphs-java -- test --output-mode=always -V=%r/%d/%n.html FILENAME

Go to https://crates.io/crates/tree-sitter-stack-graphs for links to examples and documentation.

Dependencies

~10–17MB
~337K SLoC