mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-16 02:10:15 -04:00
fix(kotlin): improve highlights
Co-authored-by: Anthony Shi <69449791+anthony-S93@users.noreply.github.com>
This commit is contained in:
parent
8996612bfb
commit
b09d645098
1 changed files with 21 additions and 12 deletions
|
|
@ -14,11 +14,15 @@
|
||||||
((simple_identifier) @variable.builtin
|
((simple_identifier) @variable.builtin
|
||||||
(#eq? @variable.builtin "field"))
|
(#eq? @variable.builtin "field"))
|
||||||
|
|
||||||
; `this` this keyword inside classes
|
[
|
||||||
(this_expression) @variable.builtin
|
"this"
|
||||||
|
"super"
|
||||||
|
"this@"
|
||||||
|
"super@"
|
||||||
|
] @variable.builtin
|
||||||
|
|
||||||
; `super` keyword inside classes
|
; NOTE: for consistency with "super@"
|
||||||
(super_expression) @variable.builtin
|
(super_expression "@" @variable.builtin)
|
||||||
|
|
||||||
(class_parameter
|
(class_parameter
|
||||||
(simple_identifier) @property)
|
(simple_identifier) @property)
|
||||||
|
|
@ -114,8 +118,6 @@
|
||||||
(type_identifier) @function)?
|
(type_identifier) @function)?
|
||||||
(#lua-match? @_import "^[a-z]"))
|
(#lua-match? @_import "^[a-z]"))
|
||||||
|
|
||||||
; TODO: Separate labeled returns/breaks/continue/super/this
|
|
||||||
; Must be implemented in the parser first
|
|
||||||
(label) @label
|
(label) @label
|
||||||
|
|
||||||
;;; Function definitions
|
;;; Function definitions
|
||||||
|
|
@ -309,14 +311,13 @@
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
[
|
[
|
||||||
"suspend"
|
"return"
|
||||||
] @keyword.coroutine
|
"return@"
|
||||||
|
] @keyword.return
|
||||||
|
|
||||||
[
|
"suspend" @keyword.coroutine
|
||||||
"fun"
|
|
||||||
] @keyword.function
|
|
||||||
|
|
||||||
(jump_expression) @keyword.return
|
"fun" @keyword.function
|
||||||
|
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
|
|
@ -328,6 +329,10 @@
|
||||||
"for"
|
"for"
|
||||||
"do"
|
"do"
|
||||||
"while"
|
"while"
|
||||||
|
"continue"
|
||||||
|
"continue@"
|
||||||
|
"break"
|
||||||
|
"break@"
|
||||||
] @repeat
|
] @repeat
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -412,6 +417,10 @@
|
||||||
"::"
|
"::"
|
||||||
] @punctuation.delimiter
|
] @punctuation.delimiter
|
||||||
|
|
||||||
|
(super_expression [ "<" ">" ] @punctuation.delimiter)
|
||||||
|
(type_arguments [ "<" ">" ] @punctuation.delimiter)
|
||||||
|
(type_parameters [ "<" ">" ] @punctuation.delimiter)
|
||||||
|
|
||||||
; NOTE: `interpolated_identifier`s can be highlighted in any way
|
; NOTE: `interpolated_identifier`s can be highlighted in any way
|
||||||
(string_literal
|
(string_literal
|
||||||
"$" @punctuation.special
|
"$" @punctuation.special
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue