diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts index 8ab52e28a78..293913f62a1 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts @@ -859,12 +859,12 @@ suite('Notebook API tests', function () { const p = new Promise(r => resolve = r); const listener = vscode.notebook.onDidChangeNotebookCellExecutionState(e => { if (eventCount === 0) { - assert.strictEqual(e.executionState, vscode.NotebookCellExecutionState.Pending, 'should be set to Pending'); + assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Pending, 'should be set to Pending'); } else if (eventCount === 1) { - assert.strictEqual(e.executionState, vscode.NotebookCellExecutionState.Executing, 'should be set to Executing'); + assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Executing, 'should be set to Executing'); assert.strictEqual(cell.outputs.length, 0, 'no outputs yet: ' + JSON.stringify(cell.outputs[0])); } else if (eventCount === 2) { - assert.strictEqual(e.executionState, vscode.NotebookCellExecutionState.Idle, 'should be set to Idle'); + assert.strictEqual(e.state, vscode.NotebookCellExecutionState.Idle, 'should be set to Idle'); assert.strictEqual(cell.outputs.length, 1, 'should have an output'); resolve(); } diff --git a/src/vs/vscode.proposed.d.ts b/src/vs/vscode.proposed.d.ts index 8049fdac17d..7a049465872 100644 --- a/src/vs/vscode.proposed.d.ts +++ b/src/vs/vscode.proposed.d.ts @@ -1956,7 +1956,7 @@ declare module 'vscode' { */ // todo@api rename to notebooks? // todo@api what should be in this namespace? should notebookDocuments and friends be in the workspace namespace? - export namespace notebook { + export namespace notebooks { /** * All notebook documents currently known to the editor. @@ -2073,7 +2073,7 @@ declare module 'vscode' { readonly state: NotebookCellExecutionState; } - export namespace notebook { + export namespace notebooks { /** * An {@link Event} which fires when the execution state of a cell has changed. @@ -2085,6 +2085,15 @@ declare module 'vscode' { //#endregion + //#region https://github.com/microsoft/vscode/issues/106744, Notebook, deprecated + + /** + * @deprecated use notebooks instead + */ + export const notebook: typeof notebooks; + + //#endregion + //#region https://github.com/microsoft/vscode/issues/106744, NotebookEditor export enum NotebookEditorRevealType { @@ -2207,7 +2216,7 @@ declare module 'vscode' { selections?: NotebookRange[]; } - export namespace notebook { + export namespace notebooks { @@ -2302,7 +2311,7 @@ declare module 'vscode' { dispose(): void; } - export namespace notebook { + export namespace notebooks { export function createNotebookEditorDecorationType(options: NotebookDecorationRenderOptions): NotebookEditorDecorationType; } @@ -2310,7 +2319,7 @@ declare module 'vscode' { //#region https://github.com/microsoft/vscode/issues/106744, NotebookConcatTextDocument - export namespace notebook { + export namespace notebooks { /** * Create a document that is the concatenation of all notebook cells. By default all code-cells are included * but a selector can be provided to narrow to down the set of cells. @@ -2395,7 +2404,7 @@ declare module 'vscode' { backupNotebook(document: NotebookDocument, context: NotebookDocumentBackupContext, token: CancellationToken): Thenable; } - export namespace notebook { + export namespace notebooks { // TODO@api use NotebookDocumentFilter instead of just notebookType:string? // TODO@API options duplicates the more powerful variant on NotebookContentProvider @@ -2412,7 +2421,7 @@ declare module 'vscode' { exclusive?: boolean; } - export namespace notebook { + export namespace notebooks { // SPECIAL overload with NotebookRegistrationData export function registerNotebookContentProvider(notebookType: string, provider: NotebookContentProvider, options?: NotebookDocumentContentOptions, registrationData?: NotebookRegistrationData): Disposable; // SPECIAL overload with NotebookRegistrationData @@ -2486,7 +2495,7 @@ declare module 'vscode' { postMessage(editor: NotebookEditor, message: TSend): void; } - export namespace notebook { + export namespace notebooks { /** * Creates a new messaging instance used to communicate with a specific * renderer. The renderer only has access to messaging if `requiresMessaging` diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 9cead7ebfe8..3ba64de72d2 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1054,7 +1054,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I }; // namespace: notebook - const notebook: typeof vscode.notebook = { + const notebooks: typeof vscode.notebooks = { async openNotebookDocument(uriOrOptions?: URI | string, content?: vscode.NotebookData) { checkProposedApiEnabled(extension); let uri: URI; @@ -1144,7 +1144,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I env, extensions, languages, - notebook, + notebooks, + notebook: notebooks, scm, tasks, test,