highlights(dart): use more specific groups

This commit is contained in:
ObserverOfTime 2022-10-22 14:00:28 +03:00
parent f30ae4da0d
commit fe2ee54f3b

View file

@ -104,14 +104,14 @@
(type_identifier) @type (type_identifier) @type
(type_alias
(type_identifier) @type.definition)
; Variables ; Variables
; -------------------- ; --------------------
; var keyword ; var keyword
(inferred_type) @keyword (inferred_type) @keyword
(const_builtin) @constant.builtin
(final_builtin) @constant.builtin
((identifier) @type ((identifier) @type
(#match? @type "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES (#match? @type "^_?[A-Z].*[a-z]")) ; catch Classes or IClasses not CLASSES
@ -160,7 +160,14 @@
; Keywords ; Keywords
; -------------------- ; --------------------
["import" "library" "export"] @include [
"import"
"library"
"export"
"as"
"show"
"hide"
] @include
; Reserved words (cannot be used as identifiers) ; Reserved words (cannot be used as identifiers)
[ [
@ -195,16 +202,8 @@
; Built in identifiers: ; Built in identifiers:
; alone these are marked as keywords ; alone these are marked as keywords
[ [
"abstract"
"as"
"async"
"async*"
"sync*"
"await" "await"
"covariant"
"deferred" "deferred"
"dynamic"
"external"
"factory" "factory"
"get" "get"
"implements" "implements"
@ -214,11 +213,22 @@
"mixin" "mixin"
"part" "part"
"set" "set"
"show"
"static"
"typedef" "typedef"
] @keyword ] @keyword
[
(const_builtin)
(final_builtin)
"abstract"
"async"
"async*"
"covariant"
"dynamic"
"external"
"static"
"sync*"
] @type.qualifier
; when used as an identifier: ; when used as an identifier:
((identifier) @variable.builtin ((identifier) @variable.builtin
(#any-of? @variable.builtin (#any-of? @variable.builtin