Skip to content

.xml formatter file is ignored #2798

Open
@kaneyon

Description

@kaneyon

.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);
	}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions