vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

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

Open dev-techmoe opened this issue 2 years ago • 0 comments

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.

dev-techmoe avatar Aug 03 '23 08:08 dev-techmoe