aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_analysis/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_analysis/src')
-rw-r--r--crates/ra_analysis/src/imp.rs9
-rw-r--r--crates/ra_analysis/src/input.rs4
2 files changed, 9 insertions, 4 deletions
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 {
84 } 84 }
85} 85}
86 86
87#[derive(Debug, Default)] 87#[derive(Debug)]
88pub(crate) struct AnalysisHostImpl { 88pub(crate) struct AnalysisHostImpl {
89 db: db::RootDatabase, 89 db: db::RootDatabase,
90} 90}
@@ -92,7 +92,12 @@ pub(crate) struct AnalysisHostImpl {
92 92
93impl AnalysisHostImpl { 93impl AnalysisHostImpl {
94 pub fn new() -> AnalysisHostImpl { 94 pub fn new() -> AnalysisHostImpl {
95 AnalysisHostImpl::default() 95 let db = db::RootDatabase::default();
96 db.query(crate::input::SourceRootQuery)
97 .set(WORKSPACE, Default::default());
98 db.query(crate::input::CrateGraphQuery)
99 .set((), Default::default());
100 AnalysisHostImpl { db }
96 } 101 }
97 pub fn analysis(&self) -> AnalysisImpl { 102 pub fn analysis(&self) -> AnalysisImpl {
98 AnalysisImpl { 103 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! {
67 } 67 }
68} 68}
69 69
70#[derive(Default, Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] 70#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
71pub(crate) struct SourceRootId(pub(crate) u32); 71pub(crate) struct SourceRootId(pub(crate) u32);
72 72
73#[derive(Clone, Default, Debug, PartialEq, Eq)] 73#[derive(Default, Clone, Debug, PartialEq, Eq)]
74pub(crate) struct SourceRoot { 74pub(crate) struct SourceRoot {
75 pub(crate) file_resolver: FileResolverImp, 75 pub(crate) file_resolver: FileResolverImp,
76 pub(crate) files: FxHashSet<FileId>, 76 pub(crate) files: FxHashSet<FileId>,