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
I've recently found a case where // format: off doesn't prevent us from Search state exploded issue, for a deeply nested code. Here's a Scalafmt configuration and a minimal source code that allows to reproduce the issue...
packageminimal// format: offobjectSearchStateExploded {
defsomeMethodCall(foo: String, bar: String) =s"$foo + $bar"valveryLongString=s"""${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
${someMethodCall(
foo ="value",
bar ="another value")}
"""
}
// format: on
Problem
We get Search state exploded despite of the fact that // format: off was used:
> scalafmt
[info] scalafmt: Formatting1Scala sources (/Users/someuser/scalafmtissue)...
[error] stack trace is suppressed; run last Compile/ scalafmt for the full output
[error] (Compile/ scalafmt) org.scalafmt.sbt.ScalafmtSbtReporter$ScalafmtSbtError:scalafmt: Search state exploded on ',∙bar[1291:1305]', line 49 [/Users/someuser/scalafmtissue/src/main/scala/minimal/SearchStateExploded.scala]
Expectation
Although Search state exploded could be expected for such a code snippet, it should be possible to avoid it when // format: off is used. It seems that it's a regression - the similar snippet also causes Search state exploded in Scalafmt 2.7.5 but using // format: off can prevent it
The text was updated successfully, but these errors were encountered:
I've recently found a case where
// format: off
doesn't prevent us fromSearch state exploded
issue, for a deeply nested code. Here's a Scalafmt configuration and a minimal source code that allows to reproduce the issue...Environment
Version: 3.3.1
Integration: sbt
Configuration:
Steps
Assume that we've got an object like this:
Problem
We get
Search state exploded
despite of the fact that// format: off
was used:Expectation
Although
Search state exploded
could be expected for such a code snippet, it should be possible to avoid it when// format: off
is used. It seems that it's a regression - the similar snippet also causesSearch state exploded
in Scalafmt 2.7.5 but using// format: off
can prevent itThe text was updated successfully, but these errors were encountered: