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

State Exploded when many members #582

Closed
peter-empen opened this issue Nov 9, 2016 · 3 comments
Closed

State Exploded when many members #582

peter-empen opened this issue Nov 9, 2016 · 3 comments

Comments

@peter-empen
Copy link

Hi, I get 'State exploded' for the following source:

Version: 0.4.9
Integration: intellij
Configuration:
style = defaultWithAlign
danglingParentheses = true
maxColumn = 120
align.openParenCallSite = true
binPack.callSite = true
binPack.defnSite = true
binPack.parentConstructors = true
binPackImportSelectors = true
indentOperator.exclude = "^(~|&&|\|\|)$"

  val invalidEmailValues = Set(
    "plainaddress",
    "#@%^%#$@#$@#.com",
    "@example.com",
    "Joe Smith <email@example.com>",
    "email.example.com",
    "email@example@example.com",
    ".email@example.com",
    "email.@example.com",
    "email..email@example.com",
    "あいうえお@example.com",
    "email@example.com (Joe Smith)",
    "email@example",
    "email@-example.com",
    "topLevelDomainIsAllNumeric@1234.111",
    "email@example..com",
    "65CharactersLocalPart12345678901234567890123456789012345678901234@example.com",
    "64CharactersDomainPart@123456789012345678901234567890123456789012345678901234567example.com",
    "255CharactersE-Mail@123456789012345678901234567890123456789012345678901234567890123.456789012345678901234567890123456789012345678901234567890123456.789012345678901234567890123456789012345678901234567890123456789.012345678901234567890123456789012345671.com"
  )

Scalafmt:

Scalafmt: Search state exploded around line x

To get rid of this, it suffices to remove some lines.

@olafurpg
Copy link
Member

olafurpg commented Nov 9, 2016

Yes, this is a shame. It's fixable but requires a change to the best-first search, which I avoid whenever I can. I opened #140 for this exact issue with config-style lists, since it's possible to clear the search queue on between each argument.

Your example does not trigger the error for me but any big enough argument list will typically do.

I can't promise when I'll get around to fix this. Your options for now are documented here: https://olafurpg.github.io/scalafmt/#Deeplynestedcode

@peter-empen
Copy link
Author

thanks a lot for your timely feedback.

@olafurpg
Copy link
Member

@peter-empen #621 fixes a large number of "search state exploded cases. Once v0.5 is out, please give it a try and see if it helps.

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

No branches or pull requests

3 participants
@peter-empen @olafurpg and others