diff --git a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.kt b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.kt index f56a4f0d17fb..bb8d89484d30 100644 --- a/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.kt +++ b/java/java-tests/testSrc/com/intellij/java/psi/formatter/java/JavadocFormatterTest.kt @@ -2314,20 +2314,51 @@ public class Test { RIGHT_MARGIN = 120 } - doTextTest(""" + val before = """ /// only this should be reformated /// ```java /// @Annotation public static final @Annotation2 List myList = List.of("a", "b", "c"); /// ``` public class Foo { } - """.trimIndent(), """ + """.trimIndent() + + val after = """ /// only this should be reformated /// ```java /// @Annotation public static final @Annotation2 List myList = List.of("a", "b", "c"); /// ``` public class Foo { } - """.trimIndent()) + """.trimIndent() + + doTextTest(before, after) + doTextTest(after, after) + } + + fun testMarkdownTildeCodeBlock() { + settings.apply { + WRAP_COMMENTS = true + RIGHT_MARGIN = 120 + } + + val before = """ + /// only this should be reformated + /// ~~~java ~ + /// @Annotation public static final @Annotation2 List myList = List.of("a", "b", "c"); + /// ~~~ + public class Foo { + } + """.trimIndent() + val after = """ + /// only this should be reformated + /// ~~~java ~ + /// @Annotation public static final @Annotation2 List myList = List.of("a", "b", "c"); + /// ~~~ + public class Foo { + } + """.trimIndent() + doTextTest(before, after) + doTextTest(after, after) } } \ No newline at end of file