eclipse-lsp4e / eclipse-lsp4e/lsp4e

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

Open
#258 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
85
Forks
69
Avg merge
8h 33m
Merged PRs (30d)
6

Description

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 #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 ?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with LSPEclipseUtils.findResourceFor(uri) and LSPEclipseUtils.findMostNested, then run LSPEclipseUtilsTest.testURIToResourceMappingWithNestedProject from pull request #259 against a workspace containing nested projects. Trace the affected methods shown in the issue and determine how flat project presentation should select the edited resource; done when the mapping is reliable and the regression test passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.