Skip to content

Commit 47bcc70

Browse files
committed
Updates to latest version of VS Code tyeps
1 parent 8892ce6 commit 47bcc70

7 files changed

Lines changed: 504 additions & 11 deletions

File tree

package-lock.json

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1554,7 +1554,7 @@
15541554
"@types/sinon": "^17.0.3",
15551555
"@types/stack-trace": "0.0.29",
15561556
"@types/tmp": "^0.0.33",
1557-
"@types/vscode": "^1.93.0",
1557+
"@types/vscode": "^1.100.0",
15581558
"@types/which": "^2.0.1",
15591559
"@types/winreg": "^1.2.30",
15601560
"@types/xml2js": "^0.4.2",

src/client/common/process/logger.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { IProcessLogger, SpawnOptions } from './types';
1212
import { escapeRegExp } from 'lodash';
1313
import { replaceAll } from '../stringUtils';
1414
import { identifyShellFromShellPath } from '../terminal/shellDetectors/baseShellDetector';
15+
import '../../common/extensions';
1516

1617
@injectable()
1718
export class ProcessLogger implements IProcessLogger {

src/client/common/utils/async.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
'use strict';
77

8+
import type { CancellationToken } from 'vscode';
9+
import { CancellationError } from 'vscode';
10+
811
export async function sleep(timeout: number): Promise<number> {
912
return new Promise<number>((resolve) => {
1013
setTimeout(() => resolve(timeout), timeout);
@@ -268,3 +271,17 @@ export async function waitForCondition(
268271
}, 10);
269272
});
270273
}
274+
275+
/**
276+
* Returns a promise that rejects with an {@CancellationError} as soon as the passed token is cancelled.
277+
* @see {@link raceCancellation}
278+
*/
279+
export function raceCancellationError<T>(promise: Promise<T>, token: CancellationToken): Promise<T> {
280+
return new Promise((resolve, reject) => {
281+
const ref = token.onCancellationRequested(() => {
282+
ref.dispose();
283+
reject(new CancellationError());
284+
});
285+
promise.then(resolve, reject).finally(() => ref.dispose());
286+
});
287+
}

0 commit comments

Comments
 (0)