Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.openrewrite.style.Style;

import java.util.Optional;
import java.util.function.Supplier;

import static org.openrewrite.java.format.AutodetectGeneralFormatStyle.autodetectGeneralFormatStyle;

Expand Down Expand Up @@ -58,17 +57,20 @@ public J visit(@Nullable Tree tree, P p, Cursor cursor) {
t = new WrappingAndBracesVisitor<>(Style.from(WrappingAndBracesStyle.class, cu, IntelliJ::wrappingAndBraces), stopAfter)
.visit(t, p, cursor.fork());

TabsAndIndentsStyle tabsAndIndentsStyle = Style.from(TabsAndIndentsStyle.class, cu, IntelliJ::tabsAndIndents);
SpacesStyle spacesStyle = Style.from(SpacesStyle.class, cu, IntelliJ::spaces);

t = new SpacesVisitor<>(
Style.from(SpacesStyle.class, cu, IntelliJ::spaces),
spacesStyle,
cu.getStyle(EmptyForInitializerPadStyle.class),
Style.from(EmptyForIteratorPadStyle.class, cu),
stopAfter
).visit(t, p, cursor.fork());

t = new NormalizeTabsOrSpacesVisitor<>(Style.from(TabsAndIndentsStyle.class, cu, IntelliJ::tabsAndIndents), stopAfter)
t = new NormalizeTabsOrSpacesVisitor<>(tabsAndIndentsStyle, stopAfter)
.visit(t, p, cursor.fork());

t = new TabsAndIndentsVisitor<>(Style.from(TabsAndIndentsStyle.class, cu, IntelliJ::tabsAndIndents), stopAfter)
t = new TabsAndIndentsVisitor<>(tabsAndIndentsStyle, spacesStyle, stopAfter)
.visit(t, p, cursor.fork());

t = new NormalizeLineBreaksVisitor<>(Optional.ofNullable(Style.from(GeneralFormatStyle.class, cu))
Expand Down
Loading