aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/lib.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs
index d1bff4a76..779a81b2c 100644
--- a/crates/ra_ide/src/lib.rs
+++ b/crates/ra_ide/src/lib.rs
@@ -422,6 +422,11 @@ impl Analysis {
422 self.with_db(|db| parent_module::crate_for(db, file_id)) 422 self.with_db(|db| parent_module::crate_for(db, file_id))
423 } 423 }
424 424
425 /// Returns the edition of the given crate.
426 pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable<Edition> {
427 self.with_db(|db| db.crate_graph().edition(crate_id))
428 }
429
425 /// Returns the root file of the given crate. 430 /// Returns the root file of the given crate.
426 pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> { 431 pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> {
427 self.with_db(|db| db.crate_graph().crate_root(crate_id)) 432 self.with_db(|db| db.crate_graph().crate_root(crate_id))