Skip to content

Commit

Permalink
when text document sync capability is only kind send didSave without …
Browse files Browse the repository at this point in the history
  • Loading branch information
gabydd authored and Schuyler Mortimer committed Jul 10, 2024
1 parent e453e41 commit 165c3f1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions helix-lsp/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,20 +974,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>(
Expand Down

0 comments on commit 165c3f1

Please sign in to comment.