-
Notifications
You must be signed in to change notification settings - Fork 886
Formatting code with intellij plugin and using the jar gives different results #566
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
Comments
Possibly related to #642 |
The CLI has a separate pass that reflows long strings literals (corresponding to google-java-format/core/src/main/java/com/google/googlejavaformat/java/FormatFileCallable.java Line 48 in 5104d0b
The IntelliJ plugin currently just runs the core formatter logic, not the string reflowing part. |
Hi, |
@eShorko don't hold your breath. I've added git hooks to format all code with the cli on commit to keep things consistent and force the same formatting for everything that is committed. |
This is causing me grief at work as well. |
too bad IntelliJ plugin still cannot line break |
So... this has been a problem for me too and after I debugged the source of the problem I found my way here. Is there any reason why the IntelliJ plugin doesn't reflow long strings by default, @cushon ? Seems like an easy fix to add:
to the plugin. One could even make it configurable, much like the formatting style. I can produce a patch but wanted to make sure it's not some kind of policy to not make any structural changes to the code in the plugin (I don't see the reason for it). |
This is giving me grief as well. |
If I format the following file using the intellij plugin (IDE version: Ultimate
2020.2.4
/ plugin version: google-java-format1.9.0.0
. ) I get different result when compared to using the jar on the command line.original example file:
after formatting using intellij plugin (using menu code / reformat code) I get this:
And after formatting on the command line:
I get this:
The text was updated successfully, but these errors were encountered: