|
|
@ -490,11 +490,11 @@ impl Client {
|
|
|
|
|
|
|
|
|
|
|
|
// will_save / will_save_wait_until
|
|
|
|
// will_save / will_save_wait_until
|
|
|
|
|
|
|
|
|
|
|
|
pub async fn text_document_did_save(
|
|
|
|
pub fn text_document_did_save(
|
|
|
|
&self,
|
|
|
|
&self,
|
|
|
|
text_document: lsp::TextDocumentIdentifier,
|
|
|
|
text_document: lsp::TextDocumentIdentifier,
|
|
|
|
text: &Rope,
|
|
|
|
text: &Rope,
|
|
|
|
) -> Result<()> {
|
|
|
|
) -> Option<impl Future<Output = Result<()>>> {
|
|
|
|
let capabilities = self.capabilities.get().unwrap();
|
|
|
|
let capabilities = self.capabilities.get().unwrap();
|
|
|
|
|
|
|
|
|
|
|
|
let include_text = match &capabilities.text_document_sync {
|
|
|
|
let include_text = match &capabilities.text_document_sync {
|
|
|
@ -507,17 +507,18 @@ impl Client {
|
|
|
|
include_text,
|
|
|
|
include_text,
|
|
|
|
}) => include_text.unwrap_or(false),
|
|
|
|
}) => include_text.unwrap_or(false),
|
|
|
|
// Supported(false)
|
|
|
|
// Supported(false)
|
|
|
|
_ => return Ok(()),
|
|
|
|
_ => return None,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// unsupported
|
|
|
|
// unsupported
|
|
|
|
_ => return Ok(()),
|
|
|
|
_ => return None,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
self.notify::<lsp::notification::DidSaveTextDocument>(lsp::DidSaveTextDocumentParams {
|
|
|
|
Some(self.notify::<lsp::notification::DidSaveTextDocument>(
|
|
|
|
text_document,
|
|
|
|
lsp::DidSaveTextDocumentParams {
|
|
|
|
text: include_text.then(|| text.into()),
|
|
|
|
text_document,
|
|
|
|
})
|
|
|
|
text: include_text.then(|| text.into()),
|
|
|
|
.await
|
|
|
|
},
|
|
|
|
|
|
|
|
))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
pub fn completion(
|
|
|
|
pub fn completion(
|
|
|
|