mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Prepare SourceDatabase API for lazy file loading
This commit is contained in:
parent
1555a1aa0d
commit
abf2179c0b
14 changed files with 123 additions and 90 deletions
|
@ -52,7 +52,7 @@ use std::sync::Arc;
|
|||
use ra_cfg::CfgOptions;
|
||||
use ra_db::{
|
||||
salsa::{self, ParallelDatabase},
|
||||
CheckCanceled, SourceDatabase,
|
||||
CheckCanceled, FileLoader, SourceDatabase,
|
||||
};
|
||||
use ra_syntax::{SourceFile, TextRange, TextUnit};
|
||||
use ra_text_edit::TextEdit;
|
||||
|
@ -289,10 +289,14 @@ impl AnalysisHost {
|
|||
pub fn per_query_memory_usage(&mut self) -> Vec<(String, ra_prof::Bytes)> {
|
||||
self.db.per_query_memory_usage()
|
||||
}
|
||||
pub fn raw_database(&self) -> &(impl hir::db::HirDatabase + salsa::Database) {
|
||||
pub fn raw_database(
|
||||
&self,
|
||||
) -> &(impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) {
|
||||
&self.db
|
||||
}
|
||||
pub fn raw_database_mut(&mut self) -> &mut (impl hir::db::HirDatabase + salsa::Database) {
|
||||
pub fn raw_database_mut(
|
||||
&mut self,
|
||||
) -> &mut (impl hir::db::HirDatabase + salsa::Database + ra_db::SourceDatabaseExt) {
|
||||
&mut self.db
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue