redhat-developer / redhat-developer/vscode-java

Static import quick fix offered on unrelated error

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

@rgrunber がすでに取り組んでいます。

2024年6月7日 から。

bug
主要言語
TypeScript
スター
2.3k
フォーク
546
平均マージ
20時間 1分
マージ済み PR(30日)
11

説明

A quick fix offerering to static import a static method is offered even when the method is already static imported. This happens when the method is called with incorrect arguments.
 

Environment
  • Operating System: Ubuntu 22.04
  • JDK version: whatever installs by default when installing Extension Pack for Java
  • Visual Studio Code version: 1.90.0-insiders
  • Java extension version: Published 2024-05-18, 01:26:55 (installed 2024-05-20, 08:24:11)
Steps To Reproduce
  1. Create a class with a static method, eg DatabaseMock.connect
  2. import static java.fixes.DatabaseMock.connect
  3. Call connect incorrectly.

https://github.com/sandersn/ai-fix-examples/tree/main/java/fixes

I haven't used Java in almost 20 years, I was just experimenting with AI quick fixes in different languages. It's possible that my scrabbled-together project in the linked repo is required for the error to show up.

Expected Result

Only "Create method ..." fix should be offered.

Current Result

In addition, "Add static import for ..." fix is offered.

Additional Information

Clicking on the fix does nothing. The method is already static imported.

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

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

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