summaryrefslogtreecommitdiff
path: root/queries/javascript
diff options
context:
space:
mode:
authorJoosep Alviste <joosep.alviste@gmail.com>2020-10-23 22:05:27 +0300
committerJoosep Alviste <joosep.alviste@gmail.com>2020-10-23 22:05:27 +0300
commit31fca678393d44f459932fa5babac9678b26e6a8 (patch)
tree1ffeb9579494857de50cb7359120e7badea3ff0d /queries/javascript
parentd1796695ac6826e45f7c78a9bd039c069e9d9f92 (diff)
fix(javascript): fix constant variable highlight
The `@constant` query gets overwritten by the `@constructor` query. They both query for variables starting with an uppercase letter, but the `@constant` query took effect first.
Diffstat (limited to 'queries/javascript')
-rw-r--r--queries/javascript/highlights.scm6
1 files changed, 3 insertions, 3 deletions
diff --git a/queries/javascript/highlights.scm b/queries/javascript/highlights.scm
index 0b650496..c0ce0fae 100644
--- a/queries/javascript/highlights.scm
+++ b/queries/javascript/highlights.scm
@@ -17,15 +17,15 @@
(identifier) @variable
+((identifier) @constructor
+ (#match? @constructor "^[A-Z]"))
+
((identifier) @constant
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
((shorthand_property_identifier) @constant
(#vim-match? @constant "^[A-Z_][A-Z\\d_]+$"))
-((identifier) @constructor
- (#match? @constructor "^[A-Z]"))
-
((identifier) @variable.builtin
(#vim-match? @variable.builtin "^(arguments|module|console|window|document)$"))