tree-sitter-kotlin
tree-sitter-kotlin copied to clipboard
Add syntax highlighting queries
This is largely based on the nvim-treesitter highlighting, but enables other tree-sitter-kotlin projects to include syntax highlighting.
Wow, this is pretty cool, thanks!
I haven't looked that much into tree-sitter's built-in support for syntax highlighting yet, but I hope to find some time to do so soon and get this merged.
Tree sitter wasm is giving me some errors with this one
RangeError: Bad node name 'character_escape_seq'
and when I comment that one out I get
Bad node name '' (seems something with the operator section, but can't figure out what)
Edit:
"?." and "!is"
Has there been any update on this pr? I'm keen to try it! :)
Finally got a chance to play with this in Neovim [1] and with some minor tweaks in 05ef579 to update it for the current grammar I could get this to work. Thanks a lot for looking into this!
Going forward we should make sure that CI tests the queries to make sure that the node names stay in sync, but that is out-of-scope for this PR.
[1] If anyone would like to try this out:
- Compile the parser to a dynamic library using
make(thanks to #58 this is pretty easy now!) - Place it under
<runtimepath>/parser/kotlin.{dylib,so} - Place the queries under
<runtimepath>/queries/kotlin/highlights.scm - Run
:lua vim.treesitter.start()in a Neovim instance from a Kotlin source file
Great news thanks @Wilfred and @fwcd. Could we make a new release so that we can update treesitter with TSUpdate? :)