aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/ra_db/src/lib.rs8
-rw-r--r--crates/ra_hir/src/mock.rs2
-rw-r--r--crates/ra_ide_api/src/db.rs15
-rw-r--r--crates/ra_ide_api/src/symbol_index.rs8
4 files changed, 14 insertions, 19 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs
index 4bfc3f9ae..cab47dcac 100644
--- a/crates/ra_db/src/lib.rs
+++ b/crates/ra_db/src/lib.rs
@@ -80,14 +80,6 @@ pub trait FilesDatabase: salsa::Database + CheckCanceled {
80 #[salsa::input] 80 #[salsa::input]
81 fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>; 81 fn source_root(&self, id: SourceRootId) -> Arc<SourceRoot>;
82 fn source_root_crates(&self, id: SourceRootId) -> Arc<Vec<CrateId>>; 82 fn source_root_crates(&self, id: SourceRootId) -> Arc<Vec<CrateId>>;
83 /// The set of "local" (that is, from the current workspace) roots.
84 /// Files in local roots are assumed to change frequently.
85 #[salsa::input]
86 fn local_roots(&self) -> Arc<Vec<SourceRootId>>;
87 /// The set of roots for crates.io libraries.
88 /// Files in libraries are assumed to never change.
89 #[salsa::input]
90 fn library_roots(&self) -> Arc<Vec<SourceRootId>>;
91 /// The crate graph. 83 /// The crate graph.
92 #[salsa::input] 84 #[salsa::input]
93 fn crate_graph(&self) -> Arc<CrateGraph>; 85 fn crate_graph(&self) -> Arc<CrateGraph>;
diff --git a/crates/ra_hir/src/mock.rs b/crates/ra_hir/src/mock.rs
index 4af4dd096..cfbe652b0 100644
--- a/crates/ra_hir/src/mock.rs
+++ b/crates/ra_hir/src/mock.rs
@@ -140,8 +140,6 @@ impl Default for MockDatabase {
140 file_counter: 0, 140 file_counter: 0,
141 }; 141 };
142 db.set_crate_graph(Default::default()); 142 db.set_crate_graph(Default::default());
143 db.set_local_roots(Default::default());
144 db.set_library_roots(Default::default());
145 db 143 db
146 } 144 }
147} 145}
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs
index 02e12437c..119190e0a 100644
--- a/crates/ra_ide_api/src/db.rs
+++ b/crates/ra_ide_api/src/db.rs
@@ -1,11 +1,11 @@
1use std::sync::Arc; 1use std::sync::Arc;
2 2
3use ra_db::{ 3use ra_db::{
4 CheckCanceled, FileId, Canceled, 4 CheckCanceled, FileId, Canceled, FilesDatabase,
5 salsa::{self, Database}, 5 salsa,
6}; 6};
7 7
8use crate::{symbol_index, LineIndex}; 8use crate::{LineIndex, symbol_index::{self, SymbolsDatabase}};
9 9
10#[salsa::database( 10#[salsa::database(
11 ra_db::FilesDatabaseStorage, 11 ra_db::FilesDatabaseStorage,
@@ -34,12 +34,9 @@ impl Default for RootDatabase {
34 runtime: salsa::Runtime::default(), 34 runtime: salsa::Runtime::default(),
35 interner: Default::default(), 35 interner: Default::default(),
36 }; 36 };
37 db.query_mut(ra_db::CrateGraphQuery) 37 db.set_crate_graph(Default::default());
38 .set((), Default::default()); 38 db.set_local_roots(Default::default());
39 db.query_mut(ra_db::LocalRootsQuery) 39 db.set_library_roots(Default::default());
40 .set((), Default::default());
41 db.query_mut(ra_db::LibraryRootsQuery)
42 .set((), Default::default());
43 db 40 db
44 } 41 }
45} 42}
diff --git a/crates/ra_ide_api/src/symbol_index.rs b/crates/ra_ide_api/src/symbol_index.rs
index e073a349e..4d81d14b3 100644
--- a/crates/ra_ide_api/src/symbol_index.rs
+++ b/crates/ra_ide_api/src/symbol_index.rs
@@ -49,6 +49,14 @@ pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
49 fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>; 49 fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>;
50 #[salsa::input] 50 #[salsa::input]
51 fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>; 51 fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>;
52 /// The set of "local" (that is, from the current workspace) roots.
53 /// Files in local roots are assumed to change frequently.
54 #[salsa::input]
55 fn local_roots(&self) -> Arc<Vec<SourceRootId>>;
56 /// The set of roots for crates.io libraries.
57 /// Files in libraries are assumed to never change.
58 #[salsa::input]
59 fn library_roots(&self) -> Arc<Vec<SourceRootId>>;
52} 60}
53 61
54fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> { 62fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> {