Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag @snippet not respected when formatting Javadoc #3802

Open
future2r opened this issue Oct 7, 2024 · 1 comment
Open

Tag @snippet not respected when formatting Javadoc #3802

future2r opened this issue Oct 7, 2024 · 1 comment

Comments

@future2r
Copy link

future2r commented Oct 7, 2024

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

@rgrunber
Copy link
Member

It might be related to our implementation of @snippet support in JDT-LS, eclipse-jdtls/eclipse.jdt.ls#2028 . There's a few things lacking from our support listed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants