redhat-developer / redhat-developer/vscode-java

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

Open
#3,235 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Gradle
Dominant language
TypeScript
Stars
2.3k
Forks
546
Avg merge
20h 1m
Merged PRs (30d)
11

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the Gradle project, settings.gradle.kts, build.gradle.kts, and mylib/src/main/java/com/example/demo/MyClass.java described in the report. Start by comparing IntelliSense before and after Developer: Reload Window, then inspect the Java extension's handling of the newly added submodule. Done means prompts work in MyClass.java without reloading the VS Code window.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.