diff options
Diffstat (limited to 'crates/ra_db')
-rw-r--r-- | crates/ra_db/src/input.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 76998ea30..aa535ac4d 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -119,6 +119,10 @@ impl CrateGraph { | |||
119 | self.arena[&crate_id].file_id | 119 | self.arena[&crate_id].file_id |
120 | } | 120 | } |
121 | 121 | ||
122 | pub fn edition(&self, crate_id: CrateId) -> Edition { | ||
123 | self.arena[&crate_id].edition | ||
124 | } | ||
125 | |||
122 | // TODO: this only finds one crate with the given root; we could have multiple | 126 | // TODO: this only finds one crate with the given root; we could have multiple |
123 | pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> { | 127 | pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> { |
124 | let (&crate_id, _) = self.arena.iter().find(|(_crate_id, data)| data.file_id == file_id)?; | 128 | let (&crate_id, _) = self.arena.iter().find(|(_crate_id, data)| data.file_id == file_id)?; |