redhat-developer / redhat-developer/vscode-java

Comment formatting not consistent with Eclipse with same xml profile

Open
#1,399 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug formatter
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

I'm using an Eclipse format XML profile to indent/format my java code in VS Code. For comments, the same profile is generating different results.

Environment
  • Operating System: macOS Catalina 10.15.4
  • JDK version: OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_252-b09)
  • Visual Studio Code version: 1.44.2
  • Java extension version: 0.60.0 (April 16, 2020)
Steps To Reproduce

Settings for Java format:

Screen Shot 2020-04-17 at 8 37 21 PM

Eclipse formatting profile from the settings above (unzip to get the XML profile):

eclipse-java-formatter.xml.zip

  1. Paste the following code snippet in a Java file.
/**
 * Javadoc headline describing the method
 * 
 * Detailed description:
 * - point 1
 * - point 2
 * - point 3
 *
 * @param param1
 * @param param2
 * 
 * @return something
 */
  1. Select the code snippet and run Format Selection from the command palette.
Current Result
Screen Shot 2020-04-17 at 8 29 25 PM
Expected Result
Screen Shot 2020-04-17 at 8 41 10 PM

Eclipse output with the same profile:

Screen Shot 2020-04-17 at 8 30 19 PM
Additional Informations

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Java comment-formatting difference in VS Code with the supplied Eclipse XML profile and the Javadoc snippet, using Format Selection. Compare the current result with the expected and Eclipse screenshots; done means the formatted comments match the Eclipse output for this profile.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.