Skip to content

Conversation

@bakkot
Copy link
Member

@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
Member

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
Member 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
@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.

4 participants