redhat-developer / redhat-developer/vscode-java
Java build is failing when trying to import from enum file
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 2.3k
- Fork
- 546
- Merge medio
- 20h 1m
- PR unite (30g)
- 11
Descrizione
Environment
- Operating System: Windows 10 (ssh remote to ubuntu)
- JDK version: Java 8
- Visual Studio Code version: 1.47.1
- Java extension version: 0.9.1
Steps To Reproduce
If you have two enum files with the same package structure, vscode can't figure out which one you are trying to import
Say for example, your source code has an enum (MyEnum), and your test code has the same enum but with an additional value (NON_EXISTING_TYPE), vscode will complain the enum value doesn't exist. Intellij does not have this problem however.
Here com.my.example.MyEnum exists both in source and test folder, and this is how I would import the test enum:
import static com.my.example.MyEnum.NON_EXISTING_TYPE;
It will highlighted with red squigly line, with message:
The import com.my.example.MyEnum.NON_EXISTING_TYPE cannot be resolved Java(268435846)
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo l’importazione statica con file MyEnum duplicati nelle cartelle del codice sorgente e dei test, utilizzando l’ambiente e le versioni elencati. Traccia il modo in cui l’estensione Java risolve i tipi del codice sorgente e dei test; il lavoro è completato quando l’importazione NON_EXISTING_TYPE dell’enum di test viene risolta senza una diagnostica.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- java
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 38/100