Skip to content

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

Merged
testforstephen merged 5 commits into
eclipse-jdtls:masterfrom
jdneo:cs/fix-2093
Sep 7, 2021
Merged

testforstephen merged 5 commits into
eclipse-jdtls:masterfrom
jdneo:cs/fix-2093

Conversation

@jdneo

@jdneo jdneo commented Sep 3, 2021

Copy link
Copy Markdown
Contributor

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

jdneo commented Sep 6, 2021

Copy link
Copy Markdown
Contributor Author

test this please

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

Copy link
Copy Markdown
Contributor

test this please

1 similar comment
@jdneo

jdneo commented Sep 7, 2021

Copy link
Copy Markdown
Contributor Author

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.

3 participants