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

Choose 'best' resource when file url is ambiguous #107

Merged

Conversation

kdvolder
Copy link
Contributor

@kdvolder kdvolder commented Apr 21, 2022

In Eclipse workspace it is possible that a single file corresponds
to multiple workspace resources. This typically arises in 'multi-project'
setups where both the parent project and its nested children are
imported into the workspace.

This creates all sorts of confusions and subtle bugs.

The logical solution seems to be to deliberatly choose the
'most nested' resource instead of just arbitarily picking the
first one found.

This small PR does just that in LSPEclipseUtils.

This indirectly fixes issues in STS such as:

spring-projects/sts4#769
spring-projects/sts4#747

cc @BoykoAlex

In Eclipse workspace it is possible that a single file corresponds
to multiple workspace resources. This typically arises in 'multi-project'
setups where both the parent project and its nested children are
imported into the workspace.

This creates all sorts of confusions and subtle bugs.

The logical solution seems to be to deliberatly choose the
'most nested' resource instead of just arbitarily picking the
first one found.

This small does just that in LSPEclipseUtils.

This indirectly fixes issues in STS such as:

spring-projects/sts4#769
spring-projects/sts4#747
@martinlippert
Copy link
Contributor

@mickaelistria What do you think about this one? I think the overall issue to avoid opening the file that is associated with a parent project (in case of multi module maven projects for example) and instead the file "in the real project" makes super sense, but I wonder it you have any suggestions for the implementation?

@mickaelistria mickaelistria merged commit 5e337b4 into eclipse:master May 2, 2022
@mickaelistria
Copy link
Contributor

Thanks for this good change!

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