-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
delete normalizeDoc()
#15909
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
Closed
Closed
delete normalizeDoc()
#15909
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
0d86645
remove normalizeDoc()
seiyab 2ca7b24
refactor
seiyab ae14b44
refactor
seiyab 9f8cd1c
refactor
seiyab 66f3c45
add test cases for flattenFill()
seiyab 0f1a8f5
refactor
seiyab 4a9f12e
update comment
seiyab da075a3
add format test cases
seiyab fbc82d2
refactor
seiyab ba90875
add changelog
seiyab 389586e
resolve changelog issue
seiyab 514cb86
refactor
seiyab 80dcdec
make changelog clear
seiyab ae219bc
prefer path.map()
seiyab 1faabb6
revive a line deleted unintentionally
seiyab 3508c40
correct error message
seiyab 0dd9963
simplify flattenFill
seiyab b06f367
Simplify
fisker 84a7349
Simplify logic
fisker 26aefe4
fix type issue and care edge case
seiyab e85797f
remove type
seiyab fabc5de
simplify logic
seiyab ed96c32
Merge branch 'main' into 15877-delete-normalizeDoc
seiyab 5dd5f8a
update snapshots
seiyab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
remove type
- Loading branch information
commit e85797f53a2dc10b078510bbdb444534e7ab95a4
There are no files selected for viewing
This file contains hidden or 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about this part, do we need go deeper?
headand docs inrestcan also beDOC_TYPE_ARRAYorDOC_TYPE_FILL.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to run some test first, prettier/prettier-regression-testing#435 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very sure it. But probably
fill()isn't nested in paragraph. If we want to go deeper, we should take care that we should go deeper only even (odd fordoc.parts) index element.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Searching "fill" in src/language-markdown, I confirmed
fill()can't be nested in markdown. There are three use offill():printSentence()in print-sentence.js: sentence only contains word and whitespace that turns into simple docs like string or line-like. It won't havefill()as children.if (shouldRemainTheSameContent(path)) {block in printer-markdown.js: same asprintSentence().flattenFill()in print-paragraph.js: paragraph can't be nested and the other children neither yield nested as described above.So I think we don't need go deeper for elements of
fill()as of now. But feel free to ask me to add recursive flattening for fill if you still worry about it.