Conversation
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
Signed-off-by: Christoph Knittel <ck@cca.io>
6facbe0 to
6710020
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6710020aa7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## codex/switch-case-braces #8678 +/- ##
=========================================================
Coverage 78.57% 78.58%
=========================================================
Files 476 476
Lines 64157 64245 +88
=========================================================
+ Hits 50414 50484 +70
- Misses 13743 13761 +18
🚀 New features to boost your workflow:
|
Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eaa2818c1e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Signed-off-by: Christoph Knittel <ck@cca.io>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 792a5491dc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | {pexp_desc = Pexp_braces {expr = inner}} -> | ||
| spelunk_for_fun_expression inner |
There was a problem hiding this comment.
Preserve async status when unwrapping component braces
When an async component uses explicit outer braces, such as @react.component let make = {async (~x) => ...}, this branch unwraps it for function discovery, but is_async at jsx_v4.ml:605 still probes the original binding.pvb_expr. Ast_async.dig_async_payload_from_function returns false for Pexp_braces, so the rewritten implementation becomes non-async and its component wrapper omits Jsx.promise. Fresh evidence beyond the earlier JSX finding is this unchanged async probe; unwrap the expression for async detection as well.
AGENTS.md reference: AGENTS.md:L53-L53
Useful? React with 👍 / 👎.
| | Pexp_braces {expr = inner} -> | ||
| let exp = | ||
| type_expect ~context ?deprecated_context ~recarg env inner ty_expected | ||
| in | ||
| {exp with exp_attributes = sexp.pexp_attributes @ exp.exp_attributes} |
There was a problem hiding this comment.
Forward frontend decorators through brace wrappers
When a transform-sensitive decorator precedes a braced function, for example let f = @this {(self, x) => ...}, the decorator now resides on the Pexp_braces wrapper. bs_builtin_ppx.expr_mapper only recognizes @this while matching a Pexp_fun, and its default traversal reaches the inner function without forwarding the wrapper attributes; copying them onto the typed expression here happens after frontend transformation, so the method callback is emitted as an ordinary function with incorrect this behavior. Handle brace wrappers in the frontend mapper or forward applicable attributes before visiting the inner expression.
AGENTS.md reference: compiler/AGENTS.md:L24-L31
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| and expression_desc = | ||
| | Pexp_braces of {expr: expression; braces_loc: Location.t} |
There was a problem hiding this comment.
Update editor binding classifiers for braced expressions
Introducing this wrapper changes every explicitly braced binding's top-level descriptor, but the editor classifiers still inspect that descriptor directly. For example, analysis/src/document_symbol.ml:18-21 now reports let f = {x => x} as a variable rather than a function, while analysis/src/hint.ml:120-129 omits its function code lens (and the analogous inlay-hint match also skips braced values). Unwrap Pexp_braces in these binding classifiers and add analysis coverage beyond completion.
AGENTS.md reference: AGENTS.md:L104-L109
Useful? React with 👍 / 👎.
Refs #8624
Summary
Pexp_braceswith a separate delimiter location and use it throughout the parser, printer, type checker, editor analysis, and AST visitors.res.braces/ns.bracescompatibility decoding and encoding in the frozen v0 AST bridge.elseformatting follow the same brace handling asif, and preserve multiline pipe formatting when comments precede a braced JSX value.Tests
make testmake test-syntaxmake test-syntax-roundtripmake test-analysisStacked on #8677.