diff options
| author | Amaan Qureshi <amaanq12@gmail.com> | 2023-03-26 14:45:50 -0400 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2023-03-26 23:17:24 +0200 |
| commit | e559b6fb3f1b09d96568705c668abb8c55b7e3e4 (patch) | |
| tree | 593eacd317d76b2434a9701409565432410bc3dd /queries/kotlin | |
| parent | fix(rockspec): add doc folder to rockspec (#4562) (diff) | |
| download | nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar.gz nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar.bz2 nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar.lz nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar.xz nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.tar.zst nvim-treesitter-e559b6fb3f1b09d96568705c668abb8c55b7e3e4.zip | |
feat(kotlin): update queries from upstream changes
Diffstat (limited to 'queries/kotlin')
| -rw-r--r-- | queries/kotlin/highlights.scm | 32 | ||||
| -rw-r--r-- | queries/kotlin/injections.scm | 11 |
2 files changed, 19 insertions, 24 deletions
diff --git a/queries/kotlin/highlights.scm b/queries/kotlin/highlights.scm index 679cc0ad6..f7b1b8c4d 100644 --- a/queries/kotlin/highlights.scm +++ b/queries/kotlin/highlights.scm @@ -217,9 +217,12 @@ ;;; Literals -(comment) @comment @spell +[ + (line_comment) + (multiline_comment) +] @comment @spell -((comment) @comment.documentation +((multiline_comment) @comment.documentation (#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$")) (shebang_line) @preproc @@ -240,19 +243,16 @@ (character_literal) @character -[ - (line_string_literal) - (multi_line_string_literal) -] @string +(string_literal) @string ; NOTE: Escapes not allowed in multi-line strings -(line_string_literal (character_escape_seq) @string.escape) +(character_literal (character_escape_seq) @string.escape) ; There are 3 ways to define a regex ; - "[abc]?".toRegex() (call_expression (navigation_expression - ([(line_string_literal) (multi_line_string_literal)] @string.regex) + ((string_literal) @string.regex) (navigation_suffix ((simple_identifier) @_function (#eq? @_function "toRegex"))))) @@ -264,7 +264,7 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @string.regex)))) + (string_literal) @string.regex)))) ; - Regex.fromLiteral("[abc]?") (call_expression @@ -277,7 +277,7 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @string.regex)))) + (string_literal) @string.regex)))) ;;; Keywords @@ -413,18 +413,10 @@ ] @punctuation.delimiter ; NOTE: `interpolated_identifier`s can be highlighted in any way -(line_string_literal +(string_literal "$" @punctuation.special (interpolated_identifier) @none @variable) -(line_string_literal - "${" @punctuation.special - (interpolated_expression) @none - "}" @punctuation.special) - -(multi_line_string_literal - "$" @punctuation.special - (interpolated_identifier) @none @variable) -(multi_line_string_literal +(string_literal "${" @punctuation.special (interpolated_expression) @none "}" @punctuation.special) diff --git a/queries/kotlin/injections.scm b/queries/kotlin/injections.scm index 371345cfd..7ba4d9494 100644 --- a/queries/kotlin/injections.scm +++ b/queries/kotlin/injections.scm @@ -1,10 +1,13 @@ -(comment) @comment +[ + (line_comment) + (multiline_comment) +] @comment ; There are 3 ways to define a regex ; - "[abc]?".toRegex() (call_expression (navigation_expression - ([(line_string_literal) (multi_line_string_literal)] @regex) + ((string_literal) @regex) (navigation_suffix ((simple_identifier) @_function (#eq? @_function "toRegex"))))) @@ -16,7 +19,7 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @regex)))) + (string_literal) @regex)))) ; - Regex.fromLiteral("[abc]?") (call_expression @@ -29,4 +32,4 @@ (call_suffix (value_arguments (value_argument - [ (line_string_literal) (multi_line_string_literal) ] @regex)))) + (string_literal) @regex)))) |
