redhat-developer / redhat-developer/vscode-java
Unable to suggest field name in the presence of annotation and compilation errors
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 547
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
Environment
- Operating System: Linux x64 5.4.28-1-MANJARO
- JDK version: OpenJDK 11.0.6
- Visual Studio Code version: 1.43.2
- Java extension version: 0.59.0
Hello!
This issue was first reported in the wrong repo (https://github.com/MicrosoftDocs/intellicode/issues/182), but disabling IntelliCode didn't affect the issue, so it was suggested the issue could be in vscode-java. Here it is:
Steps to Reproduce / Scenario:
- Create a class with a method and with an annotation on it. Do some syntax typo on that method.
- Add a new field on the class and wait for the field name suggestion.
- IntelliCode will not be able to suggest the field name.
If you comment out the annotation, it will suggest the field name just fine.
- Create a class with a method without any annotation on it. Do some syntax typo on that method.
- Add a new field on the class and wait for the field name suggestion.
- IntelliCode will suggest the field name just fine.
Here is a gif showing the issue:

This issue particularly bothers when developing with Spring Boot, which uses a lot of annotation. If I try to add a new field on an existent class that has methods with annotation, I'll not get proper name suggestion because while I'm typing private MyField and wait for the name suggestion, my code will already be invalid (with compilation errors), and because of that I'll not get the myField name suggestion.
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 vấn đề trong VS Code với Java extension: thêm lỗi cú pháp vào một phương thức có chú thích, sau đó thêm một trường và so sánh gợi ý tên khi đã xóa chú thích. Vấn đề được giải quyết khi các gợi ý tên trường vẫn xuất hiện trong trường hợp có chú thích, bất chấp các lỗi chú thích và biên dịch.
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
- devtools, 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