diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-12 16:49:39 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-06-12 16:49:39 +0100 |
commit | a3a03b65dca9dc174bd58cd3d877ede18fc58637 (patch) | |
tree | 464e2eaab5133f137e9d5c36fb34f6f6876c0432 /crates/ra_ide_api/src | |
parent | c452d2842c2ac7156178a05fe477e8832253a2c4 (diff) | |
parent | b8cae2cf8f7d2a0162d614e25ef95d7e4a5d3677 (diff) |
Merge #1398
1398: check for cancellation when executing queries r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r-- | crates/ra_ide_api/src/db.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/db.rs b/crates/ra_ide_api/src/db.rs index b3f395502..82b061419 100644 --- a/crates/ra_ide_api/src/db.rs +++ b/crates/ra_ide_api/src/db.rs | |||
@@ -33,8 +33,12 @@ impl salsa::Database for RootDatabase { | |||
33 | Canceled::throw() | 33 | Canceled::throw() |
34 | } | 34 | } |
35 | fn salsa_event(&self, event: impl Fn() -> salsa::Event<RootDatabase>) { | 35 | fn salsa_event(&self, event: impl Fn() -> salsa::Event<RootDatabase>) { |
36 | if let salsa::EventKind::DidValidateMemoizedValue { .. } = event().kind { | 36 | match event().kind { |
37 | self.check_canceled(); | 37 | salsa::EventKind::DidValidateMemoizedValue { .. } |
38 | | salsa::EventKind::WillExecute { .. } => { | ||
39 | self.check_canceled(); | ||
40 | } | ||
41 | _ => (), | ||
38 | } | 42 | } |
39 | } | 43 | } |
40 | } | 44 | } |