redhat-developer / redhat-developer/vscode-java

vscode-java tries to compile temporary files

Offen
#676 2 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

bug compile priority/P1
Vorherrschende Sprache
TypeScript
Sterne
2.3k
Forks
546
Ø Merge
20 Std. 1 Min.
Gemergte PRs (30 T.)
11

Beschreibung

It seems like the extension automatically adds temporary files to the build path and then never removes them.

Environment
  • Operating System: Windows
  • JDK version: 1.8
  • Visual Studio Code version: 1.28.1 (and previous versions)
  • Java extension version: 0.32.0
Steps To Reproduce
  1. Create a maven (probably the same with gradle) based java project
  2. Add to git repository
  3. Compile, debug, check that everything works.
  4. Right-click a file, compare to previous version
  5. Debug the project - it will fail to compile.
  6. Check extension log, you will see a lot of errors of unable to resolve dependencies and also that the type that was in the file you compared is already defined.
    Bonus section
  7. Close VS Code
  8. Open again, with same project
  9. Try to debug - it will still fail to compile.
  10. Check the extension log, you will see a single error, something like:
    Error occured while building workspace. Details:
    message: The project was not built since the source file /jdt.ls-java-project/src/com/test/test/testfile-2dfd1f2d__202220CoCQDMrqr9JO.java could not be read;code: 0
Current Result

Whenever I compare a file to it's previous version, vscode cannot compile my project anymore

Expected Result

To only compile files that are in the path of the project, not temporary files.

Additional Informations

This will most problably also resolve #390
Workaround - close Code, delete workspace cache, open project again.

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

Reproduziere das Problem in einem Maven-basierten Java-Projekt anhand der aufgeführten Vergleichs- und Debug-Schritte und untersuche anschließend das Verhalten des Erweiterungsprotokolls und des Workspace-Caches. Verfolge, wie temporäre Vergleichsdateien in den Build-Pfad des Projekts gelangen; als abgeschlossen gilt die Aufgabe, wenn das Debugging ohne ungelöste Abhängigkeiten oder Fehler aufgrund doppelter Typen erfolgreich ist, auch nach einem Neustart von VS Code.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
java, vscode
Bereich
developer-experience, 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.