redhat-developer / redhat-developer/vscode-java

.xml formatter file is ignored

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

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

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

説明

.xml formatter file is ignored when formatting files through vscode. (meybe default value used)
The project folder is opened in docker container.
eclipse-java-google-style.xml is created as bellow.

  1. copy and paset from https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml
  2. change comment.line_length and lineSplit
Environment
  • Operating System: Windows11
  • JDK version: openjdk version "1.8.0_352"
  • Visual Studio Code version: 1.73.1
  • Java extension version: Language Support for Java(TM) by Red Hat v1.12.0
Steps To Reproduce

settings.json

"java.format.settings.url": ".vscode/eclipse-java-google-style.xml",
"java.format.settings.profile": "GoogleStyle",

eclipse-java-google-style.xml

<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="30"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="999"/>

log

!ENTRY org.eclipse.jdt.ls.core 1 0 2022-11-14 17:46:16.037
!MESSAGE >> New configuration: {java=...format={enabled=true, settings={url=.vscode/eclipse-java-google-style.xml, profile=GoogleStyle}...}
Current Result
	// the example of long comment and method aaaa aaaa aaaa aaaa aaaa aaaa aaaa
	// aaaa aaaa aaaa aaaa aaaa aaaa
	private void examplePrintNumber(int firstExamplePrintNumber, int secondExmaplePrintNumber,
			int thirdExamplePrintNumber, int fourthExamplePrintNumber, int fifthExamplePrintNumber) {
		System.out.println(firstExamplePrintNumber + secondExmaplePrintNumber + thirdExamplePrintNumber
				+ fourthExamplePrintNumber + fifthExamplePrintNumber);
	}
Expected Result
	// the example of long comment and method
	// aaaa aaaa aaaa aaaa aaaa aaaa aaaa aaaa
	// aaaa aaaa aaaa aaaa aaaa
	private void examplePrintNumber(int firstExamplePrintNumber, int secondExmaplePrintNumber, int thirdExamplePrintNumber, int fourthExamplePrintNumber, int fifthExamplePrintNumber) {
		System.out.println(firstExamplePrintNumber + secondExmaplePrintNumber + thirdExamplePrintNumber + fourthExamplePrintNumber + fifthExamplePrintNumber);
	}

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

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

はじめの一歩

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

調査の方向性

settings.json と .vscode/eclipse-java-google-style.xml を使用し、報告された comment.line_length と lineSplit の値で、VS Code dev container 内の formatter の動作を再現する。現在のフォーマット出力と期待されるフォーマット出力を比較する。デフォルト値ではなく XML formatter の設定が適用されれば完了。

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

評価

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

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

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