Move FeatureFlags

This commit is contained in:
Aleksey Kladov 2020-03-10 18:56:15 +01:00
parent bf582e77d6
commit 14094e4477
8 changed files with 24 additions and 42 deletions

View file

@ -84,7 +84,6 @@ pub use ra_db::{
};
pub use ra_ide_db::{
change::{AnalysisChange, LibraryData},
feature_flags::FeatureFlags,
line_index::{LineCol, LineIndex},
line_index_utils::translate_offset_with_edit,
search::SearchScope,
@ -131,13 +130,13 @@ pub struct AnalysisHost {
impl Default for AnalysisHost {
fn default() -> AnalysisHost {
AnalysisHost::new(None, FeatureFlags::default())
AnalysisHost::new(None)
}
}
impl AnalysisHost {
pub fn new(lru_capcity: Option<usize>, feature_flags: FeatureFlags) -> AnalysisHost {
AnalysisHost { db: RootDatabase::new(lru_capcity, feature_flags) }
pub fn new(lru_capacity: Option<usize>) -> AnalysisHost {
AnalysisHost { db: RootDatabase::new(lru_capacity) }
}
/// Returns a snapshot of the current state, which you can query for
/// semantic information.
@ -145,10 +144,6 @@ impl AnalysisHost {
Analysis { db: self.db.snapshot() }
}
pub fn feature_flags(&self) -> &FeatureFlags {
&self.db.feature_flags
}
/// Applies changes to the current state of the world. If there are
/// outstanding snapshots, they will be canceled.
pub fn apply_change(&mut self, change: AnalysisChange) {
@ -224,11 +219,6 @@ impl Analysis {
(host.analysis(), file_id)
}
/// Features for Analysis.
pub fn feature_flags(&self) -> &FeatureFlags {
&self.db.feature_flags
}
/// Debug info about the current state of the analysis.
pub fn status(&self) -> Cancelable<String> {
self.with_db(|db| status::status(&*db))