From 961cae7e53a05625f3e010076673ca083479b481 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 9 Dec 2018 01:02:53 +0300 Subject: thread info about dep names --- crates/ra_db/src/input.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'crates/ra_db/src') diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 37da8c549..44c5bac93 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs @@ -1,7 +1,7 @@ use std::sync::Arc; -use rustc_hash::FxHashMap; -use rustc_hash::FxHashSet; +use rustc_hash::{FxHashSet, FxHashMap}; +use ra_syntax::SmolStr; use salsa; use crate::file_resolver::FileResolverImp; @@ -31,14 +31,15 @@ impl CrateData { } } - fn add_dep(&mut self, dep: CrateId) { - self.dependencies.push(Dependency { crate_id: dep }) + fn add_dep(&mut self, name: SmolStr, crate_id: CrateId) { + self.dependencies.push(Dependency { name, crate_id }) } } #[derive(Debug, Clone, PartialEq, Eq)] pub struct Dependency { crate_id: CrateId, + name: SmolStr, } impl Dependency { @@ -57,8 +58,8 @@ impl CrateGraph { //FIXME: check that we don't have cycles here. // Just a simple depth first search from `to` should work, // the graph is small. - pub fn add_dep(&mut self, from: CrateId, to: CrateId) { - self.arena.get_mut(&from).unwrap().add_dep(to) + pub fn add_dep(&mut self, from: CrateId, name: SmolStr, to: CrateId) { + self.arena.get_mut(&from).unwrap().add_dep(name, to) } pub fn crate_root(&self, crate_id: CrateId) -> FileId { self.arena[&crate_id].file_id -- cgit v1.2.3