split module source into decl/defin
This commit is contained in:
@@ -397,7 +397,7 @@ impl Analysis {
|
||||
}
|
||||
/// Returns the root file of the given crate.
|
||||
pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> {
|
||||
Ok(self.db.crate_root(crate_id))
|
||||
Ok(self.db.crate_graph().crate_root(crate_id))
|
||||
}
|
||||
/// Returns the set of possible targets to run for the current file.
|
||||
pub fn runnables(&self, file_id: FileId) -> Cancelable<Vec<Runnable>> {
|
||||
|
||||
@@ -73,11 +73,11 @@ fn runnable_mod(db: &RootDatabase, file_id: FileId, module: ast::Module) -> Opti
|
||||
let module =
|
||||
hir::source_binder::module_from_child_node(db, file_id, module.syntax()).ok()??;
|
||||
let path = module
|
||||
.path_to_root()
|
||||
.path_to_root(db)
|
||||
.ok()?
|
||||
.into_iter()
|
||||
.rev()
|
||||
.into_iter()
|
||||
.filter_map(|it| it.name().map(Clone::clone))
|
||||
.filter_map(|it| it.name(db).map(Clone::clone))
|
||||
.join("::");
|
||||
Some(Runnable {
|
||||
range,
|
||||
|
||||
Reference in New Issue
Block a user