Yet another Tree-sitter integration effort. I had a few additional goals over basic syntax highlighting. I wanted to be able to intelligently detect certain conditions in disparate syntax nodes and highlight them specially. I also wanted to leverage the generated tree to jump from definition to definition. And I wanted make it highly configurable so I wouldn’t have to keep changing the code to do different things.
Under the hood after the initial tree creation, we’re editing the tree to make re-parsing faster. I’ve also threaded Acorn so that initialization and update happen asynchronously to kakoune so you can keep working while the plugin is doing it’s thing.
Definitely not perfect yet, but I’ve been daily driving this for about a year and I keep patching it as I find repeatable errors. Here’s a snip of the beginning of the readme; the rest can be found at https://github.com/JasonBrownDeveloper/Acorn.
Acorn
Leverages Tree-sitter to do more than syntax highlighting.
Built on top of danr’s fork of tomKPZ’s pykak, Acorn uses py-tree-sitter to integrate Tree-sitter utility into Kakoune.
Features
- Syntax highlighting
- Custom highlight queries
- Finer grain coloring
- Custom post processing for additional logic
- Navigation by tag