diff options
Diffstat (limited to 'crates/ra_ide/src/change.rs')
-rw-r--r-- | crates/ra_ide/src/change.rs | 61 |
1 files changed, 46 insertions, 15 deletions
diff --git a/crates/ra_ide/src/change.rs b/crates/ra_ide/src/change.rs index b0aa2c8e0..45a58690b 100644 --- a/crates/ra_ide/src/change.rs +++ b/crates/ra_ide/src/change.rs | |||
@@ -166,13 +166,15 @@ impl LibraryData { | |||
166 | const GC_COOLDOWN: time::Duration = time::Duration::from_millis(100); | 166 | const GC_COOLDOWN: time::Duration = time::Duration::from_millis(100); |
167 | 167 | ||
168 | impl RootDatabase { | 168 | impl RootDatabase { |
169 | pub(crate) fn request_cancellation(&mut self) { | ||
170 | let _p = profile("RootDatabase::request_cancellation"); | ||
171 | self.salsa_runtime_mut().synthetic_write(Durability::LOW); | ||
172 | } | ||
173 | |||
169 | pub(crate) fn apply_change(&mut self, change: AnalysisChange) { | 174 | pub(crate) fn apply_change(&mut self, change: AnalysisChange) { |
170 | let _p = profile("RootDatabase::apply_change"); | 175 | let _p = profile("RootDatabase::apply_change"); |
176 | self.request_cancellation(); | ||
171 | log::info!("apply_change {:?}", change); | 177 | log::info!("apply_change {:?}", change); |
172 | { | ||
173 | let _p = profile("RootDatabase::apply_change/cancellation"); | ||
174 | self.salsa_runtime_mut().synthetic_write(Durability::LOW); | ||
175 | } | ||
176 | if !change.new_roots.is_empty() { | 178 | if !change.new_roots.is_empty() { |
177 | let mut local_roots = Vec::clone(&self.local_roots()); | 179 | let mut local_roots = Vec::clone(&self.local_roots()); |
178 | for (root_id, is_local) in change.new_roots { | 180 | for (root_id, is_local) in change.new_roots { |
@@ -299,45 +301,74 @@ impl RootDatabase { | |||
299 | )*} | 301 | )*} |
300 | } | 302 | } |
301 | sweep_each_query![ | 303 | sweep_each_query![ |
304 | // SourceDatabase | ||
302 | ra_db::ParseQuery | 305 | ra_db::ParseQuery |
303 | ra_db::SourceRootCratesQuery | 306 | ra_db::SourceRootCratesQuery |
307 | |||
308 | // AstDatabase | ||
304 | hir::db::AstIdMapQuery | 309 | hir::db::AstIdMapQuery |
305 | hir::db::ParseMacroQuery | 310 | hir::db::InternMacroQuery |
306 | hir::db::MacroDefQuery | ||
307 | hir::db::MacroArgQuery | 311 | hir::db::MacroArgQuery |
312 | hir::db::MacroDefQuery | ||
313 | hir::db::ParseMacroQuery | ||
308 | hir::db::MacroExpandQuery | 314 | hir::db::MacroExpandQuery |
315 | |||
316 | // DefDatabase | ||
317 | hir::db::RawItemsQuery | ||
318 | hir::db::ComputeCrateDefMapQuery | ||
309 | hir::db::StructDataQuery | 319 | hir::db::StructDataQuery |
320 | hir::db::UnionDataQuery | ||
310 | hir::db::EnumDataQuery | 321 | hir::db::EnumDataQuery |
322 | hir::db::ImplDataQuery | ||
311 | hir::db::TraitDataQuery | 323 | hir::db::TraitDataQuery |
312 | hir::db::RawItemsQuery | ||
313 | hir::db::ComputeCrateDefMapQuery | ||
314 | hir::db::GenericParamsQuery | ||
315 | hir::db::FunctionDataQuery | ||
316 | hir::db::TypeAliasDataQuery | 324 | hir::db::TypeAliasDataQuery |
325 | hir::db::FunctionDataQuery | ||
317 | hir::db::ConstDataQuery | 326 | hir::db::ConstDataQuery |
318 | hir::db::StaticDataQuery | 327 | hir::db::StaticDataQuery |
328 | hir::db::BodyWithSourceMapQuery | ||
329 | hir::db::BodyQuery | ||
330 | hir::db::ExprScopesQuery | ||
331 | hir::db::GenericParamsQuery | ||
332 | hir::db::AttrsQuery | ||
319 | hir::db::ModuleLangItemsQuery | 333 | hir::db::ModuleLangItemsQuery |
320 | hir::db::CrateLangItemsQuery | 334 | hir::db::CrateLangItemsQuery |
321 | hir::db::LangItemQuery | 335 | hir::db::LangItemQuery |
322 | hir::db::DocumentationQuery | 336 | hir::db::DocumentationQuery |
323 | hir::db::ExprScopesQuery | 337 | |
338 | // InternDatabase | ||
339 | hir::db::InternFunctionQuery | ||
340 | hir::db::InternStructQuery | ||
341 | hir::db::InternUnionQuery | ||
342 | hir::db::InternEnumQuery | ||
343 | hir::db::InternConstQuery | ||
344 | hir::db::InternStaticQuery | ||
345 | hir::db::InternTraitQuery | ||
346 | hir::db::InternTypeAliasQuery | ||
347 | hir::db::InternImplQuery | ||
348 | |||
349 | // HirDatabase | ||
324 | hir::db::DoInferQuery | 350 | hir::db::DoInferQuery |
325 | hir::db::TyQuery | 351 | hir::db::TyQuery |
326 | hir::db::ValueTyQuery | 352 | hir::db::ValueTyQuery |
353 | hir::db::ImplSelfTyQuery | ||
354 | hir::db::ImplTraitQuery | ||
327 | hir::db::FieldTypesQuery | 355 | hir::db::FieldTypesQuery |
328 | hir::db::CallableItemSignatureQuery | 356 | hir::db::CallableItemSignatureQuery |
357 | hir::db::GenericPredicatesForParamQuery | ||
329 | hir::db::GenericPredicatesQuery | 358 | hir::db::GenericPredicatesQuery |
330 | hir::db::GenericDefaultsQuery | 359 | hir::db::GenericDefaultsQuery |
331 | hir::db::BodyWithSourceMapQuery | ||
332 | hir::db::BodyQuery | ||
333 | hir::db::ImplsInCrateQuery | 360 | hir::db::ImplsInCrateQuery |
334 | hir::db::ImplsForTraitQuery | 361 | hir::db::ImplsForTraitQuery |
362 | hir::db::TraitSolverQuery | ||
363 | hir::db::InternTypeCtorQuery | ||
364 | hir::db::InternChalkImplQuery | ||
365 | hir::db::InternAssocTyValueQuery | ||
335 | hir::db::AssociatedTyDataQuery | 366 | hir::db::AssociatedTyDataQuery |
367 | hir::db::AssociatedTyValueQuery | ||
368 | hir::db::TraitSolveQuery | ||
336 | hir::db::TraitDatumQuery | 369 | hir::db::TraitDatumQuery |
337 | hir::db::StructDatumQuery | 370 | hir::db::StructDatumQuery |
338 | hir::db::ImplDatumQuery | 371 | hir::db::ImplDatumQuery |
339 | hir::db::ImplDataQuery | ||
340 | hir::db::TraitSolveQuery | ||
341 | ]; | 372 | ]; |
342 | acc.sort_by_key(|it| std::cmp::Reverse(it.1)); | 373 | acc.sort_by_key(|it| std::cmp::Reverse(it.1)); |
343 | acc | 374 | acc |