redhat-developer / redhat-developer/vscode-java

Java Formatter settings are not used

Đang mở
#3,020 8 bình luận 0 reaction 0 người được giao Xem trên GitHub

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

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ả

If I open the flow-server project from https://github.com/vaadin/flow/tree/main/flow-server

and have Eclipse formatter settings set to use https://raw.githubusercontent.com/vaadin/flow/main/eclipse/VaadinJavaConventions.xml which defines <setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
image

then when I open e.g. the HandlerHelperTest.java file, VS Code shows "Spaces: 8" in the bottom bar and formatting the file changes it to use indentation of 8 spaces instead of 4

The settings file should be fine because when I go back to command line and run mvn formatter:format in the project, the indentation is changed back to 4 spaces.

Environment
  • Operating System: macOs Ventura
  • JDK version: 17
  • Visual Studio Code version: 1.76.2
  • Java extension version: 1.16.0
Steps To Reproduce
  1. See above
Current Result

File is not formatted according to given settings

Expected Result

File is formatted according to given settings

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 vấn đề bằng cách mở flow-server với VaadinJavaConventions.xml được cấu hình trong VS Code, sau đó so sánh việc định dạng HandlerHelperTest.java với kết quả của mvn formatter:format. Theo dõi cách tiện ích mở rộng Java đọc và áp dụng các thiết lập của trình định dạng. Hoàn thành khi VS Code sử dụng nhất quán thụt lề bốn dấu cách đã cấu hình cùng với trình định dạng Maven.

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
developer-experience, 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
42/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.