Closed segevfiner closed 2 months ago
Fixed the Go bindings.
The rest of the bindings build the grammar into a single shared library, I see no reason that it must have two separate libraries, I was able to modify the makefile to produce one...
The rest of the bindings build the grammar into a single shared library, I see no reason that it must have two separate libraries, I was able to modify the makefile to produce one...
One of the purposes of the C bindings is to build libraries that can be used in editors and Neovim for one can't load multiple languages from the same library.
Fixed the Go bindings.
You also need to update the test.
func TestCanLoadTypeScriptGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_typescript.TypeScriptLanguage())
if language == nil {
t.Errorf("Error loading TypeScript grammar")
}
}
func TestCanLoadTSXGrammar(t *testing.T) {
language := tree_sitter.NewLanguage(tree_sitter_typescript.TSXLanguage())
if language == nil {
t.Errorf("Error loading TSX grammar")
}
}
As someone new to the library, I'm leveraging this thread to seek clarification.
I'm exploring the TypeScript grammar integration with Python (https://github.com/tree-sitter/py-tree-sitter) and noticed there isn't a pip package for TypeScript grammar, similar to the ones for Python grammar (https://github.com/tree-sitter/tree-sitter-python/tree/master/bindings) and JavaScript grammar (https://github.com/tree-sitter/tree-sitter-javascript/tree/master/bindings).
I am trying to avoid building the typescript library. I may have overlooked something, so I'm reaching out for clarification. Is there a reason for this?
This is especially relevant considering the deprecation notice on the python py-tree-sitter repository, which advises when speaking about building the libraries:
This method of loading languages is deprecated and will be removed in v0.22.0. It should only be used for languages that lack updated bindings, and a C compiler will be necessary in those instances.
https://github.com/tree-sitter/py-tree-sitter?tab=readme-ov-file#build-from-source
Any insights you can share would be greatly appreciated
hey @segevfiner I think you forgot to also update tree-sitter
in the Cargo.toml
[dependencies]
tree-sitter = "~0.20.10" -> "~0.21.0"
superseded by #294
Still need to adjust the Makefile for the C bindings, review the Rust bindings for any updates needed, and update the workflows.
Checklist