You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
google-java-format-eclipse-plugin-1.11.0.jar does not format the same as command line #642
package some.test;
public class Test {
String myLongString =
"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.";
}
Eclipse formats it just as above. google-java-format-1.11.0-all-deps.jar on the comamnd line formats it as follows:
package some.test;
public class Test {
String myLongString =
"The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."
+ " The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy"
+ " dog.";
}
Activity
cies commentedon Aug 30, 2021
Possibly related to #566
cushon commentedon Aug 30, 2021
The CLI has a separate pass that reflows long strings literals (corresponding to
--skip-reflowing-long-strings):google-java-format/core/src/main/java/com/google/googlejavaformat/java/FormatFileCallable.java
Line 48 in 5104d0b
The plugin currently just runs the core formatter logic, not the string reflowing part.
blutorange commentedon Mar 21, 2022
Most likely related, the CLI formats short comments like
while the Eclipse plugin formats it like