redhat-developer / redhat-developer/vscode-java
Scala import cannot be resolved in Java project
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 2.3k
- Forks
- 546
- Ø Merge
- 20 Std. 1 Min.
- Gemergte PRs (30 T.)
- 11
Beschreibung
I am working on a Java Play 2.6 project and wanted to switch from eclipse (ScalaIDE) to VSCode (because I use VSCode for everything else and I largely prefer to work with it rather than eclipse).
In Eclipse, I have no problem importing a Scala source ( scala.collection.Seq ) but in VScode, opening the same Eclipse project and having no problem with all other external librairies, it cannot resolve the scala.collection.Seq import. (more precisely it's the scala.collection import ).
When compiling my project in the console using sbt, I have no problem.
Also Eclipse is able to resolve that import. Maybe it has to do with the "Scala library container" exlipse plugins of ScalaIDE
Environment
- Linux Ubuntu 16.04
- JDK version: 1.8
- Visual Studio Code version: 1.23.1
- Java extension version: Language support for Java(TM) by Red Hat 0.26.0
Steps To Reproduce
- Create a Java play project using sbt
- Import it in ScalaIDE
- Create a class that imports
scala.collection.Seq - Open the project in VSCode.
Logs : No errors in the logs.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, das Problem mit einem mit sbt erstellten Java-Play-2.6-Projekt zu reproduzieren, und vergleiche dann die Abhängigkeitsauflösung von VSCode mit den funktionierenden Eclipse- und Konsolen-Builds. Das Problem ist behoben, wenn das Java-Projekt den Import scala.collection.Seq in VSCode ohne Fehler auflöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, scala, 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