vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Tag @snippet not respected when formatting Javadoc

Open future2r opened this issue 1 year ago • 0 comments

If I use the Java18 snippet tag, all Javadoc is still joined to a single line. I copied the formatter settings from an Eclipse project, where everything works fine.

Environment
  • Operating System: Windows 11
  • JDK version: OpenJDK 21
  • Visual Studio Code version: 1.94.0
  • Java extension version: 1.35.1
Steps To Reproduce
  1. Create a Java file with this content
public class SnippetTest {

    /**
     * This is a snippet test.
     * {@snippet : 
     * System.out.println("Hello World");
     * }
     * @param args
     *            the arguments
     */
    public static void main(final String[] args) {
        System.out.println("Hello World");
    }
}
  1. Format the file with the attached settings.
Current Result
public class SnippetTest {

    /**
     * This is a snippet test. {@snippet : System.out.println("Hello World"); }
     * 
     * @param args
     *            the arguments
     */
    public static void main(final String[] args) {
        System.out.println("Hello World");
    }
}
Expected Result

see the first code block

Additional Informations

format.zip

future2r avatar Oct 07 '24 08:10 future2r