redhat-developer / redhat-developer/vscode-java

Annotation processing causes spurious reporting in Problem pane

Đang mở
#3,302 1 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ả

Environment
  • Operating System: Ubuntu Focal 20.04.6
  • JDK version: 17.0.7
  • Visual Studio Code version: 1.82.2
  • Extensions:
    • vscjava.vscode-java-pack 0.25.14
    • vscjava.vscode-java-debug 0.54.0
    • redhat.java 1.22.1
    • vscjava.vscode-maven 0.42.0
    • vscjava.vscode-java-dependency 0.23.1
    • vscjava.vscode-java-test 0.39.1
Steps To Reproduce
  1. Unzip the attached project.zip file into an otherwise empty directory
  2. Start code bug.code-workspace
  3. Ensure that a text editor is not open for Foo.java
  4. Click that you trust the author of this workspace (to enable debugging)
  5. Observe that no problems are reported in the Problems pane
  6. Open the file src/test/java/com/example/QuxTest.java from the Explorer pane
  7. Right-click the triangular play icon next to public class QuxTest
  8. Choose Debug Test from the context menu
  9. Notice that a problem appear in the Problems pane for file Foo.java:
    "The method b() is undefined for the type Mumble"
  10. Click on the problem to open file src/main/java/com/example/Foo.java
  11. Notice that the problem disappears by itself as the editor for Foo.java opens
  12. Close the editor for Foo.java
  13. Exit VSCode
  14. Restart VSCode, as in point 1.
  15. Observe that the problem reappears in the Problem pane, this time without opening the debugger.
Current Result:

A problem is reported for the class used in an annotation.

Expected Result:

No problems should be reported.

Additional Informations:

I reckon that this problem is related to annotation processing inserting stubs for the depended-on classes, and then these stubs aren't resolved properly. It started to appear related to the debugger a couple of minor versions ago, but from 1.82.2 it also happens every time the project is loaded, after it has been triggered by the debugger initially.

@testforstephen In microsoft/vscode-java-debug issue #1247 you asked for a minimal example. This looks a lot like it is related, so maybe this could be used?

project.zip

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

Giải nén project.zip và làm theo quy trình tái hiện được đánh số của VS Code, so sánh các chẩn đoán trong Problems-pane trước và sau Debug Test cũng như sau khi khởi động lại. Sử dụng Foo.java và QuxTest.java làm trường hợp tối thiểu; được xem là hoàn tất khi lớp được annotation sử dụng không còn tạo ra vấn đề “method b() is undefined for the type Mumble” trong cả hai luồng.

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

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.