aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_db/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_db/src/lib.rs')
-rw-r--r--crates/ra_ide_db/src/lib.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/crates/ra_ide_db/src/lib.rs b/crates/ra_ide_db/src/lib.rs
index 480fd4576..a808de4f1 100644
--- a/crates/ra_ide_db/src/lib.rs
+++ b/crates/ra_ide_db/src/lib.rs
@@ -17,9 +17,9 @@ use hir::db::{AstDatabase, DefDatabase};
17use ra_db::{ 17use ra_db::{
18 salsa::{self, Database, Durability}, 18 salsa::{self, Database, Durability},
19 Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase, 19 Canceled, CheckCanceled, CrateId, FileId, FileLoader, FileLoaderDelegate, SourceDatabase,
20 SourceRootId, Upcast, 20 Upcast,
21}; 21};
22use rustc_hash::{FxHashMap, FxHashSet}; 22use rustc_hash::FxHashSet;
23 23
24use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase}; 24use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
25 25
@@ -36,7 +36,6 @@ use crate::{line_index::LineIndex, symbol_index::SymbolsDatabase};
36#[derive(Debug)] 36#[derive(Debug)]
37pub struct RootDatabase { 37pub struct RootDatabase {
38 runtime: salsa::Runtime<RootDatabase>, 38 runtime: salsa::Runtime<RootDatabase>,
39 pub(crate) debug_data: Arc<DebugData>,
40 pub last_gc: crate::wasm_shims::Instant, 39 pub last_gc: crate::wasm_shims::Instant,
41 pub last_gc_check: crate::wasm_shims::Instant, 40 pub last_gc_check: crate::wasm_shims::Instant,
42} 41}
@@ -98,7 +97,6 @@ impl RootDatabase {
98 runtime: salsa::Runtime::default(), 97 runtime: salsa::Runtime::default(),
99 last_gc: crate::wasm_shims::Instant::now(), 98 last_gc: crate::wasm_shims::Instant::now(),
100 last_gc_check: crate::wasm_shims::Instant::now(), 99 last_gc_check: crate::wasm_shims::Instant::now(),
101 debug_data: Default::default(),
102 }; 100 };
103 db.set_crate_graph_with_durability(Default::default(), Durability::HIGH); 101 db.set_crate_graph_with_durability(Default::default(), Durability::HIGH);
104 db.set_local_roots_with_durability(Default::default(), Durability::HIGH); 102 db.set_local_roots_with_durability(Default::default(), Durability::HIGH);
@@ -121,7 +119,6 @@ impl salsa::ParallelDatabase for RootDatabase {
121 runtime: self.runtime.snapshot(self), 119 runtime: self.runtime.snapshot(self),
122 last_gc: self.last_gc, 120 last_gc: self.last_gc,
123 last_gc_check: self.last_gc_check, 121 last_gc_check: self.last_gc_check,
124 debug_data: Arc::clone(&self.debug_data),
125 }) 122 })
126 } 123 }
127} 124}
@@ -135,14 +132,3 @@ fn line_index(db: &impl LineIndexDatabase, file_id: FileId) -> Arc<LineIndex> {
135 let text = db.file_text(file_id); 132 let text = db.file_text(file_id);
136 Arc::new(LineIndex::new(&*text)) 133 Arc::new(LineIndex::new(&*text))
137} 134}
138
139#[derive(Debug, Default, Clone)]
140pub(crate) struct DebugData {
141 pub(crate) root_paths: FxHashMap<SourceRootId, String>,
142}
143
144impl DebugData {
145 pub(crate) fn merge(&mut self, other: DebugData) {
146 self.root_paths.extend(other.root_paths.into_iter());
147 }
148}