add tree-sitter integration #8
push-yvpsqvqozonu into master 050b3e0681
to a617c9c143
4e163c091f
to 7e9cc2e995
Also refactor runtime embedding in the build system, add state and tree-sitter janet modules to build system
56d3f554c2
to ae3e460955
Missing code: Janet runtime files modification to use the tree-sitter bridge and parse the buffer when loading the files in the buffer.janet runtime file.
NB: syntax highlighting will be tricky, and it will require TS queries support in the bridge. I'm not bothered to deal with it right now as we need more work before getting syntax highlighting to work anyway such as proper colorschemes and such. Might be addressed in the future.
Right now the only things that are missing are:
- Incremental buffer parsing1.
- Properly handle queries path2.
- Syntax highlighting3.
1. It can be done easily I think, we can pass an old parsing tree to the Parser.parseBuffer function (old_tree: ?*const Tree).
2. Currently, I've made it so that embedded tree-sitter parsers install their queries into the ./zig-out/queries/ prefix or whatever the installation directory is when running zig build. However, that is not optimal for release builds yet. Ideally we should embed the whole bundle somehow, maybe using zig-embeddir to alleviate the pain. This will be addressed in another Pull Request as I want to tackle down other concerns at the moment.
3. This is more tricky and requires way more changes and effort, so it is out of the scope of the pull request to fully implement that feature. It requires a colorschemes system (even an unga bunga one would work), tree-sitter interop with vaxis through the Janet runtime and so on.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?