mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 22:01:37 +00:00
check for cancellation when executing queries
Note that we can't just remove CheckCanceled trait altogether: sometimes it's useful to check for cancellation while the query is running! We do this, for example, in the name resolution fixed-point loop.
This commit is contained in:
parent
c452d2842c
commit
b8cae2cf8f
5 changed files with 6 additions and 6 deletions
|
@ -33,8 +33,12 @@ impl salsa::Database for RootDatabase {
|
|||
Canceled::throw()
|
||||
}
|
||||
fn salsa_event(&self, event: impl Fn() -> salsa::Event<RootDatabase>) {
|
||||
if let salsa::EventKind::DidValidateMemoizedValue { .. } = event().kind {
|
||||
self.check_canceled();
|
||||
match event().kind {
|
||||
salsa::EventKind::DidValidateMemoizedValue { .. }
|
||||
| salsa::EventKind::WillExecute { .. } => {
|
||||
self.check_canceled();
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue