diff options
author | Aleksey Kladov <[email protected]> | 2019-01-17 11:11:00 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-17 11:11:00 +0000 |
commit | a2ca03d10b093ea20d7db8bfd78aa1e787482cc0 (patch) | |
tree | 0723f5b15899902811d027587a46698016d21d54 /crates/ra_db/src/lib.rs | |
parent | 454cc313589fb17de92d6f3dbf576a5ea5f4adf2 (diff) |
:arrow_up: salsa
Diffstat (limited to 'crates/ra_db/src/lib.rs')
-rw-r--r-- | crates/ra_db/src/lib.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_db/src/lib.rs b/crates/ra_db/src/lib.rs index 89113e7a6..dbeb9ec71 100644 --- a/crates/ra_db/src/lib.rs +++ b/crates/ra_db/src/lib.rs | |||
@@ -9,6 +9,7 @@ use std::panic; | |||
9 | 9 | ||
10 | use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; | 10 | use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; |
11 | 11 | ||
12 | pub use ::salsa as salsa; | ||
12 | pub use crate::{ | 13 | pub use crate::{ |
13 | cancellation::Canceled, | 14 | cancellation::Canceled, |
14 | syntax_ptr::LocalSyntaxPtr, | 15 | syntax_ptr::LocalSyntaxPtr, |
@@ -51,12 +52,9 @@ pub trait BaseDatabase: salsa::Database + panic::RefUnwindSafe { | |||
51 | } | 52 | } |
52 | } | 53 | } |
53 | 54 | ||
54 | salsa::query_group! { | 55 | #[salsa::query_group] |
55 | pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { | 56 | pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { |
56 | fn source_file(file_id: FileId) -> TreeArc<SourceFile> { | 57 | fn source_file(&self, file_id: FileId) -> TreeArc<SourceFile>; |
57 | type SourceFileQuery; | ||
58 | } | ||
59 | } | ||
60 | } | 58 | } |
61 | 59 | ||
62 | fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> { | 60 | fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> { |