You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: analysis/src/CompletionDecorators.ml
+42
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
letlocal =
2
2
[
3
3
( "as",
4
+
Some "as(\"$0\")",
4
5
[
5
6
{|The `@as` decorator is commonly used on record types to alias record field names to a different JavaScript attribute name.
6
7
@@ -11,6 +12,7 @@ It is also possible to map a ReScript record to a JavaScript array by passing in
11
12
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#as-decorator).|};
12
13
] );
13
14
( "dead",
15
+
None,
14
16
[
15
17
{|The `@dead` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
16
18
@@ -21,12 +23,14 @@ It is also possible to map a ReScript record to a JavaScript array by passing in
21
23
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
22
24
] );
23
25
( "deriving",
26
+
Some "deriving($0)",
24
27
[
25
28
{|When the `@deriving` decorator is applied to a record type, it expands the type into a factory function plus a set of getter/setter functions for its fields.
26
29
27
30
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#deriving-decorator).|};
28
31
] );
29
32
( "deprecated",
33
+
Some "deprecated(\"$0\")",
30
34
[
31
35
{|The `@deprecated` decorator is used to add deprecation notes to types, values andsubmodules. The compiler andeditor tooling will yield a warning whenever a deprecated entity is being used.
32
36
@@ -35,6 +39,7 @@ Alternatively, use the `@@deprecated` decorator to add a deprecation warning to
35
39
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#expression-deprecated-decorator).|};
36
40
] );
37
41
( "doesNotRaise",
42
+
None,
38
43
[
39
44
{|The `@doesNotRaise` decorator is for reanalyze, a static analysis tool for ReScript that can perform exception analysis.
40
45
@@ -46,54 +51,63 @@ could potentially raise.
46
51
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
47
52
] );
48
53
( "genType",
54
+
None,
49
55
[
50
56
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
51
57
52
58
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#gentype-decorator).|};
53
59
] );
54
60
( "genType.as",
61
+
Some "genType.as(\"$0\")",
55
62
[
56
63
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
57
64
58
65
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
59
66
] );
60
67
( "genType.import",
68
+
None,
61
69
[
62
70
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
63
71
64
72
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
65
73
] );
66
74
( "genType.opaque",
75
+
None,
67
76
[
68
77
{|The @genType decorator may be used to export ReScript values andtypes to JavaScript, andimport JavaScript values andtypes into ReScript. It allows seamless integration of compiled ReScript modules in existing TypeScript, Flow, or plain JavaScript codebases, without loosing type information across different type systems.
69
78
70
79
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
71
80
] );
72
81
( "get",
82
+
None,
73
83
[
74
84
{|The `@get` decorator is used to bind to a property of an object.
75
85
76
86
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#get-decorator).|};
77
87
] );
78
88
( "get_index",
89
+
None,
79
90
[
80
91
{|The `@get_index` decorator is used to access a dynamic property on an object, or an index of an array.
81
92
82
93
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#get-index-decorator).|};
83
94
] );
84
95
( "inline",
96
+
None,
85
97
[
86
98
{|The `@inline` decorator tells the compiler to inline its value in every place the binding is being used, rather than use a variable.
87
99
88
100
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#inline-decorator).|};
89
101
] );
90
102
( "int",
103
+
None,
91
104
[
92
105
{|The `@int` decorator can be used with polymorphic variants andthe @as decorator on externals to modify the compiled JavaScript to use integers for the values instead of strings.
93
106
94
107
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#int-decorator).|};
95
108
] );
96
109
( "live",
110
+
None,
97
111
[
98
112
{|The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
99
113
@@ -104,31 +118,36 @@ could potentially raise.
104
118
Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
105
119
] );
106
120
( "meth",
121
+
None,
107
122
[
108
123
{|The `@meth` decorator is used to call a function on a JavaScript object, andavoid issues with currying.
109
124
110
125
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#meth-decorator).|};
111
126
] );
112
127
( "module",
128
+
Some "module(\"$0\")",
113
129
[
114
130
{|The `@module` decorator is used to bind to a JavaScript module.
115
131
116
132
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator).|};
117
133
] );
118
134
( "new",
135
+
None,
119
136
[
120
137
{|
121
138
The `@new` decorator is used whenever you need to bind to a JavaScript class constructor that requires the new keword for instantiation.|
122
139
123
140
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#new-decorator).|};
124
141
] );
125
142
( "obj",
143
+
None,
126
144
[
127
145
{|The `@obj` decorator is used to create functions that return JavaScript objects with properties that match the function's parameter labels.
128
146
129
147
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#obj-decorator).|};
130
148
] );
131
149
( "raises",
150
+
Some "raises(\"$0\")",
132
151
[
133
152
{|The `@raises` decorator is for reanalyze, a static analysis tool for ReScript that can perform exception analysis.
134
153
@@ -139,6 +158,7 @@ Example `@raises(Exn)` or `@raises([E1, E2, E3])` for multiple exceptions.
139
158
> Hint: Did you know you can run an interactive code analysis in your project by running the command `> ReScript: Start Code Analyzer`? Try it!|};
140
159
] );
141
160
( "react.component",
161
+
None,
142
162
[
143
163
{|The `@react.component` decorator is used to annotate functions that are RescriptReact components.
144
164
@@ -149,72 +169,84 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
149
169
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator).|};
150
170
] );
151
171
( "return",
172
+
Some "return(${1:nullable})",
152
173
[
153
174
{|The `@return` decorator is used to control how `null` and `undefined` values are converted to option types in ReScript.
154
175
155
176
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#return-decorator).|};
156
177
] );
157
178
( "scope",
179
+
Some "scope(\"$0\")",
158
180
[
159
181
{|The `@scope` decorator is used with other decorators such as `@val` and `@module` to declare a parent scope for the binding.
160
182
161
183
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#scope-decorator).|};
162
184
] );
163
185
( "send",
186
+
None,
164
187
[
165
188
{|The `@send` decorator is used to bind to a method on an object or array.
166
189
167
190
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#send-decorator).|};
168
191
] );
169
192
( "set",
193
+
None,
170
194
[
171
195
{|The `@set` decorator is used to set a property of an object.
172
196
173
197
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#set-decorator).|};
174
198
] );
175
199
( "set_index",
200
+
None,
176
201
[
177
202
{|The `@set_index` decorator is used to set a dynamic property on an object, or an index of an array.
178
203
179
204
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#set-index-decorator).|};
180
205
] );
181
206
( "string",
207
+
None,
182
208
[
183
209
{|The `@string` decorator can be used with polymorphic variants andthe `@as` decorator on externals to modify the string values used for the variants in the compiled JavaScript.
184
210
185
211
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#string-decorator).|};
186
212
] );
187
213
( "this",
214
+
None,
188
215
[
189
216
{|The `@this` decorator may be used to bind to an external callback function that require access to a this context.
190
217
191
218
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#this-decorator).|};
192
219
] );
193
220
( "unboxed",
221
+
None,
194
222
[
195
223
{|The `@unboxed` decorator provides a way to unwrap variant constructors that have a single argument, or record objects that have a single field.
196
224
197
225
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#unboxed-decorator).|};
198
226
] );
199
227
( "uncurry",
228
+
None,
200
229
[
201
230
{|The `@uncurry` decorator can be used to mark any callback argument within an external function as an uncurried function without the need for any explicit uncurried function syntax (`(.) => { ... }`).
202
231
203
232
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#uncurry-decorator).|};
204
233
] );
205
234
( "unwrap",
235
+
None,
206
236
[
207
237
{|The `@unwrap` decorator may be used when binding to external functions that accept multiple types for an argument.
208
238
209
239
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#unwrap-decorator).|};
210
240
] );
211
241
( "val",
242
+
None,
212
243
[
213
244
{|The `@val` decorator allows you to bind to JavaScript values that are on the global scope.
214
245
215
246
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#val-decorator).|};
216
247
] );
217
248
( "variadic",
249
+
None,
218
250
[
219
251
{|The `@variadic` decorator is used to model JavaScript functions that take a variable number of arguments, where all arguments are of the same type.
220
252
@@ -225,22 +257,32 @@ Note: The `@react.component` decorator requires the react-jsx config to be set i
225
257
let toplevel =
226
258
[
227
259
( "deprecated",
260
+
Some "deprecated(\"$0\")",
228
261
[
229
262
{|The `@@deprecated` decorator is used to add a deprecation note to the file-level of a module. The compiler andeditor tooling will yield a warning whenever a deprecated file module is being used.
230
263
231
264
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#module-deprecated-decorator).|};
232
265
] );
233
266
( "directive",
267
+
Some "directive(\"$0\")",
234
268
[
235
269
{|The `@@directive` decorator will output that string verbatim at the very top of the generated JavaScript file, before any imports.
236
270
237
271
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#directive-decorator).|};
238
272
] );
239
273
( "warning",
274
+
Some "warning(\"$0\")",
240
275
[
241
276
{|The `@@warning` decorator is used to modify the enabled compiler warnings for the current module. See here for all available warning numbers.
242
277
243
278
[Read more andsee examples in the documentation](https://rescript-lang.org/syntax-lookup#module-warning-decorator).
244
279
|};
245
280
] );
281
+
( "jsxConfig",
282
+
Some "jsxConfig({$0})",
283
+
[
284
+
{|The `@@jsxConfig` decorator is used to change the config for JSX on the fly.
285
+
286
+
[Read more andsee examples in the documentation](https://rescript-lang.org/docs/manual/latest/jsx#file-level-configuration).|};
0 commit comments