mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
⬆️ salsa
This commit is contained in:
parent
454cc31358
commit
a2ca03d10b
14 changed files with 172 additions and 216 deletions
|
@ -9,6 +9,7 @@ use std::panic;
|
|||
|
||||
use ra_syntax::{TextUnit, TextRange, SourceFile, TreeArc};
|
||||
|
||||
pub use ::salsa as salsa;
|
||||
pub use crate::{
|
||||
cancellation::Canceled,
|
||||
syntax_ptr::LocalSyntaxPtr,
|
||||
|
@ -51,12 +52,9 @@ pub trait BaseDatabase: salsa::Database + panic::RefUnwindSafe {
|
|||
}
|
||||
}
|
||||
|
||||
salsa::query_group! {
|
||||
pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase {
|
||||
fn source_file(file_id: FileId) -> TreeArc<SourceFile> {
|
||||
type SourceFileQuery;
|
||||
}
|
||||
}
|
||||
#[salsa::query_group]
|
||||
pub trait SyntaxDatabase: crate::input::FilesDatabase + BaseDatabase {
|
||||
fn source_file(&self, file_id: FileId) -> TreeArc<SourceFile>;
|
||||
}
|
||||
|
||||
fn source_file(db: &impl SyntaxDatabase, file_id: FileId) -> TreeArc<SourceFile> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue