fork of https://github.com/tree-sitter/tree-sitter-graph
1# tree-sitter-graph
2
3[](https://zenodo.org/badge/latestdoi/368886913)
4
5The `tree-sitter-graph` library defines a DSL for constructing arbitrary graph
6structures from source code that has been parsed using [tree-sitter][].
7
8[tree-sitter]: https://tree-sitter.github.io/
9
10- [Language Reference](https://docs.rs/tree-sitter-graph/*/tree_sitter_graph/reference/)
11- [API documentation](https://docs.rs/tree-sitter-graph/)
12- [Release notes](https://github.com/tree-sitter/tree-sitter-graph/blob/main/CHANGELOG.md)
13- [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=tree-sitter.tree-sitter-graph)
14
15## Usage
16
17This package can be used either as a library or command-line program.
18
19To use it as a library, add the following to your `Cargo.toml`:
20
21``` toml
22[dependencies]
23tree-sitter-graph = "0.12"
24```
25
26To use it as a program, install it via `cargo install`:
27
28```
29$ cargo install --features cli tree-sitter-graph
30$ tree-sitter-graph --help
31```
32
33## Development
34
35The project is written in Rust, and requires a recent version installed.
36Rust can be installed and updated using [rustup][].
37
38[rustup]: https://rustup.rs/
39
40Build the project by running:
41
42```
43$ cargo build
44```
45
46Run the tests by running:
47
48```
49$ cargo test
50```
51
52The project consists of a library and a CLI.
53By default, running `cargo` only applies to the library.
54To run `cargo` commands on the CLI as well, add `--features cli` or `--all-features`.
55
56Sources are formatted using the standard Rust formatted, which is applied by running:
57
58```
59$ cargo fmt
60```