redhat-developer / redhat-developer/vscode-java
Java build is failing when trying to import from enum file
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
Environment
- Operating System: Windows 10 (ssh remote to ubuntu)
- JDK version: Java 8
- Visual Studio Code version: 1.47.1
- Java extension version: 0.9.1
Steps To Reproduce
If you have two enum files with the same package structure, vscode can't figure out which one you are trying to import
Say for example, your source code has an enum (MyEnum), and your test code has the same enum but with an additional value (NON_EXISTING_TYPE), vscode will complain the enum value doesn't exist. Intellij does not have this problem however.
Here com.my.example.MyEnum exists both in source and test folder, and this is how I would import the test enum:
import static com.my.example.MyEnum.NON_EXISTING_TYPE;
It will highlighted with red squigly line, with message:
The import com.my.example.MyEnum.NON_EXISTING_TYPE cannot be resolved Java(268435846)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
記載されている環境とバージョンを使用して、source フォルダーと test フォルダーに重複した MyEnum ファイルを配置した静的インポートをまず再現します。Java 拡張機能が source と test の型をどのように解決するかを追跡します。テスト enum の NON_EXISTING_TYPE インポートが診断なしで解決されれば作業は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100