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

scalariform failed when has last , and ) #292

Open
jxnu-liguobin opened this issue Jun 30, 2021 · 2 comments
Open

scalariform failed when has last , and ) #292

jxnu-liguobin opened this issue Jun 30, 2021 · 2 comments

Comments

@jxnu-liguobin
Copy link

scalac compile ok but scalariform failed.

@compileTimeOnly("enable macro to expand macro annotations")
final class apply(
                      verbose: Boolean = false,
                    ) extends StaticAnnotation {
  def macroTransform(annottees: Any*): Any = macro applyMacro.impl

}

scalac compile failed.

@compileTimeOnly("enable macro to expand macro annotations")
final class apply(
                      verbose: Boolean = false,) extends StaticAnnotation {
  def macroTransform(annottees: Any*): Any = macro applyMacro.impl

}

There are too many tokens. Let me post a little first

[error]     ),Some(Expr(List(CallExpr(None,Token(VARID,resTree,2462,resTree),None,List(),None)))))))),Token(RBRACE,},2473,})))))),false))),List()),Token(RBRACE,},2475,}))))))), (Token(NEWLINE,
[error] ,2476,
[error] ),None))),Token(EOF,,2477,))
[error]         at scala.Predef$.require(Predef.scala:281)
[error]         at scalariform.formatter.SpecificFormatter.fullFormat(SpecificFormatter.scala:54)
[error]         at scalariform.formatter.SpecificFormatter.fullFormat$(SpecificFormatter.scala:27)
[error]         at scalariform.formatter.ScalaFormatter$$anon$1.fullFormat(ScalaFormatter.scala:593)
[error]         at scalariform.formatter.ScalaFormatter$.formatAsEdits(ScalaFormatter.scala:602)
[error]         at scalariform.formatter.ScalaFormatter$.format(ScalaFormatter.scala:586)
[error]         at com.typesafe.sbt.Scalariform$.$anonfun$apply$3(Scalariform.scala:51)
[error]         at com.typesafe.sbt.Scalariform$.$anonfun$apply$3$adapted(Scalariform.scala:45)
[error]         at scala.collection.TraversableLike$WithFilter.$anonfun$foreach$1(TraversableLike.scala:924)
[error]         at scala.collection.immutable.HashSet$HashSet1.foreach(HashSet.scala:330)
[error]         at scala.collection.immutable.HashSet$HashTrieSet.foreach(HashSet.scala:1104)
[error]         at scala.collection.TraversableLike$WithFilter.foreach(TraversableLike.scala:923)
[error]         at com.typesafe.sbt.Scalariform$.performFormat$1(Scalariform.scala:45)
[error]         at com.typesafe.sbt.Scalariform$.$anonfun$apply$7(Scalariform.scala:67)
[error]         at com.typesafe.sbt.Scalariform$.$anonfun$apply$7$adapted(Scalariform.scala:67)
[error]         at com.typesafe.sbt.Scalariform$.handleUpdate$1(Scalariform.scala:81)
[error]         at com.typesafe.sbt.Scalariform$.$anonfun$handleFiles$1(Scalariform.scala:85)
[error]         at sbt.util.FileFunction$.$anonfun$cached$4(FileFunction.scala:153)
[error]         at sbt.util.Difference.apply(Tracked.scala:414)
[error]         at sbt.util.Difference.apply(Tracked.scala:394)
[error]         at sbt.util.FileFunction$.$anonfun$cached$3(FileFunction.scala:149)
[error]         at sbt.util.Difference.apply(Tracked.scala:414)
[error]         at sbt.util.Difference.apply(Tracked.scala:389)
[error]         at sbt.util.FileFunction$.$anonfun$cached$2(FileFunction.scala:148)
[error]         at com.typesafe.sbt.Scalariform$.handleFiles(Scalariform.scala:85)
[error]         at com.typesafe.sbt.Scalariform$.apply(Scalariform.scala:67)
[error]         at com.typesafe.sbt.SbtScalariform$.$anonfun$configScalariformSettings$3(SbtScalariform.scala:105)
[error]         at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error]         at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error]         at sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error]         at sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error]         at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error]         at sbt.Execute.work(Execute.scala:291)
[error]         at sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error]         at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error]         at sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error]         at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
[error]         at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
[error]         at java.base/java.lang.Thread.run(Thread.java:832)
[error] (Compile / scalariformFormat) java.lang.IllegalArgumentException: requirement failed: Parse tokens differ from expected.

@rnonnon
Copy link

rnonnon commented Aug 18, 2021

There is an open issue since Jun 2019 #284 and the project doesn't seem to evolve since 2019 so don't expect it to be fixed... :/

@hubertta
Copy link

I made a pull request that should take care of this problem: #296

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