on master help sign in
when text document sync capability is only kind send didSave without text (#9101)

see https://github.com/microsoft/language-server-protocol/issues/288 for details

commitf27fdb2bf4da1e9b1e0a0c8e7688e738379ba33b authorGabriel Dinner-David <82682503+gabydd@users.noreply.github.com> dateSun 17 Dec 2023, 16:59 (3 years ago) parenta1a20d2
1 file changed+7−8
helix-lsp/src/client.rs+7−8
helix-lsp/src/client.rs+7−8
@@ -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>(