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
121 stars 49 forks source link

Path must include project and resource name #1527

Closed deckydev closed 1 month ago

deckydev commented 1 month ago

I have a multi-module gradle project where one project has a source directory in the root folder (../src). The gradle build works fine, and the project imports and works in eclipse. But I cannot get it to work in vscode anymore (things worked fine before I switched to multimodule). This is the error I see when importing the project that I think is the cause of all the other errors.

Path must include project and resource name: /src java.lang.IllegalArgumentException: Path must include project and resource name: /src at org.eclipse.core.runtime.Assert.isLegal(Assert.java:68) at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2224) at org.eclipse.core.internal.resources.Container.getFolder(Container.java:205) at com.microsoft.gradle.bs.importer.GradleBuildServerBuildSupport.getResourceEntries(GradleBuildServerBuildSupport.java:407) at com.microsoft.gradle.bs.importer.GradleBuildServerBuildSupport.updateClasspath(GradleBuildServerBuildSupport.java:226) at com.microsoft.gradle.bs.importer.GradleBuildServerProjectImporter.importToWorkspace(GradleBuildServerProjectImporter.java:186) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.importProjects(ProjectsManager.java:164) at org.eclipse.jdt.ls.core.internal.managers.ProjectsManager.initializeProjects(ProjectsManager.java:126) at org.eclipse.jdt.ls.core.internal.handlers.InitHandler$1.runInWorkspace(InitHandler.java:277) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:43) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

I tried adding a symlink from folder/projectA/src -> folder/src and that setup project correctly, but I see duplicate files everywhere. Is there someway I can get this to work?

jdneo commented 1 month ago

Hi @deckydev,

Thank you for the feedback, is it possible to share a sample project that having this issue to us?

jdneo commented 1 month ago

Should be fixed by #1575