diff options
Diffstat (limited to 'crates/ra_analysis/src/db.rs')
-rw-r--r-- | crates/ra_analysis/src/db.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_analysis/src/db.rs b/crates/ra_analysis/src/db.rs index 08aa9053b..78bbfcf2d 100644 --- a/crates/ra_analysis/src/db.rs +++ b/crates/ra_analysis/src/db.rs | |||
@@ -10,7 +10,7 @@ use crate::{ | |||
10 | hir, | 10 | hir, |
11 | symbol_index::SymbolIndex, | 11 | symbol_index::SymbolIndex, |
12 | syntax_ptr::SyntaxPtr, | 12 | syntax_ptr::SyntaxPtr, |
13 | loc2id::{IdMaps, IdDatabase}, | 13 | loc2id::{IdMaps}, |
14 | Cancelable, Canceled, FileId, | 14 | Cancelable, Canceled, FileId, |
15 | }; | 15 | }; |
16 | 16 | ||
@@ -77,7 +77,14 @@ impl salsa::ParallelDatabase for RootDatabase { | |||
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | impl IdDatabase for RootDatabase { | 80 | pub(crate) trait BaseDatabase: salsa::Database { |
81 | fn id_maps(&self) -> &IdMaps; | ||
82 | fn check_canceled(&self) -> Cancelable<()> { | ||
83 | check_canceled(self) | ||
84 | } | ||
85 | } | ||
86 | |||
87 | impl BaseDatabase for RootDatabase { | ||
81 | fn id_maps(&self) -> &IdMaps { | 88 | fn id_maps(&self) -> &IdMaps { |
82 | &self.id_maps | 89 | &self.id_maps |
83 | } | 90 | } |
@@ -136,7 +143,7 @@ salsa::database_storage! { | |||
136 | } | 143 | } |
137 | 144 | ||
138 | salsa::query_group! { | 145 | salsa::query_group! { |
139 | pub(crate) trait SyntaxDatabase: crate::input::FilesDatabase { | 146 | pub(crate) trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { |
140 | fn file_syntax(file_id: FileId) -> SourceFileNode { | 147 | fn file_syntax(file_id: FileId) -> SourceFileNode { |
141 | type FileSyntaxQuery; | 148 | type FileSyntaxQuery; |
142 | } | 149 | } |