diff options
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 2 | ||||
-rw-r--r-- | crates/ra_analysis/src/runnables.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index 390c31c3f..77f77e9a8 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -397,7 +397,7 @@ impl Analysis { | |||
397 | } | 397 | } |
398 | /// Returns the root file of the given crate. | 398 | /// Returns the root file of the given crate. |
399 | pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> { | 399 | pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> { |
400 | Ok(self.db.crate_root(crate_id)) | 400 | Ok(self.db.crate_graph().crate_root(crate_id)) |
401 | } | 401 | } |
402 | /// Returns the set of possible targets to run for the current file. | 402 | /// Returns the set of possible targets to run for the current file. |
403 | pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>> { | 403 | pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>> { |
diff --git a/crates/ra_analysis/src/runnables.rs b/crates/ra_analysis/src/runnables.rs index 474267605..f24aa514a 100644 --- a/crates/ra_analysis/src/runnables.rs +++ b/crates/ra_analysis/src/runnables.rs | |||
@@ -73,11 +73,11 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: ast::Module) -> Opti | |||
73 | let module = | 73 | let module = |
74 | hir::source_binder::module_from_child_node(db, file_id, module.syntax()).ok()??; | 74 | hir::source_binder::module_from_child_node(db, file_id, module.syntax()).ok()??; |
75 | let path = module | 75 | let path = module |
76 | .path_to_root() | 76 | .path_to_root(db) |
77 | .ok()? | ||
77 | .into_iter() | 78 | .into_iter() |
78 | .rev() | 79 | .rev() |
79 | .into_iter() | 80 | .filter_map(|it| it.name(db).map(Clone::clone)) |
80 | .filter_map(|it| it.name().map(Clone::clone)) | ||
81 | .join("::"); | 81 | .join("::"); |
82 | Some(Runnable { | 82 | Some(Runnable { |
83 | range, | 83 | range, |