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
{(Completion.create ~name~kind:(Label"") ~env) with docstring}
1407
+
in
1406
1408
[
1407
-
"as";
1408
-
"deriving";
1409
-
"genType";
1410
-
"genType.as";
1411
-
"genType.import";
1412
-
"genType.opaque";
1413
-
"get";
1414
-
"get_index";
1415
-
"inline";
1416
-
"int";
1417
-
"meth";
1418
-
"module";
1419
-
"new";
1420
-
"obj";
1421
-
"react.component";
1422
-
"return";
1423
-
"scope";
1424
-
"send";
1425
-
"set";
1426
-
"set_index";
1427
-
"string";
1428
-
"this";
1429
-
"unboxed";
1430
-
"uncurry";
1431
-
"unwrap";
1432
-
"val";
1433
-
"variadic";
1409
+
( "as",
1410
+
[
1411
+
{|The `@as` decorator is commonly used on record types to alias record field names to a different JavaScript attribute name.
1412
+
1413
+
This is useful to map toJavaScript attribute names that cannot be expressed inReScript (such as keywords).
1414
+
1415
+
It is also possible to map a ReScript record to a JavaScriptarray by passing indices to the `@as` decorator.
1416
+
1417
+
[Read more andseeexamplesinthedocumentation](https://rescript-lang.org/syntax-lookup#as-decorator).|};
1418
+
] );
1419
+
( "dead",
1420
+
[
1421
+
{|The `@dead` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
1422
+
1423
+
`@dead` suppresses reporting on the value/type, but can also be used to force the analysis to consider a value as dead. Typically used to acknowledge cases of dead code you are not planning to address right now, but can be searched easily later.
1424
+
1425
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#dead-decorator).
1426
+
1427
+
> Hint: Did you know you can run an interactive dead code analysis in your project by running the command `> ReScript: Start dead code analysis.`? Try it!|};
1428
+
] );
1429
+
( "deriving",
1430
+
[
1431
+
{|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.
1432
+
1433
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#deriving-decorator).|};
1434
+
] );
1435
+
( "deprecated",
1436
+
[
1437
+
{|The `@deprecated` decorator is used to add deprecation notes to types, values and submodules. The compiler and editor tooling will yield a warning whenever a deprecated entity is being used.
1438
+
1439
+
Alternatively, use the `@@deprecated` decorator to add a deprecation warning to the file level.
1440
+
1441
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#expression-deprecated-decorator).|};
1442
+
] );
1443
+
( "genType",
1444
+
[
1445
+
{|The @genType decorator may be used to export ReScript values and types to JavaScript, and import JavaScript values and types 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.
1446
+
1447
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#gentype-decorator).|};
1448
+
] );
1449
+
( "genType.as",
1450
+
[
1451
+
{|The @genType decorator may be used to export ReScript values and types to JavaScript, and import JavaScript values and types 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.
1452
+
1453
+
[Read more and see examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
1454
+
] );
1455
+
( "genType.import",
1456
+
[
1457
+
{|The @genType decorator may be used to export ReScript values and types to JavaScript, and import JavaScript values and types 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.
1458
+
1459
+
[Read more and see examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
1460
+
] );
1461
+
( "genType.opaque",
1462
+
[
1463
+
{|The @genType decorator may be used to export ReScript values and types to JavaScript, and import JavaScript values and types 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.
1464
+
1465
+
[Read more and see examples in the documentation](https://rescript-lang.org/docs/gentype/latest/usage).|};
1466
+
] );
1467
+
( "get",
1468
+
[
1469
+
{|The `@get` decorator is used to bind to a property of an object.
1470
+
1471
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#get-decorator).|};
1472
+
] );
1473
+
( "get_index",
1474
+
[
1475
+
{|The `@get_index` decorator is used to access a dynamic property on an object, or an index of an array.
1476
+
1477
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#get-index-decorator).|};
1478
+
] );
1479
+
( "inline",
1480
+
[
1481
+
{|The `@inline` decorator tells the compiler to inline its value in every place the binding is being used, rather than use a variable.
1482
+
1483
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#inline-decorator).|};
1484
+
] );
1485
+
( "int",
1486
+
[
1487
+
{|The `@int` decorator can be used with polymorphic variants and the @as decorator on externals to modify the compiled JavaScript to use integers for the values instead of strings.
1488
+
1489
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#int-decorator).|};
1490
+
] );
1491
+
( "live",
1492
+
[
1493
+
{|The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.
1494
+
1495
+
`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.
1496
+
1497
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).
1498
+
1499
+
Hint: Did you know you can run an interactive dead code analysis in your project by running the command `> ReScript: Start dead code analysis.`? Try it!|};
1500
+
] );
1501
+
( "meth",
1502
+
[
1503
+
{|The `@meth` decorator is used to call a function on a JavaScript object, and avoid issues with currying.
1504
+
1505
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#meth-decorator).|};
1506
+
] );
1507
+
( "module",
1508
+
[
1509
+
{|The `@module` decorator is used to bind to a JavaScript module.
1510
+
1511
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#module-decorator).|};
1512
+
] );
1513
+
( "new",
1514
+
[
1515
+
{|
1516
+
The `@new` decorator is used whenever you need to bind to a JavaScript class constructor that requires the new keword for instantiation.|
1517
+
1518
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#new-decorator).|};
1519
+
] );
1520
+
( "obj",
1521
+
[
1522
+
{|The `@obj` decorator is used to create functions that return JavaScript objects with properties that match the function's parameter labels.
1523
+
1524
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#obj-decorator).|};
1525
+
] );
1526
+
( "react.component",
1527
+
[
1528
+
{|The `@react.component` decorator is used to annotate functions that are RescriptReact components.
1529
+
1530
+
You will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.
1531
+
1532
+
Note: The `@react.component` decorator requires the react-jsx config to be set in your `bsconfig.json` to enable the required React transformations.
1533
+
1534
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator).|};
1535
+
] );
1536
+
( "return",
1537
+
[
1538
+
{|The `@return` decorator is used to control how `null` and `undefined` values are converted to option types in ReScript.
1539
+
1540
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#return-decorator).|};
1541
+
] );
1542
+
( "scope",
1543
+
[
1544
+
{|The `@scope` decorator is used with other decorators such as `@val` and `@module` to declare a parent scope for the binding.
1545
+
1546
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#scope-decorator).|};
1547
+
] );
1548
+
( "send",
1549
+
[
1550
+
{|The `@send` decorator is used to bind to a method on an object or array.
1551
+
1552
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#send-decorator).|};
1553
+
] );
1554
+
( "set",
1555
+
[
1556
+
{|The `@set` decorator is used to set a property of an object.
1557
+
1558
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#set-decorator).|};
1559
+
] );
1560
+
( "set_index",
1561
+
[
1562
+
{|The `@set_index` decorator is used to set a dynamic property on an object, or an index of an array.
1563
+
1564
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#set-index-decorator).|};
1565
+
] );
1566
+
( "string",
1567
+
[
1568
+
{|The `@string` decorator can be used with polymorphic variants and the `@as` decorator on externals to modify the string values used for the variants in the compiled JavaScript.
1569
+
1570
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#string-decorator).|};
1571
+
] );
1572
+
( "this",
1573
+
[
1574
+
{|The `@this` decorator may be used to bind to an external callback function that require access to a this context.
1575
+
1576
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#this-decorator).|};
1577
+
] );
1578
+
( "unboxed",
1579
+
[
1580
+
{|The `@unboxed` decorator provides a way to unwrap variant constructors that have a single argument, or record objects that have a single field.
1581
+
1582
+
[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#unboxed-decorator).|};
1583
+
] );
1584
+
( "uncurry",
1585
+
[
1586
+
{|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 (`(.) => { ... }`).
Copy file name to clipboardExpand all lines: analysis/tests/src/expected/Completion.res.txt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -494,7 +494,7 @@ Completable: Cdecorator(reac)
494
494
"kind": 4,
495
495
"tags": [],
496
496
"detail": "",
497
-
"documentation": null
497
+
"documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the react-jsx config to be set in your `bsconfig.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}
"documentation": {"kind": "markdown", "value": "The `@react.component` decorator is used to annotate functions that are RescriptReact components.\n\nYou will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.\n\nNote: The `@react.component` decorator requires the react-jsx config to be set in your `bsconfig.json` to enable the required React transformations.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-decorator)."}
Nothing at that position. Now trying to use completion.
69
+
Attribute id:live:[112:0->112:5] label:live
70
+
Completable: Cdecorator(live)
71
+
{"contents": "The `@live` decorator is for reanalyze, a static analysis tool for ReScript that can do dead code analysis.\n\n`@live` tells the dead code analysis that the value should be considered live, even though it might appear to be dead. This is typically used in case of FFI where there are indirect ways to access values. It can be added to everything that could otherwise be considered unused by the dead code analysis - values, functions, arguments, records, individual record fields, and so on.\n\n[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#live-decorator).\n\nHint: Did you know you can run an interactive dead code analysis in your project by running the command `> ReScript: Start dead code analysis.`? Try it!"}
0 commit comments