@@ -490,11 +490,11 @@ impl Client {
491 // will_save / will_save_wait_until
491 // will_save / will_save_wait_until
493− pub async fn text_document_did_save(
493+ pub fn text_document_did_save(
495 text_document: lsp::TextDocumentIdentifier,
495 text_document: lsp::TextDocumentIdentifier,
496 text: &Rope,
496 text: &Rope,
497− ) -> Result<()> {
497+ ) -> Option<impl Future<Output = Result<()>>> {
498 let capabilities = self.capabilities.get().unwrap();
498 let capabilities = self.capabilities.get().unwrap();
500 let include_text = match &capabilities.text_document_sync {
500 let include_text = match &capabilities.text_document_sync {
@@ -507,17 +507,18 @@ impl Client {
507 include_text,
507 include_text,
508 }) => include_text.unwrap_or(false),
508 }) => include_text.unwrap_or(false),
509 // Supported(false)
509 // Supported(false)
510− _ => return Ok(()),
510+ _ => return None,
512 // unsupported
512 // unsupported
513− _ => return Ok(()),
513+ _ => return None,
516− self.notify::<lsp::notification::DidSaveTextDocument>(lsp::DidSaveTextDocumentParams {
516+ Some(self.notify::<lsp::notification::DidSaveTextDocument>(
517+ lsp::DidSaveTextDocumentParams {
517− text_document,
518+ text_document,
518− text: include_text.then(|| text.into()),
519+ text: include_text.then(|| text.into()),
523 pub fn completion(
524 pub fn completion(