redhat-developer / redhat-developer/vscode-java

.xml formatter file is ignored

未关闭
#2,798 5 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug configuration formatter
主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
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. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 settings.json 和 .vscode/eclipse-java-google-style.xml,在 VS Code dev container 中重现 formatter 行为,并使用报告的 comment.line_length 和 lineSplit 值。比较当前和预期的格式化输出;当 XML formatter 设置得到遵循而不是使用默认值时即完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, vscode
领域
tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。