aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-15 17:56:06 +0000
committerAleksey Kladov <[email protected]>2019-01-15 17:56:06 +0000
commit02c3d2f78eeea41c6de8430c2a34b38e1cdb861b (patch)
treed3c4cd4da2408bd1c07519880a4f5edb966890d0 /crates
parent8ba9c2d4cedbcf8f1d2c644733d2b06fa1984d22 (diff)
hir is cancelation free
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_hir/src/code_model_api.rs7
-rw-r--r--crates/ra_hir/src/code_model_impl/module.rs9
-rw-r--r--crates/ra_ide_api/src/imp.rs2
3 files changed, 6 insertions, 12 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index 0cf45944f..0cf7deac9 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -1,7 +1,7 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use relative_path::RelativePathBuf; 3use relative_path::RelativePathBuf;
4use ra_db::{CrateId, Cancelable, FileId}; 4use ra_db::{CrateId, FileId};
5use ra_syntax::{ast, TreeArc, SyntaxNode}; 5use ra_syntax::{ast, TreeArc, SyntaxNode};
6 6
7use crate::{ 7use crate::{
@@ -142,10 +142,7 @@ impl Module {
142 self.resolve_path_impl(db, path) 142 self.resolve_path_impl(db, path)
143 } 143 }
144 144
145 pub fn problems( 145 pub fn problems(&self, db: &impl HirDatabase) -> Vec<(TreeArc<SyntaxNode>, Problem)> {
146 &self,
147 db: &impl HirDatabase,
148 ) -> Cancelable<Vec<(TreeArc<SyntaxNode>, Problem)>> {
149 self.problems_impl(db) 146 self.problems_impl(db)
150 } 147 }
151} 148}
diff --git a/crates/ra_hir/src/code_model_impl/module.rs b/crates/ra_hir/src/code_model_impl/module.rs
index 04301ae53..a5c032d69 100644
--- a/crates/ra_hir/src/code_model_impl/module.rs
+++ b/crates/ra_hir/src/code_model_impl/module.rs
@@ -1,4 +1,4 @@
1use ra_db::{Cancelable, SourceRootId, FileId}; 1use ra_db::{SourceRootId, FileId};
2use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc}; 2use ra_syntax::{ast, SyntaxNode, AstNode, TreeArc};
3 3
4use crate::{ 4use crate::{
@@ -176,12 +176,9 @@ impl Module {
176 curr_per_ns 176 curr_per_ns
177 } 177 }
178 178
179 pub fn problems_impl( 179 pub fn problems_impl(&self, db: &impl HirDatabase) -> Vec<(TreeArc<SyntaxNode>, Problem)> {
180 &self,
181 db: &impl HirDatabase,
182 ) -> Cancelable<Vec<(TreeArc<SyntaxNode>, Problem)>> {
183 let loc = self.def_id.loc(db); 180 let loc = self.def_id.loc(db);
184 let module_tree = db.module_tree(loc.source_root_id); 181 let module_tree = db.module_tree(loc.source_root_id);
185 Ok(loc.module_id.problems(&module_tree, db)) 182 loc.module_id.problems(&module_tree, db)
186 } 183 }
187} 184}
diff --git a/crates/ra_ide_api/src/imp.rs b/crates/ra_ide_api/src/imp.rs
index 8b2cd6e27..391df2695 100644
--- a/crates/ra_ide_api/src/imp.rs
+++ b/crates/ra_ide_api/src/imp.rs
@@ -180,7 +180,7 @@ impl db::RootDatabase {
180 }) 180 })
181 .collect::<Vec<_>>(); 181 .collect::<Vec<_>>();
182 if let Some(m) = source_binder::module_from_file_id(self, file_id) { 182 if let Some(m) = source_binder::module_from_file_id(self, file_id) {
183 for (name_node, problem) in m.problems(self)? { 183 for (name_node, problem) in m.problems(self) {
184 let source_root = self.file_source_root(file_id); 184 let source_root = self.file_source_root(file_id);
185 let diag = match problem { 185 let diag = match problem {
186 Problem::UnresolvedModule { candidate } => { 186 Problem::UnresolvedModule { candidate } => {