diff --git a/src/printer.mjs b/src/printer.mjs index a9f06c170..5d6807ab6 100644 --- a/src/printer.mjs +++ b/src/printer.mjs @@ -1039,9 +1039,9 @@ function printLines(path, options, print, childrenAttribute = "children") { const beforeInline = childNode.leadingComments && childNode.leadingComments.length ? [ - isFirstNode && node.kind !== "namespace" && !isBlockNestedNode - ? " +
x
+ + +=====================================output===================================== + +x
+ + +================================================================================ +`; + +exports[`if.php 1`] = ` +====================================options===================================== +parsers: ["php"] +printWidth: 80 + | printWidth +=====================================input====================================== + +post
+ + +=====================================output===================================== + +post
+ + +================================================================================ +`; diff --git a/tests/inline-comment-after-if/braces.php b/tests/inline-comment-after-if/braces.php new file mode 100644 index 000000000..462a74fa7 --- /dev/null +++ b/tests/inline-comment-after-if/braces.php @@ -0,0 +1,5 @@ + +x
+ diff --git a/tests/inline-comment-after-if/if.php b/tests/inline-comment-after-if/if.php new file mode 100644 index 000000000..4d1d87990 --- /dev/null +++ b/tests/inline-comment-after-if/if.php @@ -0,0 +1,4 @@ + +post
+