From 23cad90fe98dcca7f4b6905d9fd3ed52d2896c8c Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 31 Oct 2018 00:59:43 +0300 Subject: :arrow_up: salsa --- crates/ra_analysis/src/imp.rs | 9 +++++++-- crates/ra_analysis/src/input.rs | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'crates/ra_analysis/src') diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 57657105b..efb3182a6 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs @@ -84,7 +84,7 @@ impl Default for FileResolverImp { } } -#[derive(Debug, Default)] +#[derive(Debug)] pub(crate) struct AnalysisHostImpl { db: db::RootDatabase, } @@ -92,7 +92,12 @@ pub(crate) struct AnalysisHostImpl { impl AnalysisHostImpl { pub fn new() -> AnalysisHostImpl { - AnalysisHostImpl::default() + let db = db::RootDatabase::default(); + db.query(crate::input::SourceRootQuery) + .set(WORKSPACE, Default::default()); + db.query(crate::input::CrateGraphQuery) + .set((), Default::default()); + AnalysisHostImpl { db } } pub fn analysis(&self) -> AnalysisImpl { AnalysisImpl { diff --git a/crates/ra_analysis/src/input.rs b/crates/ra_analysis/src/input.rs index e64fad40c..98781751a 100644 --- a/crates/ra_analysis/src/input.rs +++ b/crates/ra_analysis/src/input.rs @@ -67,10 +67,10 @@ salsa::query_group! { } } -#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] pub(crate) struct SourceRootId(pub(crate) u32); -#[derive(Clone, Default, Debug, PartialEq, Eq)] +#[derive(Default, Clone, Debug, PartialEq, Eq)] pub(crate) struct SourceRoot { pub(crate) file_resolver: FileResolverImp, pub(crate) files: FxHashSet, -- cgit v1.2.3