-
Notifications
You must be signed in to change notification settings - Fork 108
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.