-
|
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 :/
pyglstries to figure out the correct options type that should go in the@server.featuredecorator. Unfortunately it’s not able to do that in your case since it appears thatTEXT_DOCUMENT_DID_SAVEdoesn’t follow the same pattern as the other methods.That said, it should be an easy fix :)
Side note:
TextDocumentSaveRegistrationOptionsisn’t the right type to be using here (and it looks likepygls v0.11would incorrectly force you to use this type), it should beSaveOptionsinstead.To the best of my knowledge,
pyglsonly uses the option types to populate theServerCapabilitiesfield of its response to the initialize request, which requires it to useSav…