diff --git a/.vscode/searches/api-todos.code-search b/.vscode/searches/api-todos.code-search index d60acb5a91d..dca854474c9 100644 --- a/.vscode/searches/api-todos.code-search +++ b/.vscode/searches/api-todos.code-search @@ -3,97 +3,53 @@ # Including: */vscode.d.ts # ContextLines: 1 -26 results - 1 file +12 results - 1 file src/vs/vscode.d.ts: - 11374 /** @deprecated */ - 11375: // todo@API remove - 11376 readonly viewType: string; + 11582 */ + 11583: //todo@API - add sugar function to add more outputs + 11584 export class NotebookCellOutput { - 11459 // @rob - 11460: //todo@API think about invalid state (no end, but start and vice versa) - 11461 readonly startTime?: number; + 11626 */ + 11627: //todo@API id-args is not used by jupyter but we it added with display_id in mind... + 11628 // @jupyter check if needed - 11593 */ - 11594: //todo@API - add sugar function to add more outputs - 11595 export class NotebookCellOutput { + 11678 */ + 11679: // todo@API should ctors only have the args for required properties? + 11680 constructor(kind: NotebookCellKind, value: string, languageId: string, outputs?: NotebookCellOutput[], metadata?: { [key: string]: any }, executionSummary?: NotebookCellExecutionSummary); - 11637 */ - 11638: //todo@API id-args is not used by jupyter but we it added with display_id in mind... - 11639 // @jupyter check if needed + 11767 */ + 11768: //todo@API inline? + 11769 export interface NotebookExecuteHandler { - 11689 */ - 11690: // todo@API should ctors only have the args for required properties? - 11691 constructor(kind: NotebookCellKind, value: string, languageId: string, outputs?: NotebookCellOutput[], metadata?: { [key: string]: any }, executionSummary?: NotebookCellExecutionSummary); + 11898 */ + 11899: //todo@api selected vs associated, jsdoc + 11900 readonly onDidChangeNotebookAssociation: Event<{ notebook: NotebookDocument, selected: boolean }>; - 11778 */ - 11779: //todo@API inline? - 11780 export interface NotebookExecuteHandler { + 12101 */ + 12102: // todo@api what should be in this namespace? should notebookDocuments and friends be in the workspace namespace? + 12103 export namespace notebooks { - 11826 - 11827: // todo@api remove - 11828 /** @deprecated */ + 12107 */ + 12108: // todo@api move to workspace + 12109 export const notebookDocuments: readonly NotebookDocument[]; - 11873 - 11874: // todo@API remove - 11875 /** @deprecated */ + 12123 */ + 12124: // todo@api move to workspace + 12125 export function openNotebookDocument(uri: Uri): Thenable; - 11917 */ - 11918: //todo@api selected vs associated, jsdoc - 11919 readonly onDidChangeNotebookAssociation: Event<{ notebook: NotebookDocument, selected: boolean }>; + 12135 */ + 12136: // todo@api move to workspace + 12137 export function openNotebookDocument(notebookType: string, content?: NotebookData): Thenable; - 11935 - 11936: // todo@api jsdoc - 11937: // todo@api Inline unless we can come up with more (future) properties - 11938 export interface NotebookCellExecuteStartContext { + 12141 */ + 12142: // todo@api move to workspace + 12143 export const onDidOpenNotebookDocument: Event; - 11945 - 11946: // todo@api jsdoc - 11947: // todo@api Inline unless we can come up with more (future) properties - 11948 export interface NotebookCellExecuteEndContext { + 12152 */ + 12153: // todo@api move to workspace + 12154 export const onDidCloseNotebookDocument: Event; - 11990 - 11991: // todo@API inline context object? - 11992 // @rob inline as arguments - - 11994 - 11995: // todo@API inline context object? - 11996 // @rob inline as arguments - - 12105 // @rob - 12106: // todo@API jsdoc for args - 12107: // todo@API should ctors only have the args for required properties? - 12108 constructor(text: string, alignment: NotebookCellStatusBarAlignment, command?: string | Command, tooltip?: string, priority?: number, accessibilityInformation?: AccessibilityInformation); - - 12125 // @rob - 12126: //todo@API jsdoc for return-type - 12127: //todo@API should this return T | T[] - 12128 provideCellStatusBarItems(cell: NotebookCell, token: CancellationToken): ProviderResult; - - 12139 */ - 12140: // todo@api what should be in this namespace? should notebookDocuments and friends be in the workspace namespace? - 12141 export namespace notebooks { - - 12145 */ - 12146: // todo@api move to workspace - 12147 export const notebookDocuments: readonly NotebookDocument[]; - - 12161 */ - 12162: // todo@api move to workspace - 12163 export function openNotebookDocument(uri: Uri): Thenable; - - 12173 */ - 12174: // todo@api move to workspace - 12175 export function openNotebookDocument(notebookType: string, content?: NotebookData): Thenable; - - 12179 */ - 12180: // todo@api move to workspace - 12181 export const onDidOpenNotebookDocument: Event; - - 12190 */ - 12191: // todo@api move to workspace - 12192 export const onDidCloseNotebookDocument: Event; - - 12204 */ - 12205: // todo@api move to workspace - 12206 export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable; + 12166 */ + 12167: // todo@api move to workspace + 12168 export function registerNotebookSerializer(notebookType: string, serializer: NotebookSerializer, options?: NotebookDocumentContentOptions): Disposable; diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.document.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.document.test.ts index 70e89d626e8..c7b4302a291 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.document.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.document.test.ts @@ -79,7 +79,7 @@ suite('Notebook Document', function () { assert.strictEqual(notebook.isUntitled, false); assert.strictEqual(notebook.cellCount, 1); - assert.strictEqual(notebook.viewType, 'notebook.nbdtest'); + assert.strictEqual(notebook.notebookType, 'notebook.nbdtest'); }); test('notebook open/close, notebook ready when cell-document open event is fired', async function () { @@ -285,7 +285,7 @@ suite('Notebook Document', function () { assert.strictEqual(notebook.isDirty, false); assert.strictEqual(notebook.isUntitled, false); assert.strictEqual(notebook.cellCount, 1); - assert.strictEqual(notebook.viewType, 'notebook.nbdtest'); + assert.strictEqual(notebook.notebookType, 'notebook.nbdtest'); const edit = new vscode.WorkspaceEdit(); edit.replaceNotebookCells(notebook.uri, new vscode.NotebookRange(0, 0), [{ 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 1fce879547d..1077a51247e 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts @@ -36,9 +36,9 @@ class Kernel { readonly associatedNotebooks = new Set(); constructor(id: string, label: string) { - this.controller = vscode.notebook.createNotebookController(id, 'notebookCoreTest', label); + this.controller = vscode.notebooks.createNotebookController(id, 'notebookCoreTest', label); this.controller.executeHandler = this._execute.bind(this); - this.controller.hasExecutionOrder = true; + this.controller.supportsExecutionOrder = true; this.controller.supportedLanguages = ['typescript', 'javascript']; this.controller.onDidChangeNotebookAssociation(e => { if (e.selected) { @@ -167,7 +167,7 @@ suite('Notebook API tests', function () { kernel1 = new Kernel('mainKernel', 'Notebook Primary Test Kernel'); const listener = vscode.notebook.onDidOpenNotebookDocument(async notebook => { - if (notebook.viewType === kernel1.controller.viewType) { + if (notebook.notebookType === kernel1.controller.notebookType) { await vscode.commands.executeCommand('notebook.selectKernel', { extension: 'vscode.vscode-api-tests', id: kernel1.controller.id @@ -179,7 +179,7 @@ suite('Notebook API tests', function () { kernel2 = new class extends Kernel { constructor() { super('secondaryKernel', 'Notebook Secondary Test Kernel'); - this.controller.hasExecutionOrder = false; + this.controller.supportsExecutionOrder = false; } override async _runCell(cell: vscode.NotebookCell) { diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index b6ddd6518b1..813304011b2 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -11371,10 +11371,6 @@ declare module 'vscode' { */ readonly uri: Uri; - /** @deprecated */ - // todo@API remove - readonly viewType: string; - /** * The type of notebook. */ @@ -11817,10 +11813,6 @@ declare module 'vscode' { */ readonly id: string; - // todo@api remove - /** @deprecated */ - readonly viewType: string; - /** * The notebook type this controller is for. */ @@ -11864,10 +11856,6 @@ declare module 'vscode' { */ supportsExecutionOrder?: boolean; - // todo@API remove - /** @deprecated */ - hasExecutionOrder?: boolean; - /** * Create a cell execution task. * diff --git a/src/vs/workbench/api/common/extHostNotebook.ts b/src/vs/workbench/api/common/extHostNotebook.ts index 6bd60f23cda..e220a0d6f00 100644 --- a/src/vs/workbench/api/common/extHostNotebook.ts +++ b/src/vs/workbench/api/common/extHostNotebook.ts @@ -293,7 +293,7 @@ export class ExtHostNotebookController implements ExtHostNotebookShape { }; } - const editorId = await this._notebookEditorsProxy.$tryShowNotebookDocument(notebookOrUri.uri, notebookOrUri.viewType, resolvedOptions); + const editorId = await this._notebookEditorsProxy.$tryShowNotebookDocument(notebookOrUri.uri, notebookOrUri.notebookType, resolvedOptions); const editor = editorId && this._editors.get(editorId)?.apiEditor; if (editor) { diff --git a/src/vs/workbench/api/common/extHostNotebookDocument.ts b/src/vs/workbench/api/common/extHostNotebookDocument.ts index 0d01b26a8b1..55c2669a3d7 100644 --- a/src/vs/workbench/api/common/extHostNotebookDocument.ts +++ b/src/vs/workbench/api/common/extHostNotebookDocument.ts @@ -159,7 +159,6 @@ export class ExtHostNotebookDocument { this._notebook = { get uri() { return that.uri; }, get version() { return that._versionId; }, - get viewType() { return that._notebookType; }, get notebookType() { return that._notebookType; }, get isDirty() { return that._isDirty; }, get isUntitled() { return that.uri.scheme === Schemas.untitled; }, diff --git a/src/vs/workbench/api/common/extHostNotebookKernels.ts b/src/vs/workbench/api/common/extHostNotebookKernels.ts index ab1c021443f..4b4332b305f 100644 --- a/src/vs/workbench/api/common/extHostNotebookKernels.ts +++ b/src/vs/workbench/api/common/extHostNotebookKernels.ts @@ -111,7 +111,6 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape { const controller: vscode.NotebookController = { get id() { return id; }, - get viewType() { return data.notebookType; }, get notebookType() { return data.notebookType; }, onDidChangeNotebookAssociation: onDidChangeSelection.event, get label() { @@ -142,13 +141,6 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape { data.supportedLanguages = value; _update(); }, - get hasExecutionOrder() { - return data.supportsExecutionOrder ?? false; - }, - set hasExecutionOrder(value) { - data.supportsExecutionOrder = value; - _update(); - }, get supportsExecutionOrder() { return data.supportsExecutionOrder ?? false; }, diff --git a/src/vs/workbench/test/browser/api/extHostNotebookKernel2.test.ts b/src/vs/workbench/test/browser/api/extHostNotebookKernel2.test.ts index 2ecbf92f398..4fe7cde00ce 100644 --- a/src/vs/workbench/test/browser/api/extHostNotebookKernel2.test.ts +++ b/src/vs/workbench/test/browser/api/extHostNotebookKernel2.test.ts @@ -124,12 +124,12 @@ suite('NotebookKernel', function () { const kernel = extHostNotebookKernels.createNotebookController(nullExtensionDescription, 'foo', '*', 'Foo'); assert.throws(() => (kernel).id = 'dd'); - assert.throws(() => (kernel).viewType = 'dd'); + assert.throws(() => (kernel).notebookType = 'dd'); assert.ok(kernel); assert.strictEqual(kernel.id, 'foo'); assert.strictEqual(kernel.label, 'Foo'); - assert.strictEqual(kernel.viewType, '*'); + assert.strictEqual(kernel.notebookType, '*'); await rpcProtocol.sync(); assert.strictEqual(kernelData.size, 1);