redhat-developer / redhat-developer/vscode-java

Eclipse formatter option parentheses_positions_in_method_invocation not considered regardless its value

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

还没有人认领这个 Issue。

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

描述

Java code formatter in VSCode is not yet supporting the org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation option. And identical issue was raised here: https://github.com/revelc/formatter-maven-plugin/issues/343.

Can it be that VSCode uses an older version of the Eclipse formatter plugin?

Environment
  • Operating System: MacOS
  • JDK version: 15
  • Java extension version: rehhat.java v0.79.2
  • Visual Studio Code version:
    Version: 1.57.0
    Commit: b4c1bd0a9b03c749ea011b06c6d2676c8091a70c
    Date: 2021-06-09T17:22:31.215Z (1 wk ago)
    Electron: 12.0.9
    Chrome: 89.0.4389.128
    Node.js: 14.16.0
    V8: 8.9.255.25-electron.0
    OS: Darwin x64 19.6.0
Steps To Reproduce
method(
    arg1,
    arg2,
    arg3
);

is always formatted to:

method(
    arg1,
    arg2,
    arg3);

regardless of the value given to the Eclipse formatter option org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation (set to preserve_positions).

It would be nice to at least not join wrapped lines according to <setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>.

贡献指南

打开贡献指南

从这里开始

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

调研方向

使用 Java 代码片段以及 Eclipse 中针对 parentheses_positions_in_method_invocation 和 join_wrapped_lines 的格式化设置,在 VS Code 中重现该问题。然后跟踪 extension 的 formatter 集成,并确定选项在哪个环节丢失;当配置的值得到遵循,并且在 join_wrapped_lines 为 false 时换行的行不会被合并,即视为完成。

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

评估

技术栈
java, typescript, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

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