Incorrect auto-indentation after val/var with a String/Char on the rhs
Auto indentation is wrong after a val/var declaration
Type the following in any scala file:
This only occurs if the right hand side of the assignement is a String or a Char and no comma (`;`) is appended fter the expression. So the `JavaHeuristicScanner` will think that the expression is a multiline statement and therefore indent twice the following line. Oddly enough, this only happens if the rhs is a String or a char (written using `"` or `'`). Any other value seems to work.
Type the following in any scala file:
object Test {
val foo = "foo"
println() // wrong auto-indentation
}
This only occurs if the right hand side of the assignement is a String or a Char and no comma (`;`) is appended fter the expression. So the `JavaHeuristicScanner` will think that the expression is a multiline statement and therefore indent twice the following line. Oddly enough, this only happens if the rhs is a String or a char (written using `"` or `'`). Any other value seems to work.
Leave a comment
on 2011-08-09 13:55 *
By Mirco Dotta
Description changed from Auto indentation is wrong a... to Auto indentation is wrong a...
My bad, this is a duplicate of 1000415. I've added a comment there describing where we should look to fix the issue.