Don't show error when speculatively reloading workspace

This commit is contained in:
Aleksey Kladov 2020-07-11 01:39:06 +02:00
parent a36ff4a100
commit e6ea395fb0

View file

@ -126,10 +126,12 @@ impl GlobalState {
res.map_err(|err| {
has_errors = true;
log::error!("failed to load workspace: {:#}", err);
self.show_message(
lsp_types::MessageType::Error,
format!("rust-analyzer failed to load workspace: {:#}", err),
);
if self.workspaces.is_empty() {
self.show_message(
lsp_types::MessageType::Error,
format!("rust-analyzer failed to load workspace: {:#}", err),
);
}
})
.ok()
})