Skip to content

Commit

Permalink
Mark notebookContentProvider proposal as deprecated (#150493)
Browse files Browse the repository at this point in the history
For #147248

Marks the top level types in this file as deprecated. Also hooks up `registerNotebookContentProvider` to report deprecated API usage
  • Loading branch information
mjbvz authored May 26, 2022
1 parent 336f860 commit fd19b85
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/vs/workbench/api/common/extHost.api.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,10 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
},
registerNotebookContentProvider: (viewType: string, provider: vscode.NotebookContentProvider, options?: vscode.NotebookDocumentContentOptions, registration?: vscode.NotebookRegistrationData) => {
checkProposedApiEnabled(extension, 'notebookContentProvider');

extHostApiDeprecation.report('workspace.registerNotebookContentProvider', extension,
`The notebookContentProvider API is not on track for finalization and will be removed.`);

return extHostNotebook.registerNotebookContentProvider(extension, viewType, provider, options, isProposedApiEnabled(extension, 'notebookLiveShare') ? registration : undefined);
},
onDidChangeConfiguration: (listener: (_: any) => any, thisArgs?: any, disposables?: extHostTypes.Disposable[]) => {
Expand Down
8 changes: 7 additions & 1 deletion src/vscode-dts/vscode.proposed.notebookContentProvider.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

declare module 'vscode' {

// https://github.com/microsoft/vscode/issues/106744
// https://github.com/microsoft/vscode/issues/147248

/** @deprecated */
interface NotebookDocumentBackup {
/**
* Unique identifier for the backup.
Expand All @@ -24,17 +25,21 @@ declare module 'vscode' {
delete(): void;
}

/** @deprecated */
interface NotebookDocumentBackupContext {
readonly destination: Uri;
}

/** @deprecated */
interface NotebookDocumentOpenContext {
readonly backupId?: string;
readonly untitledDocumentData?: Uint8Array;
}

// todo@API use openNotebookDOCUMENT to align with openCustomDocument etc?
// todo@API rename to NotebookDocumentContentProvider
/** @deprecated */

export interface NotebookContentProvider {

readonly options?: NotebookDocumentContentOptions;
Expand All @@ -60,6 +65,7 @@ declare module 'vscode' {

// TODO@api use NotebookDocumentFilter instead of just notebookType:string?
// TODO@API options duplicates the more powerful variant on NotebookContentProvider
/** @deprecated */
export function registerNotebookContentProvider(notebookType: string, provider: NotebookContentProvider, options?: NotebookDocumentContentOptions): Disposable;
}
}

0 comments on commit fd19b85

Please sign in to comment.