From be059e0b4087368658a6b3b6e706d17c5cf32c5c Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Fri, 10 Jan 2025 19:22:30 +0100 Subject: [PATCH] Have JavaPrinter print TrailingComma marker (#191) --- .../openrewrite/javascript/internal/JavaScriptPrinter.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java b/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java index 7be8e88..7308e50 100644 --- a/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java +++ b/rewrite-javascript/src/main/java/org/openrewrite/javascript/internal/JavaScriptPrinter.java @@ -1412,10 +1412,7 @@ protected void visitStatement(@Nullable JRightPadded paddedStat, JRig @Override public M visitMarker(Marker marker, PrintOutputCapture

p) { - if (marker instanceof TrailingComma) { - p.append(","); - visitSpace(((TrailingComma) marker).getSuffix(), Space.Location.LANGUAGE_EXTENSION, p); - } else if (marker instanceof Semicolon) { + if (marker instanceof Semicolon) { p.append(';'); } return super.visitMarker(marker, p);