Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve multiline printing of record types and values#7993

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
shulhi wants to merge7 commits intorescript-lang:master
base:master
Choose a base branch
Loading
fromshulhi:improve-record-formatter-2

Conversation

@shulhi
Copy link
Member

@shulhishulhi commentedOct 25, 2025
edited
Loading

Fix#7961

The formatting of the transformed JSX forces multiline for props with this change. However, I think this is fine because users won't actually see the transformed JSX anyways.

@pkg-pr-new
Copy link

pkg-pr-newbot commentedOct 25, 2025
edited
Loading

Open in StackBlitz

rescript

npm i https://pkg.pr.new/rescript-lang/rescript@7993

@rescript/darwin-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-arm64@7993

@rescript/darwin-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/darwin-x64@7993

@rescript/linux-arm64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-arm64@7993

@rescript/linux-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/linux-x64@7993

@rescript/runtime

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/runtime@7993

@rescript/win32-x64

npm i https://pkg.pr.new/rescript-lang/rescript/@rescript/win32-x64@7993

commit:57aa27b

@shulhishulhi marked this pull request as ready for reviewOctober 26, 2025 11:47
Copy link
Member

@nojafnojaf left a comment

Choose a reason for hiding this comment

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

Can we first reach consensus with the core contributors before merging?

This sets a precedent, and I think we should have a broader discussion about the direction we want to take.

For context, see my earlier thoughts here:#7961 (comment)

* }` -> record is written on multiple lines, break the group*)
let force_break=
e.pexp_loc.loc_start.pos_lnum< e.pexp_loc.loc_end.pos_lnum
match (spread_expr, rows)with
Copy link
Member

Choose a reason for hiding this comment

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

I want to pause here a bit — I don’t think we should merge this part right now.

The change around force_break introduces behaviour that depends on how the user originally formatted their code. That’s a significant precedent: it ties output formatting decisions to source‑layout heuristics.

If we want to allow this kind of stylistic inference, I believe it needs wider agreement within the core team. We should either decide as a group that this is a direction we’re comfortable with, or explicitly document why we don’t want to go that way.

If we do agree in principle, I’d also like to see a short architectural or design record capturing the rationale and boundaries for this sort of logic, so that future contributions have something concrete to refer to.

Finally, even with buy‑in, I’d suggest postponing this until after v12. We’re in the release‑candidate stage, and introducing new formatting heuristics at this point could have more ripple effects than we realise.

So in short: let’s not merge this specific part yet; let’s first get consensus and document it properly.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nojafnojafnojaf requested changes

Requested changes must be addressed to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Inconsistent multiline printing of record types and values

2 participants

@shulhi@nojaf

[8]ページ先頭

©2009-2025 Movatter.jp