mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 09:08:48 +01:00
Adopt activationEventsGenerator for custom editors (#166718)
For #166624
This commit is contained in:
@@ -29,9 +29,7 @@ Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane)
|
||||
]);
|
||||
|
||||
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory)
|
||||
.registerEditorSerializer(
|
||||
CustomEditorInputSerializer.ID,
|
||||
CustomEditorInputSerializer);
|
||||
.registerEditorSerializer(CustomEditorInputSerializer.ID, CustomEditorInputSerializer);
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
|
||||
.registerWorkbenchContribution(ComplexCustomWorkingCopyEditorHandler, LifecyclePhase.Starting);
|
||||
|
||||
@@ -89,5 +89,13 @@ const CustomEditorsContribution: IJSONSchema = {
|
||||
export const customEditorsExtensionPoint = ExtensionsRegistry.registerExtensionPoint<ICustomEditorsExtensionPoint[]>({
|
||||
extensionPoint: 'customEditors',
|
||||
deps: [languagesExtPoint],
|
||||
jsonSchema: CustomEditorsContribution
|
||||
jsonSchema: CustomEditorsContribution,
|
||||
activationEventsGenerator: (contribs: ICustomEditorsExtensionPoint[], result: { push(item: string): void }) => {
|
||||
for (const contrib of contribs) {
|
||||
const viewType = contrib[Fields.viewType];
|
||||
if (viewType) {
|
||||
result.push(`onCustomEditor:${viewType}`);
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user