|
|
@ -969,20 +969,19 @@ impl Client {
|
|
|
|
) -> Option<impl Future<Output = 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.as_ref()? {
|
|
|
|
Some(lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
|
|
|
|
lsp::TextDocumentSyncCapability::Options(lsp::TextDocumentSyncOptions {
|
|
|
|
save: Some(options),
|
|
|
|
save: options,
|
|
|
|
..
|
|
|
|
..
|
|
|
|
})) => match options {
|
|
|
|
}) => match options.as_ref()? {
|
|
|
|
lsp::TextDocumentSyncSaveOptions::Supported(true) => false,
|
|
|
|
lsp::TextDocumentSyncSaveOptions::Supported(true) => false,
|
|
|
|
lsp::TextDocumentSyncSaveOptions::SaveOptions(lsp_types::SaveOptions {
|
|
|
|
lsp::TextDocumentSyncSaveOptions::SaveOptions(lsp_types::SaveOptions {
|
|
|
|
include_text,
|
|
|
|
include_text,
|
|
|
|
}) => include_text.unwrap_or(false),
|
|
|
|
}) => include_text.unwrap_or(false),
|
|
|
|
// Supported(false)
|
|
|
|
lsp::TextDocumentSyncSaveOptions::Supported(false) => return None,
|
|
|
|
_ => return None,
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// unsupported
|
|
|
|
// see: https://github.com/microsoft/language-server-protocol/issues/288
|
|
|
|
_ => return None,
|
|
|
|
lsp::TextDocumentSyncCapability::Kind(..) => false,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Some(self.notify::<lsp::notification::DidSaveTextDocument>(
|
|
|
|
Some(self.notify::<lsp::notification::DidSaveTextDocument>(
|
|
|
|