redhat-developer / redhat-developer/vscode-java

Eclipse formatter option parentheses_positions_in_method_invocation not considered regardless its value

Open
#1,986 2 comments 0 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

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"/>.

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

Reproduce the issue in VS Code with the Java snippet and the Eclipse formatter settings for parentheses_positions_in_method_invocation and join_wrapped_lines. Then trace the extension's formatter integration and determine where the option is lost; done means the configured value is respected and wrapped lines are not joined when join_wrapped_lines is false.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.