Show an error when formatter is not available (#12183)
This commit is contained in:
parent
085c4fe4c8
commit
7a2afdc080
1 changed files with 6 additions and 4 deletions
|
@ -456,13 +456,15 @@ fn format(
|
|||
}
|
||||
|
||||
let (view, doc) = current!(cx.editor);
|
||||
if let Some(format) = doc.format() {
|
||||
let callback = make_format_callback(doc.id(), doc.version(), view.id, format, None);
|
||||
cx.jobs.callback(callback);
|
||||
}
|
||||
let format = doc.format().context(
|
||||
"A formatter isn't available, and no language server provides formatting capabilities",
|
||||
)?;
|
||||
let callback = make_format_callback(doc.id(), doc.version(), view.id, format, None);
|
||||
cx.jobs.callback(callback);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn set_indent_style(
|
||||
cx: &mut compositor::Context,
|
||||
args: &[Cow<str>],
|
||||
|
|
Loading…
Reference in a new issue