Inconsistent response of Pyright languague server #6773
Replies: 1 comment 1 reply
-
Pyright honors the capabilities provided by the client. If you don't specify It sounds like you're new to the language server protocol. You may find it useful to look at other LSP clients and follow their example. Compare your messages with the messages they send. Pyright has not been tested with all combinations of LSP capabilities, so it's theoretically possible that you could run into bugs with certain combinations. I recommend sticking with sets of capabilities that are supported by VS Code or other major LSP clients. If you suspect that you have found a bug in the handling of a particular combination of capabilities, I'll ask that you do additional legwork to diagnose the problem in pyright. Its source is available, and there are instructions for building and debugging it. |
Beta Was this translation helpful? Give feedback.
-
For my project, I'm faking to be a code editor by sending my own LSP commands to the Pyright language server.
For this, I follow the LSP specification.
This works! Great. However, I had to make a change to my code and that suddenly broke the response I got back from the Pyright language server.
Working LSP command
Message:
Response:
And now the configuration file gets properly loaded.
Problem
Notice the
workspace_folders
andworkspaceFolders
properties. In my new code, I cannot have theworkspace_folders
as snake_case anymore. It must also becomeworkspaceFolders
. And this suddenly breaks the Pyright LSP response.Not working LSP command
I just changed the
workspace_folders
intoworkspaceFolders
Message:
Response:
Since the configuration file is now not loaded, all other steps of my algorithm also fail, so I hope that there is a solution to this.
Beta Was this translation helpful? Give feedback.
All reactions