redhat-developer / redhat-developer/vscode-java

Add formatter options to format multiple parameters with new lines

オープン
#2,483 コメント 1 件 リアクション 3 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

formatter preferences question
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

I'd like my code to be formatted with new lines for annotation, constructor or method call or declaration with multiple parameters.

For instance:

@Parameter(
    in = ParameterIn.PATH,
    name = "resourceName",
    description = "Resource Name",
    required = true,
    example = "1",
    schema = @Schema(type = SchemaType.STRING, minLength = 1)
)

Current formatter makes a one-liner like this:

@Parameter(in = ParameterIn.PATH, name = "resourceName", description = "Resource Name", required = true, example = "1", schema = @Schema(type = SchemaType.STRING, minLength = 1))

So the formatter should insert new line after the opening brace and comma and before the closing brace.

Environment
  • Operating System: MacOs Monterey 12.3
  • JDK version: openjdk version "11.0.15" 2022-04-19
  • Visual Studio Code version: 1.67.2
  • Java extension version: v1.6.0
Steps To Reproduce
  1. Add annotation with multiple parameters
  2. Format the code
  3. In my current formatter version it should compact it to one line
Current Result
@Parameter(in = ParameterIn.PATH, name = "resourceName", description = "Resource Name", required = true, example = "1", schema = @Schema(type = SchemaType.STRING, minLength = 1))
Expected Result
@Parameter(
    in = ParameterIn.PATH,
    name = "resourceName",
    description = "Resource Name",
    required = true,
    example = "1",
    schema = @Schema(type = SchemaType.STRING, minLength = 1)
)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

アノテーションの例を使ってフォーマッタの動作を再現し、フォーマッタのエントリポイントと既存のオプション処理を調査します。設定可能なフォーマットによって、開き区切り文字の後と各コンマの後、および閉じ区切り文字の前で、期待されるインデントを付けてパラメータが別々の行に配置されれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
tooling
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。