New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing sources with trailing commas (supported since Scala 2.12.2+) #276

Open
nktpro opened this Issue Aug 27, 2017 · 7 comments

Comments

Projects
None yet
7 participants
@nktpro
Copy link

nktpro commented Aug 27, 2017

Scala 2.12.2+ added support for trailing commas. However scalastyle currently doesn't parse source files correctly when trailing commas are used. An error similarly to "Expected identifier, but got Token(RPAREN,),xxx,))" is thrown.

As a very simple example:

package foo.bar

object TrailingCommaTest {
  def trailingCommaTest(
    foo: String,
    bar: Boolean,
  ) = {}
}
@canoztokmak

This comment has been minimized.

Copy link
Contributor

canoztokmak commented Sep 21, 2017

It looks like a scalariform issue.. The exception you receive is thrown by scalariform parser.. It would be great if you file an issue here.

@matthewfarwell

This comment has been minimized.

Copy link
Member

matthewfarwell commented Sep 26, 2017

It is unfortunately true that we are dependent upon scalariform here. We'll need to get them to change it.

@JoshRosen

This comment has been minimized.

Copy link
Contributor

JoshRosen commented Oct 6, 2018

I've commented on a Scalariform PR to push for making incremental progress here: if Scalaiform can get to a point where the parser doesn't crash, even if preservation of trailing commas doesn't work during automated reformatting, then that unblocks a fix here in Scalastyle (solving the problem for folks who use only Scalastyle and not Scalariform) and solves a huge usability issue (confusing error messages). See scala-ide/scalariform#262 (comment)

@godenji

This comment has been minimized.

Copy link

godenji commented Feb 8, 2019

Scalariform 0.2.7 has been released (with trailing comma support).

@SethTisue

This comment has been minimized.

Copy link

SethTisue commented Feb 8, 2019

#332 does the upgrade

@adam-ah

This comment has been minimized.

Copy link

adam-ah commented Feb 13, 2019

Any news on when this might be fixed/released?

@SethTisue

This comment has been minimized.

Copy link

SethTisue commented Feb 14, 2019

hmm, the contributions graph at https://github.com/matthewfarwell doesn't look promising. silence at https://twitter.com/matthewfarwell also

anyone know Matthew IRL and could ask him if he could anoint additional maintainers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment