Skip to content
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

Make the formatter smarter about mutli-line steps #596

Merged
merged 1 commit into from
Jun 8, 2024

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Jun 7, 2024

Some consumers write some steps across multiple line of source, like this. This makes the formatter smarter in those cases: rather than making all lines be the same indentation, it keeps whatever indentation there is beyond that which is common across all lines.

I would have been happier making it aware of Records explicitly, but that's quite complex: the expression parser intentionally doesn't represent <del> etc, which means its output is not suitable for use in the formatter.

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

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

I'm gonna take your word for it.

@gibson042
Copy link
Contributor

gibson042 commented Jun 7, 2024

This seems related to #513 (and possibly tc39/ecmarkdown#94 ), but I'm not sure to what extent.

@bakkot
Copy link
Contributor Author

bakkot commented Jun 7, 2024

@gibson042 This is only about the text representation, not the output. Though of course you need the text representation to be preserved by the formatter if you're going to use it to guide the output.

@bakkot bakkot merged commit 13e1fb3 into main Jun 8, 2024
2 checks passed
@bakkot bakkot deleted the format-multiline-steps branch June 8, 2024 22:35
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