Skip to content

Commit 28739d9

Browse files
authored
feat: use forked stack graphs (#7)
* feat: use forked stack graphs * chore: update readme
1 parent 0696147 commit 28739d9

File tree

4 files changed

+28
-27
lines changed

4 files changed

+28
-27
lines changed

Cargo.lock

Lines changed: 11 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,13 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
pyo3 = "0.20.0"
13-
stack-graphs = { version = "0.13.0", features = ["storage"] }
14-
tree-sitter-stack-graphs = { version = "0.8.1", features = ["cli"] }
15-
tree-sitter-stack-graphs-java = "0.3.0"
16-
tree-sitter-stack-graphs-javascript = "0.1.0"
17-
tree-sitter-stack-graphs-python = "0.1.0"
18-
tree-sitter-stack-graphs-typescript = "0.2.0"
13+
stack-graphs = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2", features = [
14+
"storage",
15+
] }
16+
tree-sitter-stack-graphs = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2", features = [
17+
"cli",
18+
] }
19+
tree-sitter-stack-graphs-java = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
20+
tree-sitter-stack-graphs-javascript = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
21+
tree-sitter-stack-graphs-python = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }
22+
tree-sitter-stack-graphs-typescript = { git = "https://github.com/nohehf/stack-graphs.git", rev = "9551ad995c79277d950ac2e0d5d9a2d5e42631e2" }

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

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

5+
(Note: the project curretly relies on [fork](https://github.com/nohehf/stack-graphs))
6+
57
It exposes a minimal, opinionated API to leverage the stack-graphs library for reference resolution in source code.
68

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

129131
- [ ] Add more testing, especially:
130132
- [ ] Test all supported languages (Java, ~~Python~~, ~~TypeScript~~, ~~JavaScript~~)
131-
- [ ] Test failing cases, eg. files that cannot be indexed
133+
- [x] Test failing cases, eg. files that cannot be indexed
132134
- [ ] Add options to the classes:
133135
- [ ] Verbosity
134136
- [ ] Force for the Indexer
135137
- [ ] Fail on error for the Indexer, or continue indexing
136-
- [ ] Handle the storage (database) in a dedicated class, and pass it to the Indexer and Querier
137-
- [ ] Add methods to query the indexing status (eg. which files have been indexed, which failed, etc.)
138-
- [ ] Rely on the main branch of stack-graphs, and update the bindings accordingly
138+
- [ ] Handle the storage (database) in a dedicated class, and pass it to the Indexer and Querier *-> this might not be necessary*
139+
- [x] Add methods to query the indexing status (eg. which files have been indexed, which failed, etc.)
140+
- [x] Rely on the main branch of stack-graphs, and update the bindings accordingly
139141
- [ ] Better error handling, return clear errors, test them and add them to the `.pyi` interface
140142
- [ ] Lint and format the rust code
141143
- [ ] CI/CD for the rust code

src/stack_graphs_wrapper/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub fn get_langauge_configuration(lang: &Language) -> LanguageConfiguration {
3636
tree_sitter_stack_graphs_javascript::language_configuration(&NoCancellation)
3737
}
3838
Language::TypeScript => {
39-
tree_sitter_stack_graphs_typescript::language_configuration(&NoCancellation)
39+
tree_sitter_stack_graphs_typescript::language_configuration_typescript(&NoCancellation)
4040
}
4141
Language::Java => tree_sitter_stack_graphs_java::language_configuration(&NoCancellation),
4242
}

0 commit comments

Comments
 (0)