This project defines tree-sitter-stack-graphs rules for Java using the tree-sitter-java grammar.
The project is organized as follows:
src/stack-graphs.tsg
.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.