aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-01-06 12:58:45 +0000
committerAleksey Kladov <[email protected]>2019-01-06 14:35:57 +0000
commita7f4f7bfcc524a55ba559e0141a70aa799a8686d (patch)
tree458eeb6cf17012239eae2fd107441b63575870ee /crates/ra_analysis/src
parent9cb02fd931f436a7b39c33c752799f5530b8491b (diff)
split module source into decl/defin
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/lib.rs2
-rw-r--r--crates/ra_analysis/src/runnables.rs6
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,