Highlight query improvements for java and typescript (#7145)

* Add missing queries to java highlights

* Fix generic type bracket highlights in typescript
pull/7152/head
Gammut 2 years ago committed by GitHub
parent 61a89956e3
commit 86ef389c0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,8 +13,6 @@
(marker_annotation (marker_annotation
name: (identifier) @attribute) name: (identifier) @attribute)
"@" @operator
; Types ; Types
(interface_declaration (interface_declaration
@ -48,6 +46,9 @@
(void_type) (void_type)
] @type.builtin ] @type.builtin
(type_arguments
(wildcard "?" @type.builtin))
; Variables ; Variables
((identifier) @constant ((identifier) @constant
@ -87,6 +88,84 @@
(line_comment) @comment (line_comment) @comment
(block_comment) @comment (block_comment) @comment
; Punctuation
[
"::"
"."
";"
","
] @punctuation.delimiter
[
"@"
"..."
] @punctuation.special
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(type_arguments
[
"<"
">"
] @punctuation.bracket)
(type_parameters
[
"<"
">"
] @punctuation.bracket)
; Operators
[
"="
">"
"<"
"!"
"~"
"?"
":"
"->"
"=="
">="
"<="
"!="
"&&"
"||"
"++"
"--"
"+"
"-"
"*"
"/"
"&"
"|"
"^"
"%"
"<<"
">>"
">>>"
"+="
"-="
"*="
"/="
"&="
"|="
"^="
"%="
"<<="
">>="
">>>="
] @operator
; Keywords ; Keywords
[ [

@ -5,7 +5,6 @@
(ambient_declaration "global" @namespace) (ambient_declaration "global" @namespace)
; Variables ; Variables
(required_parameter (identifier) @variable.parameter) (required_parameter (identifier) @variable.parameter)
@ -22,8 +21,6 @@
(conditional_type ["?" ":"] @operator) (conditional_type ["?" ":"] @operator)
; Keywords ; Keywords
[ [
@ -50,16 +47,22 @@
"readonly" "readonly"
] @keyword.storage.modifier ] @keyword.storage.modifier
; inherits: ecma
; Types ; Types
(type_identifier) @type (type_identifier) @type
(predefined_type) @type.builtin (predefined_type) @type.builtin
(type_arguments (type_arguments
"<" @punctuation.bracket [
">" @punctuation.bracket) "<"
">"
] @punctuation.bracket)
(type_parameters
[
"<"
">"
] @punctuation.bracket)
((identifier) @type ((identifier) @type
(#match? @type "^[A-Z]")) (#match? @type "^[A-Z]"))
@ -75,3 +78,5 @@
(template_type (template_type
"${" @punctuation.special "${" @punctuation.special
"}" @punctuation.special) @embedded "}" @punctuation.special) @embedded
; inherits: ecma

Loading…
Cancel
Save