Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- Dedicated error message for passing a braced ident to something expected to be a record. https://github.com/rescript-lang/rescript/pull/7806
- Hint about partial application when missing required argument in function call. https://github.com/rescript-lang/rescript/pull/7807
- More autocomplete improvements involving modules and module types. https://github.com/rescript-lang/rescript/pull/7795
- Autocomplete `@react.componentWithProps` attribute. https://github.com/rescript-lang/rescript/pull/7812

#### :house: Internal

Expand Down
18 changes: 18 additions & 0 deletions analysis/src/CompletionDecorators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,24 @@ Note: The `@react.component` decorator requires the `jsx` config to be set in yo
[
{|The `@jsx.component` decorator is used to annotate functions that are JSX components used with ReScript's [generic JSX transform](https://rescript-lang.org/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental).

You will need this decorator whenever you want to use a JSX component in ReScript JSX expressions.|};
] );
( "react.componentWithProps",
None,
[
{|The `@react.componentWithProps` decorator is used to annotate functions that are RescriptReact components.

You will need this decorator whenever you want to use a ReScript / React component in ReScript JSX expressions.

Note: The `@react.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.json` to enable the required React transformations.

[Read more and see examples in the documentation](https://rescript-lang.org/syntax-lookup#react-component-with-props-decorator).|};
] );
( "jsx.componentWithProps",
None,
[
{|The `@jsx.componentWithProps` decorator is used to annotate functions that are JSX components used with ReScript's [generic JSX transform](https://rescript-lang.org/docs/manual/latest/jsx#generic-jsx-transform-jsx-beyond-react-experimental).

You will need this decorator whenever you want to use a JSX component in ReScript JSX expressions.|};
] );
( "return",
Expand Down
14 changes: 14 additions & 0 deletions tests/analysis_tests/tests/src/expected/Completion.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,13 @@ Resolved opens 1 Stdlib
"detail": "",
"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 `jsx` config to be set in your `rescript.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)."},
"insertTextFormat": 2
}, {
"label": "react.componentWithProps",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` 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.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.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-with-props-decorator)."},
"insertTextFormat": 2
}]

Complete src/Completion.res 68:10
Expand All @@ -822,6 +829,13 @@ Resolved opens 1 Stdlib
"detail": "",
"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 `jsx` config to be set in your `rescript.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)."},
"insertTextFormat": 2
}, {
"label": "componentWithProps",
"kind": 4,
"tags": [],
"detail": "",
"documentation": {"kind": "markdown", "value": "The `@react.componentWithProps` 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.componentWithProps` decorator requires the `jsx` config to be set in your `rescript.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-with-props-decorator)."},
"insertTextFormat": 2
}]

Complete src/Completion.res 71:27
Expand Down
Loading