aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/db.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/db.rs')
-rw-r--r--crates/ra_ide_api/src/db.rs9
1 files changed, 0 insertions, 9 deletions
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs
index ea4255d35..33d3903bb 100644
--- a/crates/ra_ide_api/src/db.rs
+++ b/crates/ra_ide_api/src/db.rs
@@ -20,7 +20,6 @@ use crate::{LineIndex, symbol_index::{self, SymbolsDatabase}};
20#[derive(Debug)] 20#[derive(Debug)]
21pub(crate) struct RootDatabase { 21pub(crate) struct RootDatabase {
22 runtime: salsa::Runtime<RootDatabase>, 22 runtime: salsa::Runtime<RootDatabase>,
23 interner: Arc<hir::HirInterner>,
24 pub(crate) last_gc: time::Instant, 23 pub(crate) last_gc: time::Instant,
25 pub(crate) last_gc_check: time::Instant, 24 pub(crate) last_gc_check: time::Instant,
26} 25}
@@ -38,7 +37,6 @@ impl Default for RootDatabase {
38 fn default() -> RootDatabase { 37 fn default() -> RootDatabase {
39 let mut db = RootDatabase { 38 let mut db = RootDatabase {
40 runtime: salsa::Runtime::default(), 39 runtime: salsa::Runtime::default(),
41 interner: Default::default(),
42 last_gc: time::Instant::now(), 40 last_gc: time::Instant::now(),
43 last_gc_check: time::Instant::now(), 41 last_gc_check: time::Instant::now(),
44 }; 42 };
@@ -53,19 +51,12 @@ impl salsa::ParallelDatabase for RootDatabase {
53 fn snapshot(&self) -> salsa::Snapshot<RootDatabase> { 51 fn snapshot(&self) -> salsa::Snapshot<RootDatabase> {
54 salsa::Snapshot::new(RootDatabase { 52 salsa::Snapshot::new(RootDatabase {
55 runtime: self.runtime.snapshot(self), 53 runtime: self.runtime.snapshot(self),
56 interner: Arc::clone(&self.interner),
57 last_gc: self.last_gc.clone(), 54 last_gc: self.last_gc.clone(),
58 last_gc_check: self.last_gc_check.clone(), 55 last_gc_check: self.last_gc_check.clone(),
59 }) 56 })
60 } 57 }
61} 58}
62 59
63impl AsRef<hir::HirInterner> for RootDatabase {
64 fn as_ref(&self) -> &hir::HirInterner {
65 &self.interner
66 }
67}
68
69#[salsa::query_group(LineIndexDatabaseStorage)] 60#[salsa::query_group(LineIndexDatabaseStorage)]
70pub(crate) trait LineIndexDatabase: ra_db::SourceDatabase + CheckCanceled { 61pub(crate) trait LineIndexDatabase: ra_db::SourceDatabase + CheckCanceled {
71 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>; 62 fn line_index(&self, file_id: FileId) -> Arc<LineIndex>;