redhat-developer / redhat-developer/vscode-java
Code action for static import doesn't work well in a specific case
オープン
まだ誰も着手していません。
bug
- 主要言語
- TypeScript
- スター
- 2.3k
- フォーク
- 546
- 平均マージ
- 20時間 1分
- マージ済み PR(30日)
- 11
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、junit5-migration-maven サンプルの FirstTest.java における quick-fix の動作を、利用可能であれば記載された VS Code と Java extension のバージョンを使って再現します。import static org.junit.Assert.*; を追加した後と、static-import action を一度適用した後の候補を比較します。wildcard import がすでに assertEquals をカバーしている場合に action が提示されず、import の追加後にはその action が残らなくなれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, typescript, vscode
- 領域
- developer-experience, tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100