redhat-developer / redhat-developer/vscode-java
Java formatter ignores org.eclipse.jdt.core.formatter.tabulation.size and uses editor's 'tab size' when calculating line split
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Java formatter ignores org.eclipse.jdt.core.formatter.tabulation.size and uses editor's 'tab size' when calculating how lines should be split. This makes it difficult for users to use their preferred indentation size without throwing off source control history diffs.
Environment
- JDK version: openjdk version "17.0.10" 2024-01-16 LTS
- Visual Studio Code version: 1.86.2
- Java extension version: 1.28.1
Steps To Reproduce
Relevant settings:
- Java formatter
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>and<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>in my java formatter
(full formatting file: java-formatter.xml.txt)) - VS Code set to
tab size: 4
If I have a line that is 121 characters, the formatter will wrap appropriately. However, if someone else has their tab size:2, the total line length is calculated to be less than 120, and thus will unwrap the lines wich throws off the file history diffs.
Current Result
Line split is calculated based on VS Code's tab size setting, instead of the formatter's tabulation.size
Expected Result
Line split should be calculated based on the tabulation.size setting, to allow users to have their preferred tab size within VS Code
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、指定された lineSplit と tabulation.size の設定で、VS Code のタブサイズを変えながらフォーマッタの動作を再現します。Java formatter の行長がどこで計算されているかを追跡し、Expected Result と照合して結果を確認します。行分割にはエディターのタブサイズではなく tabulation.size を使用する必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, vscode
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100