keep one CargoTomlNotFoundError

This commit is contained in:
nmio
2020-02-29 13:05:10 +00:00
parent 12b595e817
commit e15424c1b7
2 changed files with 38 additions and 30 deletions

View File

@@ -115,12 +115,17 @@ pub fn main_loop(
Ok(workspace) => loaded_workspaces.push(workspace),
Err(e) => {
log::error!("loading workspace failed: {:?}", e);
if let Some(ra_project_model::CargoTomlNoneFoundError(_)) = e.downcast_ref()
if let Some(ra_project_model::CargoTomlNotFoundError {
searched_at: _,
reason: _,
}) = e.downcast_ref()
{
if !feature_flags.get("notifications.cargo-toml-not-found") {
continue;
}
}
show_message(
req::MessageType::Error,
format!("rust-analyzer failed to load workspace: {:?}", e),