-
Notifications
You must be signed in to change notification settings - Fork 477
Attach res.doc to polyvariant #8155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
rescript
@rescript/darwin-arm64
@rescript/darwin-x64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
|
@codex review |
|
To use Codex here, create a Codex account and connect to github. |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e77f67f950
ℹ️ 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".
compiler/syntax/src/res_core.ml
Outdated
| let tag_with_doc = | ||
| match tag with | ||
| | Parsetree.Rtag (name, attrs, contains_constant, types) -> | ||
| Parsetree.Rtag | ||
| (name, doc_comment_attrs @ attrs, contains_constant, types) | ||
| | Rinherit _ -> tag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve doc comments on inherited row fields
When a doc comment appears before a | that introduces an inherited row field (e.g., /** doc */ | Some.t), parse_tag_specs now accepts the comment but drops it because it only prepends doc_comment_attrs for Rtag and ignores Rinherit. That means the new syntax silently loses documentation in the AST and formatter. If doc comments are meant to attach to all polyvariant entries, you’ll want to carry doc_comment_attrs into the Rinherit case (e.g., by adding them to typ.ptyp_attributes or threading them into parse_tag_spec).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codex can you give a concrete example of the above issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use Codex here, create a Codex account and connect to github.
|
@shulhi Could you address the comment from Codex? |
Fix #8154