-
Notifications
You must be signed in to change notification settings - Fork 147
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
Trailing Comma Support #262
Trailing Comma Support #262
Conversation
@marekzebrowski great, thanks for the PR. Can you please add a test to verify expected behavior? For example, create
|
For sure that PR will change formatting - commas will be removed. I don't exactly have time now to work on a solution that does not change it, so you may just drop PR. |
We can leave it open, clearly there are users interested in having it implemented. I too am and have been stretched thin time-wise. Hopefully someone can step up and take the PR to the finish line. |
I made a parser spec to test this PR, and it failed on trailing comma at the parser level. I'm going to see if I can get this working with a formatting option + test. Adding to this, ref for trailing tokens: http://docs.scala-lang.org/sips/completed/trailing-commas.html |
+1 |
I would be interested in keeping the comma during formatting, but even deleting it sounds better than formatting bailing out completely. Is there a chance this could be merged at some point? |
fbae075
to
d270248
Compare
I updated PR and added super basic test case. It should not blow up, it does not delete trailing commas (in most places at least). I don't have more time now to test it better at this point. |
@godenji what's the status on that one? I would really be nice to have! |
Is it possible to reduce scope here such that we can make incremental progress / deliver incremental value to users of Scalariform? As @quicquid and @marekzebrowski both point out, "not crashing" when parsing trailing commas is a huge improvement by itself, even if preservation of trailing commas during reformatting doesn't work 100% perfectly. This parser crash issue is blocking support for trailing commas in Scalastyle (see scalastyle/scalastyle#276). The current crash is also a huge usability / developer productivity issue (especially for new Scala developers) because the As long as this current patch doesn't introduce significant correctness issues (i.e. it doesn't introduce the potential for Scalariform reformatting to change the meaning of a program) then I think it makes sense to merge it and cut a new release, thereby unblocking Scalastyle and delivering incremental value to Scalariform users. /cc @matthewfarwell and @godenji. |
there's clearly a lot of interest in this. curious, what's next here? is there any opposition to merging this PR? who could merge it? this came up recently over at https://contributors.scala-lang.org/t/preliminary-developer-survey-results/2681/13 |
Should have time to merge this and cut a release this weekend. |
Yay, let's get out of the coma! |
#260