aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/Cargo.toml2
-rw-r--r--crates/ra_analysis/src/imp.rs9
-rw-r--r--crates/ra_analysis/src/input.rs4
3 files changed, 10 insertions, 5 deletions
diff --git a/crates/ra_analysis/Cargo.toml b/crates/ra_analysis/Cargo.toml
index 5d7915fa5..892e34235 100644
--- a/crates/ra_analysis/Cargo.toml
+++ b/crates/ra_analysis/Cargo.toml
@@ -11,7 +11,7 @@ rayon = "1.0.2"
11fst = "0.3.1" 11fst = "0.3.1"
12ra_syntax = { path = "../ra_syntax" } 12ra_syntax = { path = "../ra_syntax" }
13ra_editor = { path = "../ra_editor" } 13ra_editor = { path = "../ra_editor" }
14salsa = "0.6.2" 14salsa = "0.7.0"
15rustc-hash = "1.0" 15rustc-hash = "1.0"
16 16
17[dev-dependencies] 17[dev-dependencies]
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>,