diff options
Diffstat (limited to 'crates/ide_db/src/lib.rs')
-rw-r--r-- | crates/ide_db/src/lib.rs | 15 |
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; | |||
10 | pub mod search; | 10 | pub mod search; |
11 | pub mod imports_locator; | 11 | pub mod imports_locator; |
12 | pub mod source_change; | 12 | pub mod source_change; |
13 | mod wasm_shims; | ||
14 | 13 | ||
15 | use std::{fmt, sync::Arc}; | 14 | use std::{fmt, sync::Arc}; |
16 | 15 | ||
@@ -36,8 +35,6 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; | |||
36 | )] | 35 | )] |
37 | pub struct RootDatabase { | 36 | pub 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 | ||
43 | impl fmt::Debug for RootDatabase { | 40 | impl fmt::Debug for RootDatabase { |
@@ -99,11 +96,7 @@ impl Default for RootDatabase { | |||
99 | 96 | ||
100 | impl RootDatabase { | 97 | impl 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 | ||
122 | impl salsa::ParallelDatabase for RootDatabase { | 115 | impl 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 | ||