redhat-developer / redhat-developer/vscode-java

All sources open as java even when they are not.

未关闭
#1,026 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug highlighting navigation
主要语言
TypeScript
星标
2.3k
派生
547
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从外部源的 Go to definition 流程开始,并使用链接的 non-java-dep-sources-sample.zip 项目(包括其 Scala Kafka client)复现该行为。跟踪可用源为何会作为 .class 文件打开,然后验证不再假定源是 Java,并确认已安装的 Scala 扩展可以提供高亮。

由索引模型根据 Issue 内容生成。

评估

技术栈
java, scala, typescript, vscode
领域
developer-experience, tooling
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。