Skip to content

Commit

Permalink
feat: use forked stack graphs (#7)
Browse files Browse the repository at this point in the history
* feat: use forked stack graphs

* chore: update readme
  • Loading branch information
nohehf authored May 27, 2024
1 parent 0696147 commit 28739d9
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
27 changes: 11 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 10 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ crate-type = ["cdylib"]

[dependencies]
pyo3 = "0.20.0"
stack-graphs = { version = "0.13.0", features = ["storage"] }
tree-sitter-stack-graphs = { version = "0.8.1", features = ["cli"] }
tree-sitter-stack-graphs-java = "0.3.0"
tree-sitter-stack-graphs-javascript = "0.1.0"
tree-sitter-stack-graphs-python = "0.1.0"
tree-sitter-stack-graphs-typescript = "0.2.0"
stack-graphs = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2", features = [
"storage",
] }
tree-sitter-stack-graphs = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2", features = [
"cli",
] }
tree-sitter-stack-graphs-java = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
tree-sitter-stack-graphs-javascript = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
tree-sitter-stack-graphs-python = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
tree-sitter-stack-graphs-typescript = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Opinionated Python bindings for the [tree-sitter-stack-graphs](https://github.com/github/stack-graphs) rust library.

(Note: the project curretly relies on [fork](https://github.com/nohehf/stack-graphs))

It exposes a minimal, opinionated API to leverage the stack-graphs library for reference resolution in source code.

The rust bindings are built using [PyO3](https://pyo3.rs) and [maturin](https://maturin.rs).
Expand Down Expand Up @@ -128,14 +130,14 @@ Before releasing 0.1.0, which I expect to be a first stable API, the following n

- [ ] Add more testing, especially:
- [ ] Test all supported languages (Java, ~~Python~~, ~~TypeScript~~, ~~JavaScript~~)
- [ ] Test failing cases, eg. files that cannot be indexed
- [x] Test failing cases, eg. files that cannot be indexed
- [ ] Add options to the classes:
- [ ] Verbosity
- [ ] Force for the Indexer
- [ ] Fail on error for the Indexer, or continue indexing
- [ ] Handle the storage (database) in a dedicated class, and pass it to the Indexer and Querier
- [ ] Add methods to query the indexing status (eg. which files have been indexed, which failed, etc.)
- [ ] Rely on the main branch of stack-graphs, and update the bindings accordingly
- [ ] Handle the storage (database) in a dedicated class, and pass it to the Indexer and Querier *-> this might not be necessary*
- [x] Add methods to query the indexing status (eg. which files have been indexed, which failed, etc.)
- [x] Rely on the main branch of stack-graphs, and update the bindings accordingly
- [ ] Better error handling, return clear errors, test them and add them to the `.pyi` interface
- [ ] Lint and format the rust code
- [ ] CI/CD for the rust code
Expand Down
2 changes: 1 addition & 1 deletion src/stack_graphs_wrapper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub fn get_langauge_configuration(lang: &Language) -> LanguageConfiguration {
tree_sitter_stack_graphs_javascript::language_configuration(&NoCancellation)
}
Language::TypeScript => {
tree_sitter_stack_graphs_typescript::language_configuration(&NoCancellation)
tree_sitter_stack_graphs_typescript::language_configuration_typescript(&NoCancellation)
}
Language::Java => tree_sitter_stack_graphs_java::language_configuration(&NoCancellation),
}
Expand Down

0 comments on commit 28739d9

Please sign in to comment.