redhat-developer / redhat-developer/vscode-java

Static import quick fix offered on unrelated error

Abierto
#3,656 1 comentario 0 reacciones 1 asignado Ver en GitHub

@rgrunber ya está trabajando en esto.

Desde el 7/6/2024.

bug
Lenguaje dominante
TypeScript
Estrellas
2.3k
Forks
546
Merge medio
20 h 1 min
PR fusionados (30 d)
11

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.