Skip to content

Commit 3f817b3

Browse files
authored
Don't show notification after local query cancellation (#3489)
* Don't show notification after local query cancellation * Update CHANGELOG
1 parent 2d1c234 commit 3f817b3

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## [UNRELEASED]
44

5+
- Don't show notification after local query cancellation. [#3489](https://github.com/github/vscode-codeql/pull/3489)
56
- Databases created from [CodeQL test cases](https://docs.github.com/en/code-security/codeql-cli/using-the-advanced-functionality-of-the-codeql-cli/testing-custom-queries) are now copied into a shared VS Code storage location. This avoids a bug where re-running test cases would fail if the test's database is already imported into the workspace. [#3433](https://github.com/github/vscode-codeql/pull/3433)
67

78
## 1.12.3 - 29 February 2024

extensions/ql-vscode/src/local-queries/local-queries.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import type {
22
ProgressCallback,
33
ProgressUpdate,
44
} from "../common/vscode/progress";
5-
import { withProgress } from "../common/vscode/progress";
5+
import {
6+
UserCancellationException,
7+
withProgress,
8+
} from "../common/vscode/progress";
69
import type { CancellationToken, Range, TabInputText } from "vscode";
710
import { CancellationTokenSource, Uri, window } from "vscode";
811
import {
@@ -492,7 +495,12 @@ export class LocalQueries extends DisposableObject {
492495
// to unify both error handling paths.
493496
const err = asError(e);
494497
await localQueryRun.fail(err);
495-
throw e;
498+
499+
if (token.isCancellationRequested) {
500+
throw new UserCancellationException(err.message, true);
501+
} else {
502+
throw e;
503+
}
496504
}
497505
} finally {
498506
source.dispose();

0 commit comments

Comments
 (0)