aboutsummaryrefslogtreecommitdiffstats
path: root/queries/javascript/highlights.scm
diff options
context:
space:
mode:
Diffstat (limited to 'queries/javascript/highlights.scm')
-rw-r--r--queries/javascript/highlights.scm21
1 files changed, 14 insertions, 7 deletions
diff --git a/queries/javascript/highlights.scm b/queries/javascript/highlights.scm
index fe373e617..6cc7ab43d 100644
--- a/queries/javascript/highlights.scm
+++ b/queries/javascript/highlights.scm
@@ -1,9 +1,17 @@
; Types
; Javascript
+
+; Properties
+;-----------
+
+(property_identifier) @property
+
; Special identifiers
;--------------------
+(identifier) @variable
+
((identifier) @constant
(#match? @constant "^[A-Z_][A-Z\\d_]+$"))
@@ -14,11 +22,17 @@
(#match? @constructor "^[A-Z]"))
((identifier) @variable.builtin
+ (#not-is? @variable.builtin import var parameter)
(#match? @variable.builtin "^(arguments|module|console|window|document)$"))
((identifier) @function.builtin
+ (#not-is? @function.builtin import var parameter)
(#eq? @function.builtin "require"))
+((identifier) @parameter.reference
+ (#is? @parameter.reference parameter))
+
+
; Function and method definitions
;--------------------------------
@@ -78,13 +92,6 @@
(rest_parameter
(identifier) @parameter))
-(identifier) @variable
-
-; Properties
-;-----------
-
-(property_identifier) @property
-
; Literals
;---------