REditorSupport / REditorSupport/languageserver

Handle multi workspace folders

Open
#621 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
675
Forks
118
Avg merge
1d 37m
Merged PRs (30d)
11

Description

Currently, we only support working with a single workspace in a Language Server session. The support of multi-root workspace (i.e. multiple workspace folders) is implemented on client side. For example, in vscode-R, we spawn a language server for each workspace folder and use documentSelector to make each language server only handle requests from the corresponding workspace folder.

However, the approach is somehow problematic in the following aspects:

  • Untitled documents do not belong to any workspace folder.
  • Some documents are stored in a workspace folder, but they should mostly be treated independently, i.e. rmd, notebooks, etc.
  • Each language server will by default spawns multiple child processes to handle parse, resolve, and diagnostics requests, which is too expensive for an average PC.

Therefore, I'd like to add native support for multi-root workspace in langaugeserver, and on client side, it just needs one client and one server to handle all requests. On server side, it seems that each workspace folder will need a process to start from the workspace folder so that the Rprofile and folder-specific settings could be properly respected.

Contributor guide

No contributing guide indexed for this repository

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 by tracing how the language server initializes workspace folders and child processes, then review the LSP workspaceFolders specification linked in the issue. The design must account for untitled documents, documents needing independent treatment, and folder-specific Rprofile and settings while reducing duplicate processes; no implementation files or tests are identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.