-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
Is it possible to use the same Server for 2 scripts open in 2 tabs #307
Comments
The language server protocol is stateful, there is a handshake at start, so the protocol wasn't really designed for this, so there is no trivial way. This being said, you can still implement a kind of "proxy" which play the role of the client to the server, and the role of the server to the client. |
Oh I didn't read the title properly! If you want 2 clients on the same server, I guess it's still possible using the same kind of proxy, you'll just need a "main" client responsible for the file update, and a specific logic for each server notifications/requests |
Thanks for the update @CGNonofr . is there any example code for creating the proxy?. |
I'm not aware of any implementation of it but I didn't search much. Btw I'll probably have this need in the soon future so stay tuned. |
Hi @CGNonofr is there any update on this? |
I've already implemented a prototype so I can guarantee it's possible Btw the code is not ready yet to be shared, ask me again in some weeks :) |
I think you can give a try to https://github.com/CodinGame/languageserver-mutualized. It can do a little more than what you need (it allows multiple clients to edit the same file). Do not hesitate to provide some feedback |
Hi @CGNonofr , This solves most of the problem. I have one clarification.. Thanks |
Please open an issue on the other repo and close your issue here, we'll not disturb this repo ;) |
Actually, in the earlier approach where we open separate server for each browser tab this scenario was working. Now with new approach this is not working |
So you have an issue using the languageserver-mutualized lib right? Why doesn't creating an issue there seem relevant to you? Btw I need some clarifications on
What is a "workspace language"? What doesn't work? |
I am using Java Language Server, In this each maven project is a separate workspace. I have created a new issue in the other repo. We can track this in the new issue |
Based on the example given, each time we open the script in a monaco editor in a browser a new server is started, is there a way to reuse the already started server.
The text was updated successfully, but these errors were encountered: