File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -1073,7 +1073,10 @@ module.exports = grammar({
1073
1073
1074
1074
decorator_arguments : $ => seq (
1075
1075
'(' ,
1076
- commaSept ( $ . expression ) ,
1076
+ choice (
1077
+ commaSept ( $ . expression ) ,
1078
+ $ . type_annotation
1079
+ ) ,
1077
1080
')' ,
1078
1081
) ,
1079
1082
Original file line number Diff line number Diff line change @@ -114,3 +114,31 @@ and bar = {bar: int}
114
114
(decorator (decorator_identifier))
115
115
(type_identifier)
116
116
(record_type (record_type_field (property_identifier) (type_annotation (type_identifier))))))))
117
+
118
+ ============================================
119
+ Decorator with type
120
+ ============================================
121
+
122
+ @react.component(:sharedProps)
123
+ let make = (~x, ~y) => React.string(x ++ y)
124
+
125
+ ---
126
+
127
+ (source_file
128
+ (decorated
129
+ (decorator
130
+ (decorator_identifier)
131
+ (decorator_arguments
132
+ (type_annotation (type_identifier))))
133
+ (let_binding
134
+ (value_identifier)
135
+ (function
136
+ (formal_parameters
137
+ (parameter (labeled_parameter (value_identifier)))
138
+ (parameter (labeled_parameter (value_identifier))))
139
+ (call_expression
140
+ (value_identifier_path
141
+ (module_identifier) (value_identifier))
142
+ (arguments
143
+ (binary_expression
144
+ (value_identifier) (value_identifier))))))))
You can’t perform that action at this time.
0 commit comments