microsoft/vscode-gradle

Multiple Gradle projects cannot be loaded

dougclayton opened this issue · 7 comments

Extension Name: vscode-gradle
Extension Version: 3.13.5
OS Version: Win11
VSCode version: 1.90.0

Describe the bug
Two Java-based Gradle projects in one workspace make only one Java project show up. This does not occur with 3.13.0 (verified with repeated version toggling). It also only breaks if the java plugin is applied.

To Reproduce
Create a new workspace with these files:
simple1/build.gradle
simple2/build.gradle

Each build.gradle just consists of the following line:

apply plugin: 'java'

Switch to 3.13.5 and run "Java: Clean Language Server Workspace".

Expected behavior
Both simple1 and simple2 Java projects should be listed in "Java Projects". Instead, only simple1 shows up.

Screenshots

image

Output from "Gradle for Java"

[info] [gradle-server] Server started, listening on 32769
[info] Gradle client connected to server

Does the bug still exist if you disable all other extensions?
Yes.

Additional context
As mentioned, it works in 3.13.0 and first broke in 3.13.1.

This bug is still present as of 3.14.1.

Do Simple1 and Simple2 have any kind of relationship, like include build?

Or they are just two independent projects?

They don't have any relationship. It's literally just two files in the entire workspace, each with a single line in them.

This bug is still present as of 3.16.0.

Sorry, it should be related with the project scan mechanism I think:

public boolean applies(IProgressMonitor monitor) throws OperationCanceledException, CoreException {

So far, there are some workaround:

  1. Open simple1 and simple2 in two vscode windows separately.
  2. Disable the setting java.gradle.buildServer.enabled

Yes, agreed it's probably an issue in the scan code. Neither of your suggestions works for us, so our workaround is to downgrade to 3.13.0 but that won't last forever. Is opening a workspace with multiple Gradle projects officially supported? Because this bug doesn't require any kind of strange setup, just 2 trivial Java projects.