eclipse-lsp4e / eclipse-lsp4e/lsp4e

workspace folders are configured twice at startup

Open
#1,372 2 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

During initialization of the language server, we already transmit the workspace folders, see
https://github.com/eclipse-lsp4e/lsp4e/blob/bbf499f99fbd3416033c4fbe618c8282a6b74808/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java#L433

When we are done with the initialization, we immediately schedule a job to send a WorkspaceFoldersChangeEvent with same projects again, see:
https://github.com/eclipse-lsp4e/lsp4e/blob/bbf499f99fbd3416033c4fbe618c8282a6b74808/org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java#L727-L746

Depending on how the language server handles a WorkspaceFoldersChangeEvent, this might degrade the initial responsiveness of the LS quite a bit.
For example, basedpyright has to remove all workspace folders only to add them all back again.

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 in org.eclipse.lsp4e/src/org/eclipse/lsp4e/LanguageServerWrapper.java, reading the initialization logic around line 433 and the scheduled workspace-folder job around lines 727-746. Trace both notification paths and verify that initialization no longer sends the same workspace folders twice, while preserving the intended workspace-folder state after startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.