Skip to content

Commit

Permalink
rename extension point to "notebooks", fix default value, #121819
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed May 11, 2021
1 parent d5ab22d commit a37e34a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/vs/workbench/contrib/notebook/browser/extensionPoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface INotebookMarkupRendererContribution {
const notebookProviderContribution: IJSONSchema = {
description: nls.localize('contributes.notebook.provider', 'Contributes notebook document provider.'),
type: 'array',
defaultSnippets: [{ body: [{ viewType: '', displayName: '' }] }],
defaultSnippets: [{ body: [{ viewType: '', displayName: '', 'selector': [{ 'filenamePattern': '' }] }] }],
items: {
type: 'object',
required: [
Expand Down Expand Up @@ -201,9 +201,15 @@ const notebookMarkupRendererContribution: IJSONSchema = {
}
};

export const notebookProviderExtensionPoint = ExtensionsRegistry.registerExtensionPoint<INotebookEditorContribution[]>(
export const notebooksExtensionPoint2 = ExtensionsRegistry.registerExtensionPoint<INotebookEditorContribution[]>(
{
extensionPoint: 'notebookProvider',
jsonSchema: { deprecationMessage: 'Use \'notebooks\' instead' }
});

export const notebooksExtensionPoint = ExtensionsRegistry.registerExtensionPoint<INotebookEditorContribution[]>(
{
extensionPoint: 'notebooks',
jsonSchema: notebookProviderContribution
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { NotebookExtensionDescription } from 'vs/workbench/api/common/extHost.pr
import { IEditorInput } from 'vs/workbench/common/editor';
import { DiffEditorInput } from 'vs/workbench/common/editor/diffEditorInput';
import { Memento } from 'vs/workbench/common/memento';
import { INotebookEditorContribution, notebookMarkupRendererExtensionPoint, notebookProviderExtensionPoint, notebookRendererExtensionPoint } from 'vs/workbench/contrib/notebook/browser/extensionPoint';
import { INotebookEditorContribution, notebookMarkupRendererExtensionPoint, notebooksExtensionPoint, notebookRendererExtensionPoint, notebooksExtensionPoint2 } from 'vs/workbench/contrib/notebook/browser/extensionPoint';
import { NotebookEditorOptions, updateEditorTopPadding } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
import { NotebookDiffEditorInput } from 'vs/workbench/contrib/notebook/browser/notebookDiffEditorInput';
import { NotebookCellTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
Expand Down Expand Up @@ -80,7 +80,8 @@ export class NotebookProviderInfoStore extends Disposable {
}
}));

notebookProviderExtensionPoint.setHandler(extensions => this._setupHandler(extensions));
notebooksExtensionPoint.setHandler(extensions => this._setupHandler(extensions));
notebooksExtensionPoint2.setHandler(extensions => this._setupHandler(extensions));
}

override dispose(): void {
Expand Down

0 comments on commit a37e34a

Please sign in to comment.