Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'runtime/queries/java/highlights.scm')
-rw-r--r--runtime/queries/java/highlights.scm109
1 files changed, 7 insertions, 102 deletions
diff --git a/runtime/queries/java/highlights.scm b/runtime/queries/java/highlights.scm
index 1f5da9c6..e7d793df 100644
--- a/runtime/queries/java/highlights.scm
+++ b/runtime/queries/java/highlights.scm
@@ -1,5 +1,3 @@
-(identifier) @variable
-
; Methods
(method_declaration
@@ -15,14 +13,14 @@
(marker_annotation
name: (identifier) @attribute)
+"@" @operator
+
; Types
(interface_declaration
name: (identifier) @type)
(class_declaration
name: (identifier) @type)
-(record_declaration
- name: (identifier) @type)
(enum_declaration
name: (identifier) @type)
@@ -35,8 +33,6 @@
(constructor_declaration
name: (identifier) @type)
-(compact_constructor_declaration
- name: (identifier) @type)
(type_identifier) @type
@@ -48,14 +44,13 @@
(void_type)
] @type.builtin
-(type_arguments
- (wildcard "?" @type.builtin))
-
; Variables
((identifier) @constant
(#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
+(identifier) @variable
+
(this) @variable.builtin
; Literals
@@ -64,19 +59,13 @@
(hex_integer_literal)
(decimal_integer_literal)
(octal_integer_literal)
- (binary_integer_literal)
-] @constant.numeric.integer
-
-[
(decimal_floating_point_literal)
(hex_floating_point_literal)
-] @constant.numeric.float
-
-(character_literal) @constant.character
+] @number
[
+ (character_literal)
(string_literal)
- (text_block)
] @string
[
@@ -85,86 +74,7 @@
(null_literal)
] @constant.builtin
-(line_comment) @comment
-(block_comment) @comment
-
-; Punctuation
-
-[
- "::"
- "."
- ";"
- ","
-] @punctuation.delimiter
-
-[
- "@"
- "..."
-] @punctuation.special
-
-[
- "("
- ")"
- "["
- "]"
- "{"
- "}"
-] @punctuation.bracket
-
-(type_arguments
- [
- "<"
- ">"
- ] @punctuation.bracket)
-
-(type_parameters
- [
- "<"
- ">"
- ] @punctuation.bracket)
-
-; Operators
-
-[
- "="
- ">"
- "<"
- "!"
- "~"
- "?"
- ":"
- "->"
- "=="
- ">="
- "<="
- "!="
- "&&"
- "||"
- "++"
- "--"
- "+"
- "-"
- "*"
- "/"
- "&"
- "|"
- "^"
- "%"
- "<<"
- ">>"
- ">>>"
- "+="
- "-="
- "*="
- "/="
- "&="
- "|="
- "^="
- "%="
- "<<="
- ">>="
- ">>>="
-] @operator
+(comment) @comment
; Keywords
@@ -193,19 +103,15 @@
"module"
"native"
"new"
- "non-sealed"
"open"
"opens"
"package"
- "permits"
"private"
"protected"
"provides"
"public"
"requires"
- "record"
"return"
- "sealed"
"static"
"strictfp"
"switch"
@@ -220,5 +126,4 @@
"volatile"
"while"
"with"
- "yield"
] @keyword