redhat-developer / redhat-developer/vscode-java

vscode-java reports "cannot be resolved" errors in Gradle plugin project with mix of Groovy and Java

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

还没有人认领这个 Issue。

Gradle upstream
主要语言
TypeScript
星标
2.3k
派生
546
平均合并
20 小时 1 分钟
30 天内合并 PR
11

描述

In Gradle plugins implemented with a mix of Java and Groovy, vscode-java reports "cannot be resolved" errors in .java files that reference classes defined in .groovy files. Gradle can compile and build the plugin successfully.

Environment
  • Operating System: macOS 10.15.4
  • JDK version:
    openjdk version "13.0.2" 2020-01-14
    OpenJDK Runtime Environment (build 13.0.2+8)
    OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)
    
  • Visual Studio Code version:
    Version: 1.45.0-insider
    Commit: abb4a35cfc26102f93fd00df7b59ce1a19c2017a
    Date: 2020-04-28T05:34:21.109Z (20 hrs ago)
    
  • Java extension version: 0.60.0
Steps To Reproduce
  1. Clone https://github.com/a01fe/gradle-groovy-java-plugin
  2. cd gradle-groovy-java-plugin/test; ./gradlew javaTask
    This builds the plugin and runs a task in the plugin to verify it compiles and builds successfully
  3. Open the project in vscode and open src/main/groovy/foo/task/JavaTask.java, vscode-java reports errors on all the references to JavaTaskSpec.

贡献指南

打开贡献指南

从这里开始

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

调研方向

首先使用 cd gradle-groovy-java-plugin/test; ./gradlew javaTask 重现该问题,然后在 VS Code 中打开 src/main/groovy/foo/task/JavaTask.java,检查对 JavaTaskSpec 的引用上的诊断信息。将 language server 的行为与成功的 Gradle 构建进行比较;当这些错误的 "cannot be resolved" 错误不再出现时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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