redhat-developer / redhat-developer/vscode-java

All sources open as java even when they are not.

Đang mở
#1,026 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug highlighting navigation
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
  1. Include a maven dependency that is not written in java.
  2. 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.
Screen Shot 2019-08-08 at 12 33 04 AM

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

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.