@@ -6499,7 +6499,7 @@ declare module 'vscode' {
6499
6499
/**
6500
6500
* Outputs the given trace message to the channel. Use this method to log verbose information.
6501
6501
*
6502
- * The message is only loggeed if the channel is configured to display {@link LogLevel.Trace trace} log level.
6502
+ * The message is only logged if the channel is configured to display {@link LogLevel.Trace trace} log level.
6503
6503
*
6504
6504
* @param message trace message to log
6505
6505
*/
@@ -6508,7 +6508,7 @@ declare module 'vscode' {
6508
6508
/**
6509
6509
* Outputs the given debug message to the channel.
6510
6510
*
6511
- * The message is only loggeed if the channel is configured to display {@link LogLevel.Debug debug} log level or lower.
6511
+ * The message is only logged if the channel is configured to display {@link LogLevel.Debug debug} log level or lower.
6512
6512
*
6513
6513
* @param message debug message to log
6514
6514
*/
@@ -6517,7 +6517,7 @@ declare module 'vscode' {
6517
6517
/**
6518
6518
* Outputs the given information message to the channel.
6519
6519
*
6520
- * The message is only loggeed if the channel is configured to display {@link LogLevel.Info info} log level or lower.
6520
+ * The message is only logged if the channel is configured to display {@link LogLevel.Info info} log level or lower.
6521
6521
*
6522
6522
* @param message info message to log
6523
6523
*/
@@ -6526,7 +6526,7 @@ declare module 'vscode' {
6526
6526
/**
6527
6527
* Outputs the given warning message to the channel.
6528
6528
*
6529
- * The message is only loggeed if the channel is configured to display {@link LogLevel.Warning warning} log level or lower.
6529
+ * The message is only logged if the channel is configured to display {@link LogLevel.Warning warning} log level or lower.
6530
6530
*
6531
6531
* @param message warning message to log
6532
6532
*/
@@ -6535,7 +6535,7 @@ declare module 'vscode' {
6535
6535
/**
6536
6536
* Outputs the given error or error message to the channel.
6537
6537
*
6538
- * The message is only loggeed if the channel is configured to display {@link LogLevel.Error error} log level or lower.
6538
+ * The message is only logged if the channel is configured to display {@link LogLevel.Error error} log level or lower.
6539
6539
*
6540
6540
* @param error Error or error message to log
6541
6541
*/
@@ -12489,6 +12489,21 @@ declare module 'vscode' {
12489
12489
*/
12490
12490
export const onDidChangeNotebookDocument: Event<NotebookDocumentChangeEvent>;
12491
12491
12492
+ /**
12493
+ * An event that is emitted when a {@link NotebookDocument notebook document} will be saved to disk.
12494
+ *
12495
+ * *Note 1:* Subscribers can delay saving by registering asynchronous work. For the sake of data integrity the editor
12496
+ * might save without firing this event. For instance when shutting down with dirty files.
12497
+ *
12498
+ * *Note 2:* Subscribers are called sequentially and they can {@link NotebookDocumentWillSaveEvent.waitUntil delay} saving
12499
+ * by registering asynchronous work. Protection against misbehaving listeners is implemented as such:
12500
+ * * there is an overall time budget that all listeners share and if that is exhausted no further listener is called
12501
+ * * listeners that take a long time or produce errors frequently will not be called anymore
12502
+ *
12503
+ * The current thresholds are 1.5 seconds as overall time budget and a listener can misbehave 3 times before being ignored.
12504
+ */
12505
+ export const onWillSaveNotebookDocument: Event<NotebookDocumentWillSaveEvent>;
12506
+
12492
12507
/**
12493
12508
* An event that is emitted when a {@link NotebookDocument notebook} is saved.
12494
12509
*/
@@ -13558,6 +13573,61 @@ declare module 'vscode' {
13558
13573
readonly cellChanges: readonly NotebookDocumentCellChange[];
13559
13574
}
13560
13575
13576
+ /**
13577
+ * An event that is fired when a {@link NotebookDocument notebook document} will be saved.
13578
+ *
13579
+ * To make modifications to the document before it is being saved, call the
13580
+ * {@linkcode NotebookDocumentWillSaveEvent.waitUntil waitUntil}-function with a thenable
13581
+ * that resolves to a {@link WorkspaceEdit workspace edit}.
13582
+ */
13583
+ export interface NotebookDocumentWillSaveEvent {
13584
+ /**
13585
+ * A cancellation token.
13586
+ */
13587
+ readonly token: CancellationToken;
13588
+
13589
+ /**
13590
+ * The {@link NotebookDocument notebook document} that will be saved.
13591
+ */
13592
+ readonly notebook: NotebookDocument;
13593
+
13594
+ /**
13595
+ * The reason why save was triggered.
13596
+ */
13597
+ readonly reason: TextDocumentSaveReason;
13598
+
13599
+ /**
13600
+ * Allows to pause the event loop and to apply {@link WorkspaceEdit workspace edit}.
13601
+ * Edits of subsequent calls to this function will be applied in order. The
13602
+ * edits will be *ignored* if concurrent modifications of the notebook document happened.
13603
+ *
13604
+ * *Note:* This function can only be called during event dispatch and not
13605
+ * in an asynchronous manner:
13606
+ *
13607
+ * ```ts
13608
+ * workspace.onWillSaveNotebookDocument(event => {
13609
+ * // async, will *throw* an error
13610
+ * setTimeout(() => event.waitUntil(promise));
13611
+ *
13612
+ * // sync, OK
13613
+ * event.waitUntil(promise);
13614
+ * })
13615
+ * ```
13616
+ *
13617
+ * @param thenable A thenable that resolves to {@link WorkspaceEdit workspace edit}.
13618
+ */
13619
+ waitUntil(thenable: Thenable<WorkspaceEdit>): void;
13620
+
13621
+ /**
13622
+ * Allows to pause the event loop until the provided thenable resolved.
13623
+ *
13624
+ * *Note:* This function can only be called during event dispatch.
13625
+ *
13626
+ * @param thenable A thenable that delays saving.
13627
+ */
13628
+ waitUntil(thenable: Thenable<any>): void;
13629
+ }
13630
+
13561
13631
/**
13562
13632
* The summary of a notebook cell execution.
13563
13633
*/
@@ -15946,6 +16016,13 @@ declare module 'vscode' {
15946
16016
*/
15947
16017
isDefault: boolean;
15948
16018
16019
+ /**
16020
+ * Whether this profile supports continuous running of requests. If so,
16021
+ * then {@link TestRunRequest.continuous} may be set to `true`. Defaults
16022
+ * to false.
16023
+ */
16024
+ supportsContinuousRun: boolean;
16025
+
15949
16026
/**
15950
16027
* Associated tag for the profile. If this is set, only {@link TestItem}
15951
16028
* instances with the same tag will be eligible to execute in this profile.
@@ -15966,6 +16043,11 @@ declare module 'vscode' {
15966
16043
* associated with the request should be created before the function returns
15967
16044
* or the returned promise is resolved.
15968
16045
*
16046
+ * If {@link supportsContinuousRun} is set, then {@link TestRunRequest.continuous}
16047
+ * may be `true`. In this case, the profile should observe changes to
16048
+ * source code and create new test runs by calling {@link TestController.createTestRun},
16049
+ * until the cancellation is requested on the `token`.
16050
+ *
15969
16051
* @param request Request information for the test run.
15970
16052
* @param cancellationToken Token that signals the used asked to abort the
15971
16053
* test run. If cancellation is requested on this token, all {@link TestRun}
@@ -16020,10 +16102,11 @@ declare module 'vscode' {
16020
16102
* @param runHandler Function called to start a test run.
16021
16103
* @param isDefault Whether this is the default action for its kind.
16022
16104
* @param tag Profile test tag.
16105
+ * @param supportsContinuousRun Whether the profile supports continuous running.
16023
16106
* @returns An instance of a {@link TestRunProfile}, which is automatically
16024
16107
* associated with this controller.
16025
16108
*/
16026
- createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void, isDefault?: boolean, tag?: TestTag): TestRunProfile;
16109
+ createRunProfile(label: string, kind: TestRunProfileKind, runHandler: (request: TestRunRequest, token: CancellationToken) => Thenable<void> | void, isDefault?: boolean, tag?: TestTag, supportsContinuousRun?: boolean ): TestRunProfile;
16027
16110
16028
16111
/**
16029
16112
* A function provided by the extension that the editor may call to request
@@ -16138,12 +16221,19 @@ declare module 'vscode' {
16138
16221
*/
16139
16222
readonly profile: TestRunProfile | undefined;
16140
16223
16224
+ /**
16225
+ * Whether the profile should run continuously as source code changes. Only
16226
+ * relevant for profiles that set {@link TestRunProfile.supportsContinuousRun}.
16227
+ */
16228
+ readonly continuous?: boolean;
16229
+
16141
16230
/**
16142
16231
* @param include Array of specific tests to run, or undefined to run all tests
16143
16232
* @param exclude An array of tests to exclude from the run.
16144
16233
* @param profile The run profile used for this request.
16234
+ * @param continuous Whether to run tests continuously as source changes.
16145
16235
*/
16146
- constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile);
16236
+ constructor(include?: readonly TestItem[], exclude?: readonly TestItem[], profile?: TestRunProfile, continuous?: boolean );
16147
16237
}
16148
16238
16149
16239
/**
0 commit comments