Always require passing in explicit instantiation for editor contribution (#167458)

Always require passing in explicit instantiation for editor contributions
This commit is contained in:
Matt Bierner
2022-11-28 13:46:37 -08:00
committed by GitHub
parent 068357dfeb
commit 14cd3149a8
4 changed files with 10 additions and 10 deletions

View File

@@ -515,7 +515,7 @@ export function registerInstantiatedEditorAction(editorAction: EditorAction): vo
EditorContributionRegistry.INSTANCE.registerEditorAction(editorAction);
}
export function registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation = EditorContributionInstantiation.Eager): void {
export function registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {
EditorContributionRegistry.INSTANCE.registerEditorContribution(id, ctor, instantiation);
}
@@ -567,7 +567,7 @@ class EditorContributionRegistry {
this.editorCommands = Object.create(null);
}
public registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation = EditorContributionInstantiation.Eager): void {
public registerEditorContribution<Services extends BrandedService[]>(id: string, ctor: { new(editor: ICodeEditor, ...services: Services): IEditorContribution }, instantiation: EditorContributionInstantiation): void {
this.editorContributions.push({ id, ctor: ctor as IEditorContributionCtor, instantiation });
}