Skip to content

Commit 5fe5bb5

Browse files
Add waitUntil for onDidStart event (#16375)
* WIP * WIP * Update * logging WIP * clean * Fix tests * tests * PR * more tests * fix tests * PR * fix test * fix test * fix test * Minor fixes * Updated with a few changes * Revert "Updated with a few changes" This reverts commit 797958d. * Fire when restarting the kernel --------- Co-authored-by: Don Jayamanne <don.jayamanne@outlook.com>
1 parent d190195 commit 5fe5bb5

20 files changed

+856
-341
lines changed

src/api.proposed.kernelStartHook.d.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT License.
33

4-
import type { Event, Uri } from 'vscode';
4+
import type { CancellationToken, Event, Uri } from 'vscode';
55

66
declare module './api' {
77
export interface Kernels {
@@ -11,6 +11,16 @@ declare module './api' {
1111
onDidStart: Event<{
1212
uri: Uri;
1313
kernel: Kernel;
14+
token: CancellationToken;
15+
/**
16+
* Allows to pause the event loop until the provided thenable resolved.
17+
* This can be useful to ensure startup code is executed before user code.
18+
*
19+
* *Note:* This function can only be called during event dispatch.
20+
*
21+
* @param thenable A thenable that delays kernel startup.
22+
*/
23+
waitUntil(thenable: Thenable<unknown>): void;
1424
}>;
1525
}
1626
}

0 commit comments

Comments
 (0)