blob: 0f318b66fb1dace9839b70297e4f00f9d9711095 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
; inherits: ecma
[
"abstract"
"declare"
"enum"
"export"
"implements"
"interface"
"keyof"
"namespace"
"private"
"protected"
"public"
"type"
"readonly"
] @keyword
; types
(type_identifier) @type
(predefined_type) @type.builtin
; punctuation
(type_arguments
"<" @punctuation.bracket
">" @punctuation.bracket)
(union_type
"|" @punctuation.delimiter)
(intersection_type
"&" @punctuation.delimiter)
(type_annotation
":" @punctuation.delimiter)
(pair
":" @punctuation.delimiter)
(property_signature "?" @punctuation.special)
(optional_parameter "?" @punctuation.special)
; Variables
(undefined) @variable.builtin
;;; Parameters
(required_parameter (identifier) @parameter)
(optional_parameter (identifier) @parameter)
(required_parameter
(rest_pattern
(identifier) @parameter))
;; ({ a }) => null
(required_parameter
(object_pattern
(shorthand_property_identifier_pattern) @parameter))
;; ({ a: b }) => null
(required_parameter
(object_pattern
(pair_pattern
value: (identifier) @parameter)))
;; ([ a ]) => null
(required_parameter
(array_pattern
(identifier) @parameter))
;; a => null
(arrow_function
parameter: (identifier) @parameter)
|