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

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



http://youtrack.jetbrains.net/issue/SCL-1822

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.

-tt
0
2 comments

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.

0

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. :)

0

Please sign in to leave a comment.