redhat-developer / redhat-developer/vscode-java

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

Aperta
#1,361 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

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.

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.

Direzione di ricerca

Inizia riproducendo il problema in VS Code con la Java extension: aggiungi un errore di sintassi a un metodo annotato, quindi aggiungi un campo e confronta il suggerimento del nome con l’annotazione rimossa. Il problema è risolto quando i suggerimenti per i nomi dei campi continuano ad apparire nel caso annotato nonostante gli errori di annotazione e compilazione.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, typescript, vscode
Ambito
devtools, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.