You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Add all missing imports" adds them all in one line #38082
Likely a culprit of the new "preserved trivia" strategy - generated nodes don't have trivia, so we're not printing out new lines between statements. See some instances of this in #37814
I gave a reivew, but if I understand correctly I think that only solves problems for gathering newlines between nodes more appropriately - it doesn't fix the problem for nodes that have no newlines because they're generated.
Matt Bierner (@mjbvz), it doesn’t seem to repro for me—also using that nightly and Insiders. Now that I think about it, we definitely already have test coverage for fix-all imports that should catch this. My screen cap shows semicolons on both calls, but I tried it with mixed and semicolon-less styles too. Any tricks you can think of to reproduce this?
Activity
DanielRosenwasser commentedon Apr 21, 2020
Likely a culprit of the new "preserved trivia" strategy - generated nodes don't have trivia, so we're not printing out new lines between statements. See some instances of this in #37814
andrewbranch commentedon Apr 21, 2020
It would be helpful if I could get a review on #37846
DanielRosenwasser commentedon Apr 21, 2020
I gave a reivew, but if I understand correctly I think that only solves problems for gathering newlines between nodes more appropriately - it doesn't fix the problem for nodes that have no newlines because they're generated.
andrewbranch commentedon Apr 21, 2020
I think you’re probably right, but it will be useful nonetheless to avoid making simultaneous PRs to the same area. Thanks!
andrewbranch commentedon Apr 21, 2020
Matt Bierner (@mjbvz), it doesn’t seem to repro for me—also using that nightly and Insiders. Now that I think about it, we definitely already have test coverage for fix-all imports that should catch this. My screen cap shows semicolons on both calls, but I tried it with mixed and semicolon-less styles too. Any tricks you can think of to reproduce this?
mjbvz commentedon Apr 21, 2020
To repo for me, start with:
Delete the import. Then trigger the
add all missing importsquick fixandrewbranch commentedon Apr 22, 2020
Thanks! The trick was having a newline at the start of the file. This turned out not to be related to the newline preservation changes after all.