redhat-developer / redhat-developer/vscode-java

Add formatter options to format multiple parameters with new lines

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

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

formatter preferences question
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ả

I'd like my code to be formatted with new lines for annotation, constructor or method call or declaration with multiple parameters.

For instance:

@Parameter(
    in = ParameterIn.PATH,
    name = "resourceName",
    description = "Resource Name",
    required = true,
    example = "1",
    schema = @Schema(type = SchemaType.STRING, minLength = 1)
)

Current formatter makes a one-liner like this:

@Parameter(in = ParameterIn.PATH, name = "resourceName", description = "Resource Name", required = true, example = "1", schema = @Schema(type = SchemaType.STRING, minLength = 1))

So the formatter should insert new line after the opening brace and comma and before the closing brace.

Environment
  • Operating System: MacOs Monterey 12.3
  • JDK version: openjdk version "11.0.15" 2022-04-19
  • Visual Studio Code version: 1.67.2
  • Java extension version: v1.6.0
Steps To Reproduce
  1. Add annotation with multiple parameters
  2. Format the code
  3. In my current formatter version it should compact it to one line
Current Result
@Parameter(in = ParameterIn.PATH, name = "resourceName", description = "Resource Name", required = true, example = "1", schema = @Schema(type = SchemaType.STRING, minLength = 1))
Expected Result
@Parameter(
    in = ParameterIn.PATH,
    name = "resourceName",
    description = "Resource Name",
    required = true,
    example = "1",
    schema = @Schema(type = SchemaType.STRING, minLength = 1)
)

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 bằng ví dụ chú thích và kiểm tra entry point của formatter cùng với cách xử lý tùy chọn hiện có. Công việc hoàn tất khi việc định dạng có thể cấu hình đặt các tham số trên các dòng riêng biệt sau dấu phân cách mở và các dấu phẩy, trước dấu phân cách đóng, với mức thụt lề như mong đợi.

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
Lĩnh vực
tooling
Loại issue
Tính năng
Độ 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.