redhat-developer / redhat-developer/vscode-java

Formatting a java source file results in a weird presentation

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

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

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

説明

After update the extension to version 1.13.0. I get weird code formatting results.

Environment
  • Operating System: RockyLinux 8.6
  • JDK version: openjdk 17.0.5
  • Visual Studio Code version: 1.74.3
  • Java extension version: 1.13.0
Steps To Reproduce
  1. Start of with a file. any file.
  2. Fiddle around the file ie: putting 2 imports on the same line
  3. Add some tabs before another import
  4. run the formatter (right-click and format this document)
Current Result

After Upgrading to 1.13.0
After upgrading to 1 13 0

After running the formatter I end up with this
image

Same formatter output, but with some tabs to show the the indentation isn't aligning properly.
image

Expected Result

The indentation should always be exact!

Additional Informations

I also have the Spring boot extensions installed.
After updating to version 1.13.0, I get some visual cues that my file contains a Spring Bean.

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

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

はじめの一歩

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

調査の方向性

ソースファイル、テスト、エントリーポイントは指定されていません。指定された VS Code、Java extension、JDK、Rocky Linux 環境でフォーマットのケースを再現し、その後 Java フォーマッターの統合を追跡して、インポートとインデントが揃っていない理由を特定します。報告された視覚的な手がかりなしに、フォーマットによって常に正確に揃ったインデントが生成されれば完了です。

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

評価

技術スタック
java, vscode
領域
developer-experience, tooling
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
30/100

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

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