Skip to content

LSP4E does not seem to support multiple editors for the same file, and multiple projects for the same file #258

@treilhes

Description

@treilhes

The issue exhibited here only happens when the eclipse workspace contains a file accessible from more than one project which is a common case when working on maven multi modules projects (i think gradle multi modules projects are also impacted but i did not check)

Eclipse workspace with 2 projects : parent_project, nested_project
Where nested_project is contained in parent_project

parent_project
|
-- nested_project
    |
    -- file.ext

nested_project
|
-- file.ext   

With this kind of workspace, we have two cases:

  • When the projects presentation is "Hierarchical", the file edited is the most nested and the method LSPEclipseUtils.findResourceFor(uri) will return the correct IResource (provided the function LSPEclipseUtils.findMostNested works properly)
  • When the projects presentation is "Flat", the method is totaly unreliable because more than one valid value can be returned and the most nested is not necessarily the one edited or the only one edited. (the test LSPEclipseUtilsTest.testURIToResourceMappingWithNestedProject provided in pull request LSPEclipseUtils.findMostNested now returns the most nested project #259 to see the issue)

So when using the "Flat" project presentation the side effects can affect the following methods:

side_effects

Do you agree with my assumptions ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions