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

FormatWriter: insert newline after packages #1069 #1555

Merged
merged 2 commits into from
Nov 25, 2019

Conversation

kitbellew
Copy link
Collaborator

@kitbellew kitbellew commented Nov 20, 2019

Fixes #1069

This commit produces no diffs on scala-repos.

@kitbellew
Copy link
Collaborator Author

@olafurpg @poslegm @tanishiking PTAL

Copy link
Member

@olafurpg olafurpg left a comment

Choose a reason for hiding this comment

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

This is a long overdue fix! I like the new behavior, big 👍 from me.

Did you try running this against scala-repos to see if any unexpected diffs came up?

Only one blocking comment, otherwise this looks ready to go.

nextNonCommentWithCount(toks(i).formatToken)
isMultiline(actualOwner(nextNonComment).tokens.last, i + distance + 1)
val formatToken = toks(i).formatToken
def checkPackage: Option[Boolean] = {
Copy link
Member

Choose a reason for hiding this comment

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

We should guard this change against edition = 2019-11

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will add the edition here, and post the diffs from scala-repos later today.

for now, working on #1557, i think the solution is incomplete, but chains are surprisingly difficult.

Copy link
Member

Choose a reason for hiding this comment

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

Chains are very difficult with the current router design. I spent a LOT of time trying to break on plain a.b without exploding the search state but failed.

@kitbellew
Copy link
Collaborator Author

@olafurpg rebased, added edition, as requested. updated description regarding scala-repos, this change had no effect on that codebase.

Copy link
Collaborator

@poslegm poslegm left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Thank you!

@poslegm poslegm merged commit abd19e7 into scalameta:master Nov 25, 2019
@kitbellew kitbellew deleted the add-blank-line-after-packages branch November 25, 2019 15:11
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.

Insert blank line between package declaration and imports section
3 participants