-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add multi folder support #104
Conversation
I don't think the explicit LSP-client-switching is a good idea, because then the infoview only has access to one client. If you use the pin functionality then you should be able to interact with the pin even if it is from another workspace folder. Instead we should route the LSP requests (and notification subscriptions) depending on the document URI. That is, if the infoview makes an LSP request, we look at the the URI (which should maybe become an explicit argument of sendClientNotification and co.) and then send it to the responsible LSP server. And the serverRestarted event should probably send all connected servers then. The current version of the PR also seems to open every file in all LSP servers:
|
@gebner , thanks for the bug report, I suspect I have to filter out sendNotification calls for files opened in a different workspace now, see this commit. Here's the process tree which shows it is no longer opening every file in every client:
|
Done. See InfoView is now mult-client aware. |
Great! |
See in this vscode multi-server sample and see: https://github.com/microsoft/vscode/wiki/Adopting-Multi-Root-Workspace-APIs
Here's a screenshot showing a multi-folder workspace open with 2 different versions of lean specified in the lean-toolchain of each folder. It fires up 2 different
lean --server
instances, one for each folder, and seamlessly switches between them as you edit files from each folder. The InfoView expects an "active client changed" event and "reconnects" that client to the infoview as the user switches between active workspaces.Here's the process tree you will see for serving both these workspaces, 2 lean --servers with their separate workers.