redhat-developer / redhat-developer/vscode-java

Alternative equals code generation

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

@testforstephen đang làm issue này rồi.

Từ ngày 18/4/2019.

code action enhancement
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ả

Currently, the first part of an equals method is generated as:

        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        // ...

However, I'd prefer to have it as:

        if (this == obj) {
            return true;
        } else if (obj == null || getClass() != obj.getClass()) {
            return false;
        }

        // ...

condensing + adding a blank line after it.

If the current generation should be retained, it would be great to have a configuration option to set the preferred style, analog to what is available for toString generation already.

Environment
  • Visual Studio Code version: 1.33.1
  • Java extension version: 0.43.0

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.

Đánh giá

Issue này chưa được đánh giá.

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.