redhat-developer / redhat-developer/vscode-java
All sources open as java even when they are not.
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- TypeScript
- Star
- 2.3k
- Fork
- 546
- Merge trung bình
- 20 giờ 1 phút
- Pull request đã merge (30 ngày)
- 11
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với luồng Go to definition cho các nguồn bên ngoài và tái hiện hành vi bằng dự án non-java-dep-sources-sample.zip được liên kết, bao gồm Scala Kafka client của dự án. Truy tìm lý do các nguồn khả dụng được mở dưới dạng tệp .class, sau đó xác minh rằng nguồn không còn được giả định là Java và extension Scala đã cài đặt có thể cung cấp tính năng tô sáng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java, scala, typescript, vscode
- Lĩnh vực
- developer-experience, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100