Skip to content

Cannot make TEXT_DOCUMENT_DID_SAVE work after upgrading to 1.0.2 #338

Answered by alcarney
mturoci asked this question in Q&A
Discussion options

You must be logged in to vote

It looks like you’ve found a bug :/

pygls tries to figure out the correct options type that should go in the @server.feature decorator. Unfortunately it’s not able to do that in your case since it appears that TEXT_DOCUMENT_DID_SAVE doesn’t follow the same pattern as the other methods.

That said, it should be an easy fix :)

Side note: TextDocumentSaveRegistrationOptions isn’t the right type to be using here (and it looks like pygls v0.11 would incorrectly force you to use this type), it should be SaveOptions instead.

To the best of my knowledge, pygls only uses the option types to populate the ServerCapabilities field of its response to the initialize request, which requires it to use Sav…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
5 replies
@mturoci
Comment options

@alcarney
Comment options

@mturoci
Comment options

@mturoci
Comment options

@tombh
Comment options

Answer selected by mturoci
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants