redhat-developer / redhat-developer/vscode-java

Code action for static import doesn't work well in a specific case

オープン
#3,835 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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
  1. Open https://github.com/junit-team/junit5-samples/tree/master/junit5-migration-maven
  2. Open FirstTest.java file
  3. Comment out import static org.junit.jupiter.api.Assertions.assertEquals;
  4. Add import static org.junit.Assert.*;
  5. Click quick fix before assertEquals
Current Result
  • It shouldn't show the option Add static import for 'Assert.assertEquals' as it has been included in import static org.junit.Assert.*;. And this option doesn't work if clicking it.
  • Without import static org.junit.Assert.*;, code action Add static import for 'Assert.assertEquals works only at first time. After first clicking, it still shows this option even the import has been added.

image

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. 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

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。