mirror of
https://github.com/helix-editor/helix.git
synced 2024-11-25 19:03:30 +04:00
Don't panic on save if language_server isn't initialized
This commit is contained in:
parent
ade1a453ef
commit
64099af3f1
@ -471,10 +471,15 @@ fn save_impl<F: Future<Output = LspFormatting>>(
|
||||
let mut file = File::create(path).await?;
|
||||
to_writer(&mut file, encoding, &text).await?;
|
||||
|
||||
if let Some(notification) = language_server.and_then(|language_server| {
|
||||
language_server.text_document_did_save(identifier, &text)
|
||||
}) {
|
||||
notification.await?;
|
||||
if let Some(language_server) = language_server {
|
||||
if language_server.is_initialized() {
|
||||
return Ok(());
|
||||
}
|
||||
if let Some(notification) =
|
||||
language_server.text_document_did_save(identifier, &text)
|
||||
{
|
||||
notification.await?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user