openlawlibrary / pygls

A pythonic generic language server
https://pygls.readthedocs.io/en/latest/
Apache License 2.0
568 stars 103 forks source link

can't run language server commands in vscode-playground example #365

Closed RossBencina closed 1 year ago

RossBencina commented 1 year ago

I followed the instructions to launch the vscode-playground example:

https://github.com/openlawlibrary/pygls/blob/main/examples/vscode-playground/README.md

Hitting F5 successfully launches VSCode with the example plugin loaded. I verified that the server was running by checking the output window. JSON validation is working, I get red squiggles under errors.

Now the problems start:

Selecting "pygls: Execute Command" from the command palette results in an error:

image

Furthermore, none of the commands from the json_server example are available in the command palette. For example "Count Down 10 Seconds [Non Blocking]" is not present.

I expected all of the commands that are implemented in json_server.py to be available and to run correctly:

https://github.com/openlawlibrary/pygls/blob/main/examples/servers/json_server.py

I tried rolling back to 05ba2c46e330fc5284d3b8d36b43846eb1844885 (just prior to the refactoring that deleted the json-vscode-extension. EDIT: in this case, I am able to load the json-vscode-extension example, and the commands do run. For example I am able to select "Count Down 10 Seconds [Non Blocking]" from the command palette, and it displays the countdown notifications as expected.

alcarney commented 1 year ago

Apologies! This was on my todo list when refactoring the extension - I must've forgotten to do it :/

Once #368 lands it should be possible to execute pygls: Execute Command and be presented with a quick pick list of commands that the server you're currently running provides. It does make running a command via the palette a 2-step process - but the extension should work with any server without needing to update the package.json file

Screenshot_20230901_191518