Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during importing an Eclipse project whose sources are at root #2436

Closed
jdneo opened this issue Apr 27, 2022 · 1 comment · Fixed by eclipse-jdtls/eclipse.jdt.ls#2072
Assignees
Labels

Comments

@jdneo
Copy link
Collaborator

jdneo commented Apr 27, 2022

Prepare an Eclipse project, whose source are at project root:
eclipse-project.zip

Open it in VS Code, and following errors can be ovserved:

!MESSAGE An internal error occurred during: "Initialize workspace".
!STACK 0
java.lang.IllegalArgumentException: Path must include project and resource name: /eclipse-project
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2139)
	at org.eclipse.core.internal.resources.Container.getFolder(Container.java:205)
	at org.eclipse.jdt.ls.core.internal.managers.StandardProjectsManager.registerWatchers(StandardProjectsManager.java:414)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer$2.run(JDTLanguageServer.java:276)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
@rgrunber
Copy link
Member

rgrunber commented Apr 28, 2022

Reproduced as well.

So if (path.segmentCount() < ICoreConstants.MINIMUM_FOLDER_SEGMENT_LENGTH) is what causes this. We can't use getFolder(..) unless the path contains both a project and a folder in the path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants