mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Move FeatureFlags
This commit is contained in:
parent
bf582e77d6
commit
14094e4477
8 changed files with 24 additions and 42 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue