redhat-developer / redhat-developer/vscode-java

Unable to suggest field name in the presence of annotation and compilation errors

Offen
#1,361 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

content-assist
Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

Environment
  • Operating System: Linux x64 5.4.28-1-MANJARO
  • JDK version: OpenJDK 11.0.6
  • Visual Studio Code version: 1.43.2
  • Java extension version: 0.59.0

Hello!

This issue was first reported in the wrong repo (https://github.com/MicrosoftDocs/intellicode/issues/182), but disabling IntelliCode didn't affect the issue, so it was suggested the issue could be in vscode-java. Here it is:

Steps to Reproduce / Scenario:

  1. Create a class with a method and with an annotation on it. Do some syntax typo on that method.
  2. Add a new field on the class and wait for the field name suggestion.
  3. IntelliCode will not be able to suggest the field name.

If you comment out the annotation, it will suggest the field name just fine.

  1. Create a class with a method without any annotation on it. Do some syntax typo on that method.
  2. Add a new field on the class and wait for the field name suggestion.
  3. IntelliCode will suggest the field name just fine.

Here is a gif showing the issue:

autocomplete

This issue particularly bothers when developing with Spring Boot, which uses a lot of annotation. If I try to add a new field on an existent class that has methods with annotation, I'll not get proper name suggestion because while I'm typing private MyField and wait for the name suggestion, my code will already be invalid (with compilation errors), and because of that I'll not get the myField name suggestion.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das Problem in VS Code mit der Java extension zu reproduzieren: Füge einer annotierten Methode einen Syntaxfehler hinzu, füge dann ein Feld hinzu und vergleiche den Namensvorschlag mit entfernter Annotation. Das Problem ist behoben, wenn im annotierten Fall trotz Annotation- und Kompilierungsfehlern weiterhin Feldnamensvorschläge angezeigt werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, typescript, vscode
Bereich
devtools, tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.