From b37fba7136c0191ae0becb3104d2d5746c50c3f1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 6 Jan 2019 13:45:41 +0300 Subject: make deps cancelable --- crates/ra_hir/src/code_model_api.rs | 4 ++-- crates/ra_hir/src/module/nameres.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 2f968d97c..f1e891722 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -21,8 +21,8 @@ impl Crate { pub fn crate_id(&self) -> CrateId { self.crate_id } - pub fn dependencies(&self, db: &impl HirDatabase) -> Vec { - self.dependencies_impl(db) + pub fn dependencies(&self, db: &impl HirDatabase) -> Cancelable> { + Ok(self.dependencies_impl(db)) } pub fn root_module(&self, db: &impl HirDatabase) -> Cancelable> { self.root_module_impl(db) diff --git a/crates/ra_hir/src/module/nameres.rs b/crates/ra_hir/src/module/nameres.rs index cd634e42f..059301b05 100644 --- a/crates/ra_hir/src/module/nameres.rs +++ b/crates/ra_hir/src/module/nameres.rs @@ -344,7 +344,7 @@ where if let Some(crate_id) = crate_graph.crate_id_for_crate_root(file_id.as_original_file()) { let krate = Crate::new(crate_id); - for dep in krate.dependencies(self.db) { + for dep in krate.dependencies(self.db)? { if let Some(module) = dep.krate.root_module(self.db)? { let def_id = module.def_id; self.add_module_item( -- cgit v1.2.3