redhat-developer / redhat-developer/vscode-java

.xml formatter file is ignored

Đang mở
#2,798 5 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug configuration formatter
Ngôn ngữ chính
TypeScript
Star
2.3k
Fork
546
Merge trung bình
20 giờ 1 phút
Pull request đã merge (30 ngày)
11

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Tái hiện hành vi của formatter trong một dev container của VS Code bằng settings.json và .vscode/eclipse-java-google-style.xml, với các giá trị comment.line_length và lineSplit được báo cáo. So sánh đầu ra định dạng hiện tại và đầu ra mong đợi; hoàn tất khi các thiết lập của XML formatter được tôn trọng thay vì các giá trị mặc định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, vscode
Lĩnh vực
tooling
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.