redhat-developer / redhat-developer/vscode-java

Gradle "includeBuild" no longer recognizes imported classes in the IDE

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

还没有人认领这个 Issue。

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

描述

When utilizing "includeBuild" in the settings.gradle file, the IDE no longer recognizes java imports/objects from the included project. Compiling in gradle via the command line continues to work as expected.

Environment
  • Operating System: Windows
  • JDK version: 1.8/17
  • Visual Studio Code version: 1.88.1
  • Java extension version: 1.29
Steps To Reproduce
  1. Run gradle init to generate a java library called 'inc1'
  2. Run gradle init to generate a java library called 'inc2'
  3. Add 'group="inc2"' to inc2 build.gradle
  4. Add includeBuild '..\\inc2' to the inc1 settings.gradle file
  5. Add implementation "inc2:lib:1.0.0" to inc1 build.gradle dependencies
  6. Create class Lib2.java in the inc2 project
  7. Import and instantiate the Lib2 object in the inc1 project
  8. Run gradle assemble in inc1 and verify success
  9. Open inc1 in VSCode and verify it can not locate the Lib2 object

[Sample Project]

Current Result

The Lib2 import cannot be resolved in VSCode

Expected Result

The Lib2 import can be resolved in VSCode

Additional Informations

贡献指南

打开贡献指南

从这里开始

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

调研方向

从链接的示例项目开始,使用 inc1/settings.gradle、inc1/build.gradle 和包含的 inc2 项目重现该问题;将成功的 gradle assemble 输出与 VS Code 中无法解析的 Lib2.java import 进行比较。跟踪 Java 扩展对 includeBuild 依赖项的处理方式,并在 VS Code 中能够解析 Lib2 import 且 Gradle 构建仍然成功时,将该问题视为完成。

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

评估

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

把新 issue 发到你的邮箱

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