Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/kotlin/highlights.scm')
| -rw-r--r-- | runtime/queries/kotlin/highlights.scm | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/runtime/queries/kotlin/highlights.scm b/runtime/queries/kotlin/highlights.scm index 5b19f849..11fae331 100644 --- a/runtime/queries/kotlin/highlights.scm +++ b/runtime/queries/kotlin/highlights.scm @@ -1,21 +1,20 @@ -;;; Operators & Punctuation +;;; Identifiers +(simple_identifier) @variable -(multi_line_string_literal - "$" @punctuation - (interpolated_identifier) @none) -(multi_line_string_literal - "${" @punctuation - (interpolated_expression) @none - "}" @punctuation.) +; `field` keyword inside property getter/setter +; FIXME: This will highlight the keyword outside of getters and setters +; since tree-sitter does not allow us to check for arbitrary nestation +((simple_identifier) @variable.builtin +(#eq? @variable.builtin "field")) -; NOTE: `interpolated_identifier`s can be highlighted in any way -(line_string_literal - "$" @punctuation - (interpolated_identifier) @none) -(line_string_literal - "${" @punctuation - (interpolated_expression) @none - "}" @punctuation) +; `it` keyword inside lambdas +; FIXME: This will highlight the keyword outside of lambdas since tree-sitter +; does not allow us to check for arbitrary nestation +((simple_identifier) @variable.builtin +(#eq? @variable.builtin "it")) + + +;;; Operators & Punctuation [ "." @@ -69,6 +68,23 @@ "->" ] @operator +(multi_line_string_literal + "$" @punctuation + (interpolated_identifier) @none) +(multi_line_string_literal + "${" @punctuation + (interpolated_expression) @none + "}" @punctuation.) + +; NOTE: `interpolated_identifier`s can be highlighted in any way +(line_string_literal + "$" @punctuation + (interpolated_identifier) @none) +(line_string_literal + "${" @punctuation + (interpolated_expression) @none + "}" @punctuation) + ;;; Keywords (type_alias "typealias" @keyword) @@ -281,18 +297,3 @@ ; `this` this keyword inside classes (this_expression) @variable.builtin - -;;; Identifiers -; `field` keyword inside property getter/setter -; FIXME: This will highlight the keyword outside of getters and setters -; since tree-sitter does not allow us to check for arbitrary nestation -((simple_identifier) @variable.builtin -(#eq? @variable.builtin "field")) - -; `it` keyword inside lambdas -; FIXME: This will highlight the keyword outside of lambdas since tree-sitter -; does not allow us to check for arbitrary nestation -((simple_identifier) @variable.builtin -(#eq? @variable.builtin "it")) - -(simple_identifier) @variable |