Skip to content

Commit

Permalink
Rewrite Neovim captures into Helix for Groovy
Browse files Browse the repository at this point in the history
  • Loading branch information
chernetskyi committed Feb 19, 2024
1 parent 6290349 commit 0787251
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions runtime/queries/groovy/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
(unit
(identifier) @variable)

(string
(identifier) @variable)

(escape_sequence) @string.escape
(escape_sequence) @constant.character.escape

(block
(unit
Expand All @@ -12,13 +13,13 @@
(func
(identifier) @function)

(number) @number
(number) @constant.numeric

((identifier) @boolean
(#any-of? @boolean "true" "false" "True" "False"))
((identifier) @constant.builtin.boolean
(#any-of? @constant.builtin.boolean "true" "false"))

((identifier) @constant
(#lua-match? @constant "^[A-Z][A-Z%d_]*$"))
(#match? @constant "^[A-Z][A-Z\d_]*$"))

((identifier) @constant.builtin
(#eq? @constant.builtin "null"))
Expand All @@ -43,29 +44,32 @@
"androidTestImplementation"
"debugImplementation"))

((identifier) @keyword.storage.modifier
(#eq? @keyword.storage.modifier "static"))

((identifier) @keyword.storage.type
(#any-of? @keyword.storage.type "class" "def" "interface"))

((identifier) @keyword
(#any-of? @keyword
"static"
"class"
"def"
"import"
"package"
"assert"
"new"
"extends"
"implements"
"instanceof"
"interface"
"new"))
"instanceof"))

((identifier) @type.qualifier
(#any-of? @type.qualifier
((identifier) @keyword.control.import
(#any-of? @keyword.control.import "import" "package"))

((identifier) @keyword.storage.modifier
(#any-of? @keyword.storage.modifier
"abstract"
"protected"
"private"
"public"))

((identifier) @exception
(#any-of? @exception
((identifier) @keyword.control.exception
(#any-of? @keyword.control.exception
"throw"
"finally"
"try"
Expand All @@ -78,14 +82,11 @@
(block_comment)
] @comment @spell

((block_comment) @comment.documentation
(#lua-match? @comment.documentation "^/[*][*][^*].*[*]/$"))

((line_comment) @comment.documentation
(#lua-match? @comment.documentation "^///[^/]"))
((block_comment) @comment.block.documentation
(#match? @comment.block.documentation "^/[*][*][^*](?s:.)*[*]/$"))

((line_comment) @comment.documentation
(#lua-match? @comment.documentation "^///$"))
((line_comment) @comment.block.documentation
(#match? @comment.block.documentation "^///[^/]*.*$"))

[
(operators)
Expand Down

0 comments on commit 0787251

Please sign in to comment.