redhat-developer / redhat-developer/vscode-java
Unable to suggest field name in the presence of annotation and compilation errors
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、Java extension を使用して VS Code で問題を再現します。アノテーション付きメソッドに構文エラーを追加し、次にフィールドを追加して、アノテーションを削除した場合と名前の候補を比較します。アノテーションおよびコンパイルエラーがあるにもかかわらず、アノテーション付きの場合にもフィールド名の候補が表示され続ければ、問題は解決です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- devtools, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100