I use the latest google-java-format Intellij plugin based on google-java-format 1.9. As I understand it, this version should support Java 14/15 features like switch expressions and text blocks. In our case if any of the mentioned language features are used formatting stops working.
Just wanted to ask whether this may be a bug in my setup or if you're seeing the same problems?
Intellij IDEA Version: Ultimate Edition 2020.2.3 (Build #IU-202.7660.26, built on October 6, 2020)
Operating System: Ubuntu 20.04.1 LTS
Here is a small example:
public class FormatTest {
enum Test {
A, B
}
public static void main(String[] args) {
String foo = "This should not be here";
Test t = Test.A;
String foobar = switch(t) {
case A -> "foobar";
case B -> "barfoo";
};
String xyz = """
""";
}
}
When I try to format this inside the IDE nothing happens. It shows that it's reformatting the code but the formatting doesn't change.There is no error as far as I can see.
However, formatting it with google-java-format-1.9-all-deps.jar it outputs correctly:
public class FormatTest {
enum Test {
A,
B
}
public static void main(String[] args) {
String foo = "This should not be here";
Test t = Test.A;
String foobar =
switch (t) {
case A -> "foobar";
case B -> "barfoo";
};
String xyz = """
""";
}
}
Any help concerning this issue would be very much appreciated! Thanks for your great work!
I use the latest
google-java-formatIntellij plugin based ongoogle-java-format 1.9. As I understand it, this version should support Java 14/15 features like switch expressions and text blocks. In our case if any of the mentioned language features are used formatting stops working.Just wanted to ask whether this may be a bug in my setup or if you're seeing the same problems?
Intellij IDEA Version:
Ultimate Edition 2020.2.3 (Build #IU-202.7660.26, built on October 6, 2020)Operating System:
Ubuntu 20.04.1 LTSHere is a small example:
When I try to format this inside the IDE nothing happens. It shows that it's reformatting the code but the formatting doesn't change.There is no error as far as I can see.
However, formatting it with
google-java-format-1.9-all-deps.jarit outputs correctly:Any help concerning this issue would be very much appreciated! Thanks for your great work!