From c74e86536e569486008b39f319ba70dbb7641d2b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 1 Nov 2018 16:00:13 +0300 Subject: Dead code --- crates/ra_analysis/src/module_map.rs | 41 ------------------------------------ 1 file changed, 41 deletions(-) delete mode 100644 crates/ra_analysis/src/module_map.rs (limited to 'crates/ra_analysis') diff --git a/crates/ra_analysis/src/module_map.rs b/crates/ra_analysis/src/module_map.rs deleted file mode 100644 index 3c800265a..000000000 --- a/crates/ra_analysis/src/module_map.rs +++ /dev/null @@ -1,41 +0,0 @@ -use std::sync::Arc; - -use crate::{ - db, - Cancelable, - db::SyntaxDatabase, - descriptors::{ModuleDescriptor, ModuleTreeDescriptor}, - FileId, -}; - -salsa::query_group! { - pub(crate) trait ModulesDatabase: SyntaxDatabase { - fn module_tree() -> Cancelable> { - type ModuleTreeQuery; - } - fn module_descriptor(file_id: FileId) -> Cancelable> { - type ModuleDescriptorQuery; - } - } -} - -fn module_descriptor(db: &impl ModulesDatabase, file_id: FileId) -> Cancelable> { - db::check_canceled(db)?; - let file = db.file_syntax(file_id); - Ok(Arc::new(ModuleDescriptor::new(file.ast()))) -} - -fn module_tree(db: &impl ModulesDatabase) -> Cancelable> { - db::check_canceled(db)?; - let file_set = db.file_set(); - let mut files = Vec::new(); - for &file_id in file_set.files.iter() { - let module_descr = db.module_descriptor(file_id)?; - files.push((file_id, module_descr)); - } - let res = ModuleTreeDescriptor::new( - files.iter().map(|(file_id, descr)| (*file_id, &**descr)), - &file_set.resolver, - ); - Ok(Arc::new(res)) -} -- cgit v1.2.3