Skip to content

Commit

Permalink
Add waitUntil for onDidStart event (#16375)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
pwang347 and DonJayamanne authored Jan 20, 2025
1 parent d190195 commit 5fe5bb5
Show file tree
Hide file tree
Showing 20 changed files with 856 additions and 341 deletions.
12 changes: 11 additions & 1 deletion src/api.proposed.kernelStartHook.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

import type { Event, Uri } from 'vscode';
import type { CancellationToken, Event, Uri } from 'vscode';

declare module './api' {
export interface Kernels {
Expand All @@ -11,6 +11,16 @@ declare module './api' {
onDidStart: Event<{
uri: Uri;
kernel: Kernel;
token: CancellationToken;
/**
* Allows to pause the event loop until the provided thenable resolved.
* This can be useful to ensure startup code is executed before user code.
*
* *Note:* This function can only be called during event dispatch.
*
* @param thenable A thenable that delays kernel startup.
*/
waitUntil(thenable: Thenable<unknown>): void;
}>;
}
}
Loading

0 comments on commit 5fe5bb5

Please sign in to comment.