-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
How to develop and test a language server? #437
Comments
Do you mean the vscode-playground extension and one of the example servers? Or have you got your own extension setup?
If you're using the vscode-playground extension, then setting the
If you have your own extension, then a similar option will be available, but the exact name will depend on the id you gave to the
I think the idea behind the TCP mode is that you can start the server in a terminal outside of VSCode (potentially easier to attach debuggers that way) and then tell VSCode to connect over TCP instead. However, the playground now supports debugging over STDIO, so I am not sure how much of a difference TCP makes for development now.
Personally, I find interacting with the server via the UI to be the easiest way to try things out and experiment. Hope that helps! |
Thanks, that's a nice tips, I would look for the pygls configuration. I remember I saw this plugin when I start researching, thanks for reminding me I will have a look at that soon. Do you mainly find out this from your experience, for example I try to search the verbose option but didn't find the specific configuration you mentioned. |
Ultimately, the more you do the more tricks you pick up... though I admit our getting started docs aren't the best - something I hope to eventually fix in #427 |
I've never found the JS errors coming from VSCode to be that useful... your best bet is to try and find the Those log messages look like you have used microsoft's template extension? In which case I think the server's You can also try increasing the log level of the output channel using the Since there only seems to be an issue with the packaged version then most likely the issue is going to be something "silly" e.g. missing files/dependencies, incorrect python interpreter/environment etc. So it might be worth double checking the basics and seeing if you can spot any differences between your dev setup and the packaged version. Good luck! 🤞 |
@alcarney indeed I am using the template. My background is python so I am much more familiar with debugging python. Thank you for the advice. 🙏 |
Context
First of all, thank you for making this amazing library. I have no prior experience to VSCode extension / Javascript / backend, even though I am only making silly hint by following the tutorial. It's still very exciting that it requires fairly little work to make something like this working in my IDE almost instantly.
This is not a bug or feature request, I am looking for guidance for developing a language server. Specifically, I am trying to develop a language server with VSCode extension in mind.
Questions:
I read through the entire documentation, but I am still confused how to setup a proper develop environment. So far I have get VSCode working with the debug option and running the example successfully.
https://pygls.readthedocs.io/en/latest/pages/user-guide.html#tcp This page mentioned the TCP mode will be useful for developing, but I have no idea how to use this. Do you mindly test via clicking the UI to trigger certain action?
Does it makes sense to use something like Postman to send a request to the language server? So far I have seen the Debug Console showing the response from the Language server, but not the client request. Where can I look for some example?
The text was updated successfully, but these errors were encountered: