@@ -407,7 +407,11 @@ impl Document {
407407 // We can't use anyhow::Result here since the output of the future has to be
408408 // clonable to be used as shared future. So use a custom error type.
409409 pub fn format(&self) -> Option<BoxFuture<'static, Result<Transaction, FormatterError>>> {
410− if let Some(formatter) = self.language_config().and_then(|c| c.formatter.clone()) {
410+ if let Some(formatter) = self
411+ .language_config()
412+ .and_then(|c| c.formatter.clone())
413+ .filter(|formatter| which::which(&formatter.command).is_ok())
414+ {
411415 use std::process::Stdio;
412416 let text = self.text().clone();
413417 let mut process = tokio::process::Command::new(&formatter.command);