microsoft / vscode-gradle

Manage Gradle Projects, run Gradle tasks and provide better Gradle file authoring experience in VS Code
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-gradle
MIT License
127 stars 53 forks source link

gradle project not detected for sub-folder #1237

Open bwgjoseph opened 2 years ago

bwgjoseph commented 2 years ago

Extension Name: vscode-gradle Extension Version: v3.12.1 OS Version: Windows 10 VSCode version: 1.67.2

Describe the bug

I'm not sure if this is a bug, or something that isn't suppported.

I have a root directory (non-gradle), but with sub folder that is a gradle projects, but when on vscode, the gradle project icon/view is not activated.

See sample project for example

Expected behavior

Gradle project view should be activated

Screenshots

This is the view in vscode

image

Notice the left bar does not include gradle extension icon

image

Output from "Gradle for Java"

[info] [gradle-server] Server started, listening on 53345
[info] Gradle client connected to server
[info] Build file opened: z:\spring-boot-consumer-driven-contract-demo\scc-provider\build.gradle
[info] Build file changed: z:\spring-boot-consumer-driven-contract-demo\scc-provider\build.gradle

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

Additional context

If I open the individual sub folder as the root project, then the extension will be activated as usual.

image

jdneo commented 1 year ago

Looks like it's caused by the extension does not detect the project in workspace: https://github.com/microsoft/vscode-gradle/blob/9ecf3b73d0dda2af10091dcf1db570750679e0eb/extension/src/Extension.ts#L229