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

[HELP] LSP Server with monaco #105

Closed
pawansingh00 opened this issue Nov 3, 2021 · 8 comments
Closed

[HELP] LSP Server with monaco #105

pawansingh00 opened this issue Nov 3, 2021 · 8 comments

Comments

@pawansingh00
Copy link

Hi,

Can anybody help me in Setting it up with -- Monaco Editor.
I am using the following this -- microsoft/monaco-editor#833 (comment)
for the same, but its not working out.

Can somebody please confirm on how to start this -- pyls ?

Thanks,
Pawan

@pawansingh00 pawansingh00 changed the title LSP Server with monaco [HELP] LSP Server with monaco Nov 3, 2021
@lieryan
Copy link
Contributor

lieryan commented Nov 4, 2021

The executable for python-lsp-server is pylsp not pyls.

pyls is for Palantir's python-language-server, the original, unmaintained project that python-lsp-server is based on.

@pawansingh00
Copy link
Author

@lieryan Thanks for confirming on the executable.
Still, doesn't seem to work with -- microsoft/monaco-editor#833 (comment)

Any pointer on how to use -- pylsp any one running exaple is fine.

@eranif
Copy link

eranif commented Nov 5, 2021

Nothing special is the setup, for me, in my IDE, I just added this line:

C:\msys64\mingw64\bin\python3.exe -m pylsp

and it just works...

The IDE launches pylsp server and captures its stdout and stdin (for communication)
If its not working for you - I am guessing that the problem is within your IDE/Editor. Try to capture the log of your editor and try to debug the protocol exchange (especially the initialize and initialized requests)

@npradeep357
Copy link
Contributor

@pawansingh00 sis you integrate monaco-language-client from typefox? I did and it worked for me... did you change the line mentioned in the linked comment?
Also, pylsp does not have websockets support... You need to create a websockets server on top of pylsp IO or TCP and then connect your monaco language client to this webosckets server...

@pawansingh00
Copy link
Author

pawansingh00 commented Nov 22, 2021

@npradeep357 Following the linked comment din't work for me.
Though I have got my use case working using this -- https://github.com/ycm-core/ycmd

@pplonski
Copy link

Hi, I've integrated monaco editor with pylsp in electron app . Here you have working example https://github.com/pplonski/electron-monaco-python-lsp However there are still some issues that need to be fixed.

@npradeep357
Copy link
Contributor

Hey @pawansingh00, i created pr for web sockets in built support in pylsp.

#128 is the one which have ws support. You can refe to the source code linked in the PR.

You can use that version and run the pylsp using below command. Then monanco can directly connect to it with configured ws url.

pylsp --ws --host host\ip --port port

Hope this helps.

@pawansingh00
Copy link
Author

pawansingh00 commented Dec 4, 2021

@npradeep357
Thanks, looks cool, sure will check it out and update.

I am closing this as I have got my use case covered using this -- https://github.com/ycm-core/ycmd
Which uses -- Jedi-based completer for semantic completion for Python.

Thank you all for your valuable helps and inputs.

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

No branches or pull requests

5 participants