Option for Trailing Commas Support

I was hoping to be able to use the `scala-commas` compiler plugin [1]. Which modifies scalac so that trailing commas will parse successfully. A trailing comma is a comma after the last element in a list of terms e.g. List(1,2,3,). It's very useful to have when editing multline lists or arguments to functions when moving them around or commenting some of them out.

I was wondering if it would be possible to add a small setting someplace that allowed trailing comma support? I think this support existed a long time ago back in the 2.7 days when Scala still natively supported the feature. Right now it causes extraneous red errors that can be ignored.

It also seems that there is a SIP for the feature as well, however there is a bit of a chicken and the egg problem, the SIP will have harder time getting accepted if the tooling doesn't support it, and the tooling won't absolutely have to support it until it's a standard language feature.

1: https://github.com/47deg/scala-commas

2: SIP = https://github.com/dwijnand/scala.github.com/blob/79dee4b8fbc36e4d5f207e89ca501ba982b8e485/sips/pending/_posts/2016-06-25-trailing-commas.md

3: https://github.com/scala/scala/pull/5245

1 comment
Kate Ustyuzhanina
Comment actions Permalink

Hi Benjamin,

I've created a ticket https://youtrack.jetbrains.com/issue/SCL-10597


Please sign in to leave a comment.