Skip to content

Store the label loc directly in the label, for application for now. #7253

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

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Jan 23, 2025

Create type arg_label_loc alongside arg_label to store location in the label.
This is only used by application for the moment.

@cristianoc cristianoc force-pushed the loc-directly-in-label branch 2 times, most recently from 61152e3 to 26f4de9 Compare January 23, 2025 12:40
@cristianoc cristianoc force-pushed the loc-directly-in-label branch from 26f4de9 to e236e21 Compare January 23, 2025 13:24
@cristianoc cristianoc requested review from cknitt and zth January 23, 2025 13:25
Preserve `isMobile={isMobile}` when it's like that in the source, instead of reformatting to `isMobile`.
Do we want that?
@@ -51,7 +51,7 @@ let x =
let x = <div className="container" className2="container2" className3="container3" onClick />

let nav =
<Nav isMobile fullScreen={!isMobile ? false : isOpen}>
<Nav isMobile={isMobile} fullScreen={!isMobile ? false : isOpen}>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restored this behaviour where isMobile={isMobile} in the source is not reformatted to the punned isMobile.
Is this intended?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we don't autopun in JSX, yes.

Copy link
Member

@fhammerschmidt fhammerschmidt Jan 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not punned because of the brackets.

This would be punned
<Nav isMobile=isMobile fullScreen={!isMobile ? false : isOpen}>
formats to
<Nav isMobile fullScreen={!isMobile ? false : isOpen}>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's it yeah. I think that's good behavior.

Copy link
Collaborator

@zth zth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't looked through it all but will soon!

Comment on lines +69 to +70
| Lbl of string loc (* label:T -> ... *)
| Opt of string loc (* ?label:T -> ... *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small nit, but these should probably be in ReScript syntax, no?

@@ -51,7 +51,7 @@ let x =
let x = <div className="container" className2="container2" className3="container3" onClick />

let nav =
<Nav isMobile fullScreen={!isMobile ? false : isOpen}>
<Nav isMobile={isMobile} fullScreen={!isMobile ? false : isOpen}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC we don't autopun in JSX, yes.

@cristianoc
Copy link
Collaborator Author

Now all the location information is stored in the labels directly. Merging this into #7247 to get a consolidated view of the changes.

@cristianoc cristianoc merged commit 0e03792 into named-arg-loc-fundef Jan 24, 2025
@cristianoc cristianoc deleted the loc-directly-in-label branch January 24, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants