Skip to content
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

Websockets built-in support #117

Closed
npradeep357 opened this issue Nov 22, 2021 · 7 comments · Fixed by #128
Closed

Websockets built-in support #117

npradeep357 opened this issue Nov 22, 2021 · 7 comments · Fixed by #128
Milestone

Comments

@npradeep357
Copy link
Contributor

npradeep357 commented Nov 22, 2021

Hi, I got a use case where I have to put up a websockets server on top of PYLSP.
Will there be any support for Websockets in future?

I'm trying to add one on my own atleast for my use-case but not able to understand the message flow structure. Can you provide help on how the messaging flow happens.

Main problem is: A/c to web sockets spec, there can be 'n' number of connections which can individually be a separate LSP session that means there should be 'n' PYLSP processes if using IO server.

I'm trying to setup 'n' PYLSP objects in a single process for 'n' web sockets connections. Is there a document on how the 'class PythonLSPServer' works.

Thank you in advance.

@ccordoba12
Copy link
Member

Will there be any support for Websockets in future?

No, we don't have plans to do that.

Can you provide help on how the messaging flow happens.

I don't know how it works, sorry.

Is there a document on how the 'class PythonLSPServer' works.

No, there isn't, sorry.

@npradeep357
Copy link
Contributor Author

Hi @ccordoba12 or the authors, as mentioned in my previous comment, i was able to create web sockets service on top of pylsp. It was able to serve multiple ws sessions on a single process with each session with Pylsp instance being sandboxed to itself.

But I need suggestions if this is valid and if it is adhering to the other parts of code.

Please provide me access to contribute so that i will create a branch upload my changes for review.

@ccordoba12
Copy link
Member

You can fork this repo, create a branch on it to do your changes and then submit a pull request from it.

We don't work with branches created directly on this repo, so you don't need extra permissions for that.

@npradeep357
Copy link
Contributor Author

You can fork this repo, create a branch on it to do your changes and then submit a pull request from it.

We don't work with branches created directly on this repo, so you don't need extra permissions for that.

Sure will do that

@krassowski
Copy link
Contributor

@npradeep357 not sure how helpful this is but jupyter_lsp is basically WebSockets proxy and it does not require any modifications to the pylsp itself.

@npradeep357
Copy link
Contributor Author

npradeep357 commented Nov 28, 2021

@krassowski it seems helpful… will this support multiple web socket connections (each connection will be a separate IDE session)? Also, it seems this is directly written for jupyter lab (the name also suggests so). Does this work with a different editor (let’s say some web editor like code-mirror which I’m trying to connect to using code-mirror lsp client)?

I did not find any documentation on how to deploy it. Can you point me..

Thank you for the reference

@npradeep357
Copy link
Contributor Author

npradeep357 commented Nov 30, 2021

Hi @ccordoba12, created pull request with necessary code changes. Please review and let me know if any changes required.

here: #128
thank you

@ccordoba12 ccordoba12 added this to the v1.5.0 milestone May 30, 2022
@ccordoba12 ccordoba12 changed the title Websockets in built support Websockets built-in support May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants