diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_analysis/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 9 | ||||
-rw-r--r-- | crates/ra_analysis/src/input.rs | 4 |
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" | |||
11 | fst = "0.3.1" | 11 | fst = "0.3.1" |
12 | ra_syntax = { path = "../ra_syntax" } | 12 | ra_syntax = { path = "../ra_syntax" } |
13 | ra_editor = { path = "../ra_editor" } | 13 | ra_editor = { path = "../ra_editor" } |
14 | salsa = "0.6.2" | 14 | salsa = "0.7.0" |
15 | rustc-hash = "1.0" | 15 | rustc-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)] |
88 | pub(crate) struct AnalysisHostImpl { | 88 | pub(crate) struct AnalysisHostImpl { |
89 | db: db::RootDatabase, | 89 | db: db::RootDatabase, |
90 | } | 90 | } |
@@ -92,7 +92,12 @@ pub(crate) struct AnalysisHostImpl { | |||
92 | 92 | ||
93 | impl AnalysisHostImpl { | 93 | impl 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)] |
71 | pub(crate) struct SourceRootId(pub(crate) u32); | 71 | pub(crate) struct SourceRootId(pub(crate) u32); |
72 | 72 | ||
73 | #[derive(Clone, Default, Debug, PartialEq, Eq)] | 73 | #[derive(Default, Clone, Debug, PartialEq, Eq)] |
74 | pub(crate) struct SourceRoot { | 74 | pub(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>, |