diff options
| author | ObserverOfTime <chronobserver@disroot.org> | 2023-11-08 15:00:36 +0200 |
|---|---|---|
| committer | ObserverOfTime <chronobserver@disroot.org> | 2023-11-10 11:15:30 +0200 |
| commit | b09d645098844d1fc250ef8c7087846e4bdae32f (patch) | |
| tree | abc82262f16e84d5811952219d73faef25c2fa4b /queries | |
| parent | Update parsers: arduino, bitbake, chatito, dtd, erlang, gitattributes, gleam,... (diff) | |
| download | nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar.gz nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar.bz2 nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar.lz nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar.xz nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.tar.zst nvim-treesitter-b09d645098844d1fc250ef8c7087846e4bdae32f.zip | |
fix(kotlin): improve highlights
Co-authored-by: Anthony Shi <69449791+anthony-S93@users.noreply.github.com>
Diffstat (limited to 'queries')
| -rw-r--r-- | queries/kotlin/highlights.scm | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index f7b1b8c4d..36bf148f9 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -14,11 +14,15 @@ ((simple_identifier) @variable.builtin (#eq? @variable.builtin "field")) -; `this` this keyword inside classes -(this_expression) @variable.builtin +[ + "this" + "super" + "this@" + "super@" +] @variable.builtin -; `super` keyword inside classes -(super_expression) @variable.builtin +; NOTE: for consistency with "super@" +(super_expression "@" @variable.builtin) (class_parameter (simple_identifier) @property) @@ -114,8 +118,6 @@ (type_identifier) @function)? (#lua-match? @_import "^[a-z]")) -; TODO: Separate labeled returns/breaks/continue/super/this -; Must be implemented in the parser first (label) @label ;;; Function definitions @@ -309,14 +311,13 @@ ] @keyword [ - "suspend" -] @keyword.coroutine + "return" + "return@" +] @keyword.return -[ - "fun" -] @keyword.function +"suspend" @keyword.coroutine -(jump_expression) @keyword.return +"fun" @keyword.function [ "if" @@ -328,6 +329,10 @@ "for" "do" "while" + "continue" + "continue@" + "break" + "break@" ] @repeat [ @@ -412,6 +417,10 @@ "::" ] @punctuation.delimiter +(super_expression [ "<" ">" ] @punctuation.delimiter) +(type_arguments [ "<" ">" ] @punctuation.delimiter) +(type_parameters [ "<" ">" ] @punctuation.delimiter) + ; NOTE: `interpolated_identifier`s can be highlighted in any way (string_literal "$" @punctuation.special |
