redhat-developer / redhat-developer/vscode-java

Intellisense not working when creating a submodule in a Gradle project unless reload vscode window

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

还没有人认领这个 Issue。

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

描述

Environment
  • Operating System: Arch linux (Remote Development Host)
  • JDK version: Gradle: languageVersion.set(JavaLanguageVersion.of(8)) / System: 17 (installed by sdkman install java)
  • Visual Studio Code version: 1.80.2
  • Java extension version: v1.21.0
Steps To Reproduce
  1. create a new Gradle application project using gradle init and using Kotlin DSL
  2. making a new submodule
mkdir -p mylib/src/main/java/com/example/demo
touch mylib/src/main/java/com/example/demo/MyClass.java
# ... and writing some java code for this file

the content of mylib/src/main/java/com/example/demo/build.gradle.kts

plugins {
    id("java")
}


java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(8))
    }
}
  1. add this submodule to settings.gradle.kts
- include("app")
+ include("app", "mylib")
  1. now try to use this lib in app module, it works well, all prompt are working well
  2. open mylib/src/main/java/com/example/demo/MyClass.java, try put some code to this file, but there are no any prompt (e.g. press sout should show a dropdown contains a snippet item for System.out.println, but there is no any on there)
  3. Ctrl+Shift+P and then running Developer: Reload Window, now all working well
Current Result

see above

Expected Result

see above

Additional Informations

I'm also using vscjava.vscode-gradle.

Please let me know if you can't reproduce this problem or need a log file, I'm busy for working and I will send some detail you need after work.

贡献指南

打开贡献指南

从这里开始

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

调研方向

使用报告中描述的 Gradle 项目、settings.gradle.kts、build.gradle.kts 和 mylib/src/main/java/com/example/demo/MyClass.java 重现该问题。首先比较 Developer: Reload Window 前后的 IntelliSense,然后检查 Java 扩展如何处理新添加的子模块。当 MyClass.java 中的提示无需重新加载 VS Code 窗口即可正常工作时,即表示完成。

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

评估

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

把新 issue 发到你的邮箱

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