This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 664
feature(formatter): LineSuffixBoundary
and ExpandParent
IR
#2590
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
from
May 17, 2022 15:57
75a0f62
to
c990b50
Compare
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
4 times, most recently
from
May 17, 2022 20:17
3cfe3a3
to
058764c
Compare
10 tasks
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
from
May 18, 2022 08:39
9aa2eff
to
b463a05
Compare
Parser conformance results on ubuntu-latestjs/262
jsx/babel
ts/babel
ts/microsoft
|
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
from
May 18, 2022 08:44
b463a05
to
64fd3e0
Compare
leops
approved these changes
May 18, 2022
Use the `LineSuffixBoundary` for comments instead of having a special case for `LineSuffix` in flat mode.
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
from
May 18, 2022 09:05
64fd3e0
to
c1b267a
Compare
MichaReiser
force-pushed
the
refactor/formatter-line-suffix
branch
from
May 18, 2022 09:08
00d54f1
to
8a70099
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces two new IR elements:
LineSuffixBoundary
: Forces the printer to flush any pendingLineSuffix
. For example necessary to avoid a comment inside of a JSX expression accidentally getting pushed into the content of an outer element.ExpandParent
: Forces the parent group to be printed as expended. E.g. should allow us to remove theLineSuffix
special case inside of the printer by emitting aExpandParent
for each block comment.Part of #2579
Test Plan
I added examples with integration tests for each new IR element