Open tim-zh opened 6 years ago
Same lexer bug I pointed out in #260, probably also related to how dangling paren is set up
What is the expected result?
this is still happening with scalariform. when you are using implicits the space between the word "implicit" and the name of the parameter should not be lost.
in other words (implicit foo : String
should not be reformatted to (implicitfoo : String
@normana400 can you provide a code snippet where the formatter breaks code (not just formats oddly) in the way that describe?
the above example is broken code. implicit is a language keyword. To have a language keyword get mixed into the name changes the behavior of the code and also creates a compile error with the code that attempts to reference the true (non corrupted) name of the value. Did that answer your question.
The example at the top of the thread should be all you need to reproduce.
I think the scenario happens whenever there is an implicit parameter that shares a signature with non implicit parameters
class Foo{
def f(implicit i: Int,
j: Int): Unit = {
i
j
}
}
is formatted to
(default config, "org.scalariform" % "sbt-scalariform" % "1.8.2", sbt.version = 1.0.3)