Skip to content

Commit f380c5b

Browse files
committed
when text document sync capability is only kind send didSave without text
see microsoft/language-server-protocol#288 for details
1 parent bf7c4e1 commit f380c5b

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

helix-lsp/src/client.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -969,20 +969,19 @@ impl Client {
969969
) -> Option<impl Future<Output = Result<()>>> {
970970
let capabilities = self.capabilities.get().unwrap();
971971

972-
let include_text = match &capabilities.text_document_sync {
973-
Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
974-
save: Some(options),
972+
let include_text = match &capabilities.text_document_sync.as_ref()? {
973+
lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
974+
save: options,
975975
..
976-
})) => match options {
976+
}) => match options.as_ref()? {
977977
lsp::TextDocumentSyncSaveOptions::Supported(true) => false,
978978
lsp::TextDocumentSyncSaveOptions::SaveOptions(lsp_types::SaveOptions {
979979
include_text,
980980
}) => include_text.unwrap_or(false),
981-
// Supported(false)
982-
_ => return None,
981+
lsp::TextDocumentSyncSaveOptions::Supported(false) => return None,
983982
},
984-
// unsupported
985-
_ => return None,
983+
// see: https://github.com/microsoft/language-server-protocol/issues/288
984+
lsp::TextDocumentSyncCapability::Kind(..) => false,
986985
};
987986

988987
Some(self.notify::<lsp::notification::DidSaveTextDocument>(

0 commit comments

Comments
 (0)