remove redundant tag

This commit is contained in:
Aaron Munger
2023-07-05 10:50:13 -07:00
parent e19f1afabd
commit d772a63452
6 changed files with 8 additions and 14 deletions
@@ -89,15 +89,12 @@ export class InteractiveDocumentContribution extends Disposable implements IWork
const info = notebookService.getContributedNotebookType('interactive');
// We need to contribute a notebook type for the Interactive Window to provide notebook models.
// Don't add a file selector for the notebook type to avoid having the notebook Service create an editor for it.
// The IW editor is registered below, and we don't want it overwritten by the notebook Service.
if (!info) {
this._register(notebookService.registerContributedNotebookType('interactive', {
providerDisplayName: 'Interactive Notebook',
displayName: 'Interactive',
filenamePattern: ['*.interactive'],
exclusive: true,
externalEditor: true
exclusive: true
}));
}
@@ -279,8 +279,9 @@ export class NotebookProviderInfoStore extends Disposable {
}
this._contributedEditors.set(info.id, info);
let editorRegistration: IDisposable | undefined;
// Don't overwrite editor contributions if they come from elsewhere
if (!info.externalEditor) {
// built-in notebook providers contribute their own editors
if (info.extension) {
editorRegistration = this._registerContributionPoint(info);
this._contributedEditorDisposables.add(editorRegistration);
}
@@ -640,8 +641,7 @@ export class NotebookService extends Disposable implements INotebookService {
providerDisplayName: data.providerDisplayName,
exclusive: data.exclusive,
priority: RegisteredEditorPriority.default,
selectors: [],
externalEditor: !!data.externalEditor
selectors: []
});
info.update({ selectors: data.filenamePattern });
@@ -533,8 +533,6 @@ export interface INotebookContributionData {
displayName: string;
filenamePattern: (string | glob.IRelativePattern | INotebookExclusiveDocumentFilter)[];
exclusive: boolean;
/// Editor contribution is handled elswhere e.g. interactive
externalEditor?: boolean;
}
@@ -20,7 +20,6 @@ export interface NotebookEditorDescriptor {
readonly priority: RegisteredEditorPriority;
readonly providerDisplayName: string;
readonly exclusive: boolean;
readonly externalEditor?: boolean;
}
export class NotebookProviderInfo {
@@ -31,7 +30,6 @@ export class NotebookProviderInfo {
readonly priority: RegisteredEditorPriority;
readonly providerDisplayName: string;
readonly exclusive: boolean;
readonly externalEditor: boolean;
private _selectors: NotebookSelector[];
get selectors() {
@@ -59,7 +57,6 @@ export class NotebookProviderInfo {
transientOutputs: false,
cellContentMetadata: {}
};
this.externalEditor = !!descriptor.externalEditor;
}
update(args: { selectors?: NotebookSelector[]; options?: TransientOptions }) {
@@ -79,6 +79,7 @@ export interface INotebookService {
getNotebookTextModels(): Iterable<NotebookTextModel>;
listNotebookDocuments(): readonly NotebookTextModel[];
/** Register a notebook type that we will handle. The notebook editor will be registered for notebook types contributed by extensions */
registerContributedNotebookType(viewType: string, data: INotebookContributionData): IDisposable;
getContributedNotebookType(viewType: string): NotebookProviderInfo | undefined;
getContributedNotebookTypes(resource?: URI): readonly NotebookProviderInfo[];
@@ -260,7 +260,8 @@ function extensionDescriptionArrayToMap(extensions: IExtensionDescription[]): Ex
}
export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
if (!extension.enabledApiProposals) {
if (!extension.
enabledApiProposals) {
return false;
}
return extension.enabledApiProposals.includes(proposal);