redhat-developer / redhat-developer/vscode-java

Comment formatting not consistent with Eclipse with same xml profile

未关闭
#1,399 3 条评论 3 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug formatter
主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先,使用提供的 Eclipse XML 配置文件和 Javadoc 代码片段,通过 Format Selection 在 VS Code 中重现 Java 注释格式化差异。将当前结果与预期结果以及 Eclipse 截图进行比较;当格式化后的注释与此配置文件的 Eclipse 输出一致时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。