red code cause #2: usage of "->"

Another common "good code red" pattern in our projects is code like this:

Apart from being red, I think Ctrl-W / Introduce Variable also do not work as expected.
A lot of code involves working with tuples of some kind, and there's quite a bit of red at the moment.


That's a bug in the IDEA Scala parser.

It is is parsed as:

(lb += "c") -> 3

instead of:

lb += ("c" -> 3)

BTW, to get an insight into the structured parsed by IDEA, you can paste snippets of code into Tools -> PSI Viewer.


Thanks, I totally missed the fact that the PSI viewer was back again.
And, also thanks for Alexander for fixing the parser issue. Nightly build #0.3.1975 seems to parse such code correctly. :)


Please sign in to leave a comment.