forked from helix-editor/helix
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Groovy grammar (helix-editor#9350)
* Add Groovy grammar * Rewrite Neovim captures into Helix for Groovy * Simplify Groovy injections Co-authored-by: Michael Davis <[email protected]> * Remove Neovim's spell from Groovy highlights Co-authored-by: Michael Davis <[email protected]> * Apply suggestions to languages.toml * Escape backslash in groovy highlights.scm --------- Co-authored-by: Michael Davis <[email protected]>
- Loading branch information
Showing
4 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
(unit | ||
(identifier) @variable) | ||
|
||
(string | ||
(identifier) @variable) | ||
|
||
(escape_sequence) @constant.character.escape | ||
|
||
(block | ||
(unit | ||
(identifier) @namespace)) | ||
|
||
(func | ||
(identifier) @function) | ||
|
||
(number) @constant.numeric | ||
|
||
((identifier) @constant.builtin.boolean | ||
(#any-of? @constant.builtin.boolean "true" "false")) | ||
|
||
((identifier) @constant | ||
(#match? @constant "^[A-Z][A-Z\\d_]*$")) | ||
|
||
((identifier) @constant.builtin | ||
(#eq? @constant.builtin "null")) | ||
|
||
((identifier) @type | ||
(#any-of? @type | ||
"String" | ||
"Map" | ||
"Object" | ||
"Boolean" | ||
"Integer" | ||
"List")) | ||
|
||
((identifier) @function.builtin | ||
(#any-of? @function.builtin | ||
"void" | ||
"id" | ||
"version" | ||
"apply" | ||
"implementation" | ||
"testImplementation" | ||
"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 | ||
"assert" | ||
"new" | ||
"extends" | ||
"implements" | ||
"instanceof")) | ||
|
||
((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) @keyword.control.exception | ||
(#any-of? @keyword.control.exception | ||
"throw" | ||
"finally" | ||
"try" | ||
"catch")) | ||
|
||
(string) @string | ||
|
||
[ | ||
(line_comment) | ||
(block_comment) | ||
] @comment | ||
|
||
((block_comment) @comment.block.documentation | ||
(#match? @comment.block.documentation "^/[*][*][^*](?s:.)*[*]/$")) | ||
|
||
((line_comment) @comment.block.documentation | ||
(#match? @comment.block.documentation "^///[^/]*.*$")) | ||
|
||
[ | ||
(operators) | ||
(leading_key) | ||
] @operator | ||
|
||
["(" ")" "[" "]" "{" "}"] @punctuation.bracket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
([(line_comment) (block_comment)] @injection.content | ||
(#set! injection.language "comment")) |