aboutsummaryrefslogtreecommitdiff
path: root/crates/ide_db/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide_db/src/lib.rs')
-rw-r--r--crates/ide_db/src/lib.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/crates/ide_db/src/lib.rs b/crates/ide_db/src/lib.rs
index 70ada02f3..0d209c6ec 100644
--- a/crates/ide_db/src/lib.rs
+++ b/crates/ide_db/src/lib.rs
@@ -10,7 +10,6 @@ pub mod defs;
10pub mod search; 10pub mod search;
11pub mod imports_locator; 11pub mod imports_locator;
12pub mod source_change; 12pub mod source_change;
13mod wasm_shims;
14 13
15use std::{fmt, sync::Arc}; 14use std::{fmt, sync::Arc};
16 15
@@ -36,8 +35,6 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
36)] 35)]
37pub struct RootDatabase { 36pub struct RootDatabase {
38 storage: salsa::Storage<RootDatabase>, 37 storage: salsa::Storage<RootDatabase>,
39 pub last_gc: crate::wasm_shims::Instant,
40 pub last_gc_check: crate::wasm_shims::Instant,
41} 38}
42 39
43impl fmt::Debug for RootDatabase { 40impl fmt::Debug for RootDatabase {
@@ -99,11 +96,7 @@ impl Default for RootDatabase {
99 96
100impl RootDatabase { 97impl RootDatabase {
101 pub fn new(lru_capacity: Option<usize>) -> RootDatabase { 98 pub fn new(lru_capacity: Option<usize>) -> RootDatabase {
102 let mut db = RootDatabase { 99 let mut db = RootDatabase { storage: salsa::Storage::default() };
103 storage: salsa::Storage::default(),
104 last_gc: crate::wasm_shims::Instant::now(),
105 last_gc_check: crate::wasm_shims::Instant::now(),
106 };
107 db.set_crate_graph_with_durability(Default::default(), Durability::HIGH); 100 db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
108 db.set_local_roots_with_durability(Default::default(), Durability::HIGH); 101 db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
109 db.set_library_roots_with_durability(Default::default(), Durability::HIGH); 102 db.set_library_roots_with_durability(Default::default(), Durability::HIGH);
@@ -121,11 +114,7 @@ impl RootDatabase {
121 114
122impl salsa::ParallelDatabase for RootDatabase { 115impl salsa::ParallelDatabase for RootDatabase {
123 fn snapshot(&self) -> salsa::Snapshot<RootDatabase> { 116 fn snapshot(&self) -> salsa::Snapshot<RootDatabase> {
124 salsa::Snapshot::new(RootDatabase { 117 salsa::Snapshot::new(RootDatabase { storage: self.storage.snapshot() })
125 storage: self.storage.snapshot(),
126 last_gc: self.last_gc,
127 last_gc_check: self.last_gc_check,
128 })
129 } 118 }
130} 119}
131 120