1
3
Fork
You've already forked koa
1

add tree-sitter integration #8

Merged
amartin merged 12 commits from push-yvpsqvqozonu into master 2025年09月11日 17:30:07 +02:00
No description provided.
amartin force-pushed push-yvpsqvqozonu from 050b3e0681 to a617c9c143 2025年09月03日 02:34:41 +02:00 Compare
amartin force-pushed push-yvpsqvqozonu from 4e163c091f to 7e9cc2e995 2025年09月03日 10:28:48 +02:00 Compare
Also refactor runtime embedding in the build system, add state and tree-sitter janet modules to build system
amartin force-pushed push-yvpsqvqozonu from 56d3f554c2 to ae3e460955 2025年09月06日 13:24:22 +02:00 Compare
Author
Owner
Copy link

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.

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.
amartin changed title from (削除) WIP: add tree-sitter integration (削除ここまで) to add tree-sitter integration 2025年09月11日 17:09:05 +02:00
Author
Owner
Copy link

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.

Right now the only things that are missing are: - Incremental buffer parsing<sup>1</sup>. - Properly handle queries path<sup>2</sup>. - Syntax highlighting<sup>3</sup>. <sup>1</sup>. It can be done easily I think, we can pass an old parsing tree to the `Parser.parseBuffer` function (`old_tree: ?*const Tree`). <sup>2</sup>. 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](https://github.com/ringtailsoftware/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. <sup>3</sup>. 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.
amartin deleted branch push-yvpsqvqozonu 2025年09月11日 17:30:09 +02:00
Sign in to join this conversation.
No reviewers
Labels
Clear labels
Compat
Breaking
Breaking change that won't be backward compatible
Kind
Bug
Something is not working
Kind
Documentation
Documentation changes
Kind
Enhancement
Improve existing functionality
Kind
Feature
New functionality
Kind
Security
This is security issue
Kind
Testing
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Priority
Undefined
The priority has to be defined
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amartin/koa!8
Reference in a new issue
amartin/koa
No description provided.
Delete branch "push-yvpsqvqozonu"

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?