diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2023-12-03 22:07:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 22:07:40 +0000 |
commit | 0a738dc49df7a17416f4d62f62282292c1bb2174 (patch) | |
tree | 70b6514703490b496eca3f15b6f7d331f24b69eb /cli/lsp/tsc.rs | |
parent | 28c527c8f5855f4051cc02973a647741d20cb0fc (diff) |
perf(lsp): check tsc request cancellation before execution (#21447)
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r-- | cli/lsp/tsc.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 072a881c3..72dbcc3a8 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -4414,6 +4414,9 @@ fn request( request: TscRequest, token: CancellationToken, ) -> Result<Value, AnyError> { + if token.is_cancelled() { + return Err(anyhow!("Operation was cancelled.")); + } let (performance, id) = { let op_state = runtime.op_state(); let mut op_state = op_state.borrow_mut(); |