aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_db/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_db/src/lib.rs')
-rw-r--r--crates/ra_db/src/lib.rs10
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
10use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc}; 10use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc};
11 11
12pub use ::salsa as salsa;
12pub use crate::{ 13pub 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
54salsa::query_group! { 55#[salsa::query_group]
55 pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase { 56pub 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
62fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> { 60fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> {