redhat-developer / redhat-developer/vscode-java
Additional source directories are not put on classpath
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Additional source directories that are included using the build-helper-maven-plugin in a Maven project seem to not be made available to the language server, and are thus not picked up by for instance Go To Declaration and Find References.
Consider the attached example project, consisting of three leaf projects: Child1, Child2 and Child3, organized in two parent projects: ParentA and ParentB, where Child3 has a dependency on Child2, and Child2 has a dependency on Child1.
In the first iteration, stored in before/, Child1 and Child2 is organized under ParentA, and Child 3 is organized under ParentB. In the second iteration, stored in after/, Child2 is merged with Child3, but to avoid changes in the project history, the files are still kept under ParentA's directory and included in Child3 using build-helper-maven-plugin.
Environment
- Operating System: Ubuntu Focal (20.04)
- JDK version: OpenJDK 17.0.10
- Visual Studio Code version: 1.87.2
- Java extension version: 1.28.1
Steps To Reproduce
- Observe that the project in the directory before/ can be successfully compiled with
mvn --also-make --batch-modewithout any warnings. - Start
code before/project.code-workspace - Navigate to parentB/child3/src/main/java/com/example/Qux.java
- Put the caret on the declaration of
Bar b, right-click and select Go to definition. - The file Bar.java opens
- Observe that the project in the directory after/ can be successfully compiled with
mvn --also-make --batch-modewithout any warnings. - Start
code after/project.code-workspace - Navigate to parentB/child3/src/main/java/com/example/Qux.java
- Put the caret on the declaration of
Bar b. - Notice that it now gives the problem "Bar cannot be resolved to a type".
Current Result
In step 10, the class Bar cannot be found.
Expected Result
Step 10 should be like step 5, that the file Bar.java was opened when Go to definition was invoked.
Additional Information
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先解压 issue-3544.zip,并比较 before/ 和 after/ 中的 Maven 工作区项目。运行列出的 mvn 命令,然后在每个工作区中从 Qux.java 对 Bar 重现 Go to definition。完成的标准是 after/ 项目能够解析 Bar,并像 before/ 一样打开 Bar.java。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- developer-experience, tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 32/100