diff options
author | Gabriel Dinner-David | 2023-12-17 21:59:04 +0000 |
---|---|---|
committer | GitHub | 2023-12-17 21:59:04 +0000 |
commit | f27fdb2bf4da1e9b1e0a0c8e7688e738379ba33b (patch) | |
tree | 34fb423cc7290ca4396b254d4b40b5ec359a46dd /helix-lsp/src | |
parent | a1a20d231f509a01b7e0e8e040ce96206276ffd4 (diff) |
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
Diffstat (limited to 'helix-lsp/src')
-rw-r--r-- | helix-lsp/src/client.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/helix-lsp/src/client.rs b/helix-lsp/src/client.rs index e6e1f8a0..5266d4b0 100644 --- a/helix-lsp/src/client.rs +++ b/helix-lsp/src/client.rs @@ -969,20 +969,19 @@ impl Client { ) -> Option<impl Future<Output = Result<()>>> { let capabilities = self.capabilities.get().unwrap(); - let include_text = match &capabilities.text_document_sync { - Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions { - save: Some(options), + let include_text = match &capabilities.text_document_sync.as_ref()? { + lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions { + save: options, .. - })) => match options { + }) => match options.as_ref()? { lsp::TextDocumentSyncSaveOptions::Supported(true) => false, lsp::TextDocumentSyncSaveOptions::SaveOptions(lsp_types::SaveOptions { include_text, }) => include_text.unwrap_or(false), - // Supported(false) - _ => return None, + lsp::TextDocumentSyncSaveOptions::Supported(false) => return None, }, - // unsupported - _ => return None, + // see: https://github.com/microsoft/language-server-protocol/issues/288 + lsp::TextDocumentSyncCapability::Kind(..) => false, }; Some(self.notify::<lsp::notification::DidSaveTextDocument>( |