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
|
@ -32,8 +32,10 @@ use ra_syntax::{
|
|||
SyntaxKind::{self, *},
|
||||
ast::{self, NameOwner},
|
||||
};
|
||||
use ra_db::{SourceRootId, FilesDatabase, LocalSyntaxPtr};
|
||||
use salsa::ParallelDatabase;
|
||||
use ra_db::{
|
||||
SourceRootId, FilesDatabase, LocalSyntaxPtr,
|
||||
salsa::{self, ParallelDatabase},
|
||||
};
|
||||
use rayon::prelude::*;
|
||||
|
||||
use crate::{
|
||||
|
@ -41,16 +43,11 @@ use crate::{
|
|||
db::RootDatabase,
|
||||
};
|
||||
|
||||
salsa::query_group! {
|
||||
pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
|
||||
fn file_symbols(file_id: FileId) -> Arc<SymbolIndex> {
|
||||
type FileSymbolsQuery;
|
||||
}
|
||||
fn library_symbols(id: SourceRootId) -> Arc<SymbolIndex> {
|
||||
type LibrarySymbolsQuery;
|
||||
storage input;
|
||||
}
|
||||
}
|
||||
#[salsa::query_group]
|
||||
pub(crate) trait SymbolsDatabase: hir::db::HirDatabase {
|
||||
fn file_symbols(&self, file_id: FileId) -> Arc<SymbolIndex>;
|
||||
#[salsa::input]
|
||||
fn library_symbols(&self, id: SourceRootId) -> Arc<SymbolIndex>;
|
||||
}
|
||||
|
||||
fn file_symbols(db: &impl SymbolsDatabase, file_id: FileId) -> Arc<SymbolIndex> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue