-
I am trying to register a handler for saving the file @server.feature(TEXT_DOCUMENT_DID_SAVE, TextDocumentSaveRegistrationOptions(include_text=True))
def did_save(ls: WaveLanguageServer, params: DidSaveTextDocumentParams): This worked fine in
Any ideas? Note |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
It looks like you’ve found a bug :/
That said, it should be an easy fix :) Side note: To the best of my knowledge,
Anyway I am being pedantic here (it’s worked for you up until now hasn’t it 😄) and just giving a heads up that when the fix does land, |
Beta Was this translation helpful? Give feedback.
-
Hello! I found myself needing to do a similar thing for a different method:
|
Beta Was this translation helpful? Give feedback.
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 thatTEXT_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 likepygls v0.11
would incorrectly force you to use this type), it should beSaveOptions
instead.To the best of my knowledge,
pygls
only uses the option types to populate theServerCapabilities
field of its response to the initialize request, which requires it to useSav…