Open dcermak opened 1 year ago
Ohh is this what https://github.com/openlawlibrary/pygls/pull/313 fixes?
Yes
Thank you @alcarney 🙇 I suspect this will resolve the issue, if so then we'll close the issue and PR.
This is expected as
textDocument/didOpen
is a notification, not a request (see spec) There is thenotify
method that you can use instead.
Ah, thank you! I have switched to using notify
, which fixes the runtime error, but sadly it creates a new one: The notify
function is synchronous, but the processing of that notification happens asynchronously in the background. So the tests that run immediately after that fail, as the document has not yet been loaded. This worked with send_request
, albeit of course only accidentally. Can I somehow wait for the result of that notification to be processed?
Unfortunately, I don't know of anything in the spec to help with this.
The solution I came up with for esbonio
was to have the server send a custom notification of its own after it finished what I was waiting for and then extend the LanguageServerProtocol
object used client side to add a mechanism to wait for a given notification
I am currently migrating salt-lsp from pygls 0.11 to 1.0, which so far went without major issues except that my testing code can no longer open a file on the server by sending a
TEXT_DOCUMENT_DID_OPEN
. I was using this code:This used to work with the previous pygls version, but that now fails with: