redhat-developer / redhat-developer/vscode-java
Gradle Source Dependencies do not Show up in Intellisense
还没有人认领这个 Issue。
- 主要语言
- TypeScript
- 星标
- 2.3k
- 派生
- 546
- 平均合并
- 20 小时 1 分钟
- 30 天内合并 PR
- 11
描述
Gradle source dependencies (introduction article: https://blog.gradle.org/introducing-source-dependencies) do not show up inside of intellisense (and by extent, the debugger). Gradle can still build and run the projects fine, but the editor itself doesn't see any of it.
Example settings.gradle:
sourceControl {
gitRepository("https://github.com/EliSauder/robot-lib-test.git") {
producesModule("org.frcnomad:lib")
}
}
Example build.gradle
plugins {
id "application"
}
group = 'org.frcnomad'
repositories {
mavenCentral()
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
mainClassName = 'org.frcnomad.robot.Main'
dependencies {
implementation('org.frcnomad:lib') {
version {
branch = 'noFRC'
}
}
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.3.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.3.1'
testImplementation "org.mockito:mockito-core:2.+"
testImplementation "org.mockito:mockito-junit-jupiter:2.+"
}
tasks.named('test') {
useJUnitPlatform()
}
The dependency that is not being resolved is org.frcnomad:lib (a test library I wrote to test source dependencies)
Prior to pursuing this path I created a stack overflow issue here:
https://stackoverflow.com/questions/65912344/vscode-not-recognizing-gradle-source-dependency
Environment
- Operating System: Windows 10 Pro - Build 19042
- JDK version: 11.0.10
- Visual Studio Code version: 1.52.1
- Java extension version: 0.74.0
- Gradle: 6.0.1 & 6.8.1 (I tested both versions)
Steps To Reproduce
- Create a gradle library to be used as a dependency and then post it publicly to any git server (such as github).
- Using gradle's source dependencies require that project directly from the git server.
- Intellisense will not detect the contents of the library however gradle will still build and run just fine.
Sample Projects:
Application: https://github.com/EliSauder/robot-test/tree/e652b3670f2bb63f1224c55d346fc5c95d0b1d49 (Linked to a commit since I have switched to jitpack until vscode works with source deps)
Library: https://github.com/EliSauder/robot-lib-test/tree/noFRC
Logs From VSCode (Includes me opening VSCode to opening a file that imports the source dependency): https://1drv.ms/u/s!As6xGUN6WyzakMVHpmJm6sVig9gbIw
Current Result
Intellisense does not recognize any of the contents of a source dependecy
Expected Result
Intellisense should recognize the contents of a source dependency
Additional Informations
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用提供的 settings.gradle 和 build.gradle 源依赖配置,通过链接的应用程序和库示例项目复现该问题。首先检查 Java 扩展如何处理 Gradle 依赖项,然后验证 org.frcnomad:lib 是否出现在 IntelliSense 中;当其内容能够被识别,同时 Gradle 仍能成功构建和运行时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100