Kak-tree-sitter – UNIX server bridging Kakoune with tree-sitter

Hi!

This is an announcement for kak-tree-sitter – that I started walking on a couple of weeks ago – a UNIX server / daemon for Kakoune providing external highlighting based on tree-sitter.

The end goals of kak-tree-sitter are

  • Semantic highlighting via tree-sitter. This is already supported.
  • Semantic objects, selections etc. This is not yet supported, but planned for ~soon.
  • Provide a CLI controller (ktsctl) to easy grammar / queries manipulation. This is already supported.

You can find the wiki here.

5 Likes

Moved from the other tree-sitter thread.

Please take this as the jest it’s intended to be, but you’re some kind of monster for inverting the color of comments by default.

In seriousness though, not being familiar with Rust, it did take me too long to figure out that I had to pass the -d flag along with --kakoune in my kakrc to get it to daemonize properly.

I like it so far and it’s snappy. I have a kak command that spell checks only comments that’s based on Clang’s AST that I’m going to try to convert over to your tree-sitter server.

It’s in the wiki though!

Please take this as the jest it’s intended to be, but you’re some kind of monster for inverting the color of comments by default.

I’m not sure what you’re talking about here. The default colorcheme is based on my config is temporary, until I find a solution to adapt to everyone’s colorscheme. I’m doing exactly the same thing as what Helix does.

I have a kak command that spell checks only comments that’s based on Clang’s AST that I’m going to try to convert over to your tree-sitter server.

There’s the comment grammar for that, which is really pretty good and customizing the queries should be fairly simple for your need.

ts_comment is defined with +i which I thought stood for “invert”, but now that I’m looking at the docs actually means “italic”. So it’s my terminal that is inverting color to represent italic.

It’s in the wiki now, but on Friday when I was trying it out the wiki was empty.

Edited to add that I had to set the default-terminal in my tmux config to get the italics to work properly.