redhat-developer / redhat-developer/vscode-java
All sources open as java even when they are not.
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
Go to definition opens external sources as a .class file. As far as I can tell a file extension can only belong to a single language. In this case .class is related to java? The actual source file that corresponds to the .class file is not always a .java file. I suspect that if the source was opened as a .java, .scala, .clj etc... vscode would give proper syntax highlighting for the source
Environment
- Operating System: OSX 10.14.5
- JDK version: 1.8.0_162
- Visual Studio Code version: 1.36.1
- Java extension version: redhat.java@0.47.0
Steps To Reproduce
- Include a maven dependency that is not written in java.
- Go to definition for a class in that dependency.
Here is a sample project includes a scala kafka client. org.sample.app.App declares a SimpleConsumer, F12 on it.
non-java-dep-sources-sample.zip
Current Result
The source opens as a .class file and attempts to use the java syntax highlighting.

Expected Result
I would expect the source to not be assumed as java. With the scala extension installed I would expect scala highlighting to work.
Scala extension: https://marketplace.visualstudio.com/items?itemName=scala-lang.scala
Additional Informations
I did see #786 and it said that the .class extension is working as designed. I see this as a short coming. The .class extension makes sense if you are viewing decompiled code, but not once sources are available.
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 mit dem Go to definition-Ablauf für externe Quellen und reproduziere das Verhalten anhand des verknüpften Projekts non-java-dep-sources-sample.zip, einschließlich seines Scala Kafka client. Verfolge, warum verfügbare Quellen als .class-Dateien geöffnet werden, und überprüfe anschließend, dass die Quelle nicht mehr als Java vorausgesetzt wird und die installierte Scala-Erweiterung Syntaxhervorhebung bereitstellen kann.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java, scala, typescript, 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