redhat-developer / redhat-developer/vscode-java

Static import quick fix offered on unrelated error

Aperta
#3,656 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

@rgrunber ci sta già lavorando.

Dal 7/6/2024.

bug
Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.