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

fix: Get correct Java project in multi-module case #1865

Merged
merged 5 commits into from
Sep 7, 2021

Conversation

jdneo
Copy link
Contributor

@jdneo jdneo commented Sep 3, 2021

This PR fixes a bug that reported in the stack trace in #2093.

Note: #2093 is about GTD not working. While this fix could not solve that problem but fix another one that we found in #2093 accidentally.

Here is the root cause:

When user opens a Java file, the status bar will show information like Language Level and VM installation path. Given a URI of a project, calling findContainersForLocationURI() will returns an array, for example:

捕获

Here we need the second one to get the JavaProject via javaCore.create(). but the previous sorting logic didn't handle the case correctly.

The new change will get all the project instance and sort them according to the fs path to get the most inner containing project.

Signed-off-by: sheche sheche@microsoft.com

Signed-off-by: sheche <sheche@microsoft.com>
Signed-off-by: sheche <sheche@microsoft.com>
Signed-off-by: sheche <sheche@microsoft.com>
@jdneo
Copy link
Contributor Author

jdneo commented Sep 6, 2021

test this please

Signed-off-by: Sheng Chen <sheche@microsoft.com>
Signed-off-by: Sheng Chen <sheche@microsoft.com>
@testforstephen
Copy link
Contributor

test this please

1 similar comment
@jdneo
Copy link
Contributor Author

jdneo commented Sep 7, 2021

test this please

@testforstephen testforstephen merged commit 89a1809 into eclipse-jdtls:master Sep 7, 2021
@testforstephen testforstephen added this to the Mid September 2021 milestone Sep 7, 2021
@jdneo jdneo deleted the cs/fix-2093 branch September 7, 2021 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants