smacker / go-tree-sitter

Golang bindings for tree-sitter https://github.com/tree-sitter/tree-sitter
MIT License
447 stars 124 forks source link

Added Go based automation to update treesitter source. Also bumped to v0.20.8 #138

Closed micksmix closed 11 months ago

micksmix commented 11 months ago

Wrote a Go program (lives in _automation/treesitter_updater) that automates the process of downloading, extracting, and processing the specified version of the Tree Sitter library. It's designed to simplify the updating of the upstream Tree Sitter library for use in this project.

Usage

If you want to change the version of the treesitter library that is retrieved, update the sitterVersion variable in main.go.

Note, you must run this script from within the _automation/treesitter_updater directory because it makes an assumption that the final destination for the .C and .H files is 2 directories up from it's current directory.

cd _automation/treesitter_updater
go run main.go

The success / failure will be printed to stdout, as well as a list of (1) new files and (2) replaced files.

I used this automation to bump the version of treesitter to v0.20.8.

This updated version also resolves this issue: https://github.com/smacker/go-tree-sitter/issues/136

micksmix commented 11 months ago

If you'd prefer, I can provide just the update automation and you can bump it yourself.

smacker commented 11 months ago

Great work! Thank you