Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/apply_change.rs')
-rw-r--r--crates/ide-db/src/apply_change.rs28
1 files changed, 3 insertions, 25 deletions
diff --git a/crates/ide-db/src/apply_change.rs b/crates/ide-db/src/apply_change.rs
index 008b6fdbe2..b77a18f56e 100644
--- a/crates/ide-db/src/apply_change.rs
+++ b/crates/ide-db/src/apply_change.rs
@@ -1,37 +1,15 @@
//! Applies changes to the IDE state transactionally.
-use base_db::SourceRootId;
use profile::Bytes;
-use rustc_hash::FxHashSet;
-use salsa::{Database as _, Durability};
-use triomphe::Arc;
+use salsa::Database as _;
-use crate::{ChangeWithProcMacros, RootDatabase, symbol_index::SymbolsDatabase};
+use crate::{ChangeWithProcMacros, RootDatabase};
impl RootDatabase {
- pub fn request_cancellation(&mut self) {
- let _p = tracing::info_span!("RootDatabase::request_cancellation").entered();
- self.synthetic_write(Durability::LOW);
- }
-
pub fn apply_change(&mut self, change: ChangeWithProcMacros) {
let _p = tracing::info_span!("RootDatabase::apply_change").entered();
- self.request_cancellation();
+ self.trigger_cancellation();
tracing::trace!("apply_change {:?}", change);
- if let Some(roots) = &change.source_change.roots {
- let mut local_roots = FxHashSet::default();
- let mut library_roots = FxHashSet::default();
- for (idx, root) in roots.iter().enumerate() {
- let root_id = SourceRootId(idx as u32);
- if root.is_library {
- library_roots.insert(root_id);
- } else {
- local_roots.insert(root_id);
- }
- }
- self.set_local_roots_with_durability(Arc::new(local_roots), Durability::MEDIUM);
- self.set_library_roots_with_durability(Arc::new(library_roots), Durability::MEDIUM);
- }
change.apply(self);
}