prettier-java
prettier-java copied to clipboard
fix: align with JDK 22 spec
What changed with this PR:
Aligns the parser more closely with the JDK 22 spec, most notably fixing some rules that weren't properly supporting unnamed variables.
Example
Input
public sealed interface SadPanda {
default String cry() {
return switch(this) {
case A _, B _, C _ -> "A lot";
};
}
record A() implements SadPanda {}
record B() implements SadPanda {}
record C() implements SadPanda {}
}
Output
public sealed interface SadPanda {
default String cry() {
return switch (this) {
case A _, B _, C _ -> "A lot";
};
}
record A() implements SadPanda {}
record B() implements SadPanda {}
record C() implements SadPanda {}
}
Relative issues or prs:
Closes #665