redhat-developer / redhat-developer/vscode-java
Code action for static import doesn't work well in a specific case
Đang mở
Chưa có ai nhận issue này.
bug
- 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ả
Environment
- Operating System: Windows
- JDK version: 17.0.8
- Visual Studio Code version: 1.95.0
- Java extension version: 1.36.0
Steps To Reproduce
- Open https://github.com/junit-team/junit5-samples/tree/master/junit5-migration-maven
- Open FirstTest.java file
- Comment out
import static org.junit.jupiter.api.Assertions.assertEquals; - Add
import static org.junit.Assert.*; - Click quick fix before
assertEquals
Current Result
- It shouldn't show the option
Add static import for 'Assert.assertEquals'as it has been included inimport static org.junit.Assert.*;. And this option doesn't work if clicking it. - Without
import static org.junit.Assert.*;, code actionAdd static import for 'Assert.assertEqualsworks only at first time. After first clicking, it still shows this option even the import has been added.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện hành vi quick-fix trong FirstTest.java của mẫu junit5-migration-maven, sử dụng các phiên bản VS Code và Java extension được liệt kê nếu có sẵn. So sánh các đề xuất sau khi thêm import static org.junit.Assert.*; và sau khi áp dụng static-import action một lần. Hoàn tất khi action không được cung cấp nếu wildcard import đã bao phủ assertEquals và không còn xuất hiện sau khi import được thêm vào.
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, typescript, 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
- 35/100