Reformat (command+option+L) behaves differently with/without selection code block
Answered
I use Google formating file.
I have a code block like below:
private boolean isInProgress(A a) {
return Optional.of(a)
.map(A::getB)
.map(C.class::cast)
.map(C::getD)
.map(D::getE)
.stream()
.flatMap(List::stream)
.anyMatch();
}
When I press command+option+L without highlighting the code, it would usually reformat the entire class. Since this is the format I want, it says `no lines changed`.
But once I highlight my code block and press again, the reformatting changes the code to
private boolean isInProgress(A a) {
return Optional.of(a).map(A::getB)
.map(C.class::cast).map(C::getD).map(D::getE)
.stream()
.flatMap(List::stream)
.anyMactch();
So why the reformatting behaves differently?
Please sign in to leave a comment.
Is it reproduced with all 3rd party plugins disabled?
What is "Google formating file" in your case? Is it a EditorConfig file, or set of IDE settings?
Intellij code style XML schema file.
Can you share that file? I cannot reproduce that problem in the default installation.