Skip to content

Commit 8470669

Browse files
authored
Adopt activationEventsGenerator for custom editors (microsoft#166718)
For microsoft#166624
1 parent 3f5f1e4 commit 8470669

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ Registry.as<IEditorPaneRegistry>(EditorExtensions.EditorPane)
2929
]);
3030

3131
Registry.as<IEditorFactoryRegistry>(EditorExtensions.EditorFactory)
32-
.registerEditorSerializer(
33-
CustomEditorInputSerializer.ID,
34-
CustomEditorInputSerializer);
32+
.registerEditorSerializer(CustomEditorInputSerializer.ID, CustomEditorInputSerializer);
3533

3634
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench)
3735
.registerWorkbenchContribution(ComplexCustomWorkingCopyEditorHandler, LifecyclePhase.Starting);

src/vs/workbench/contrib/customEditor/common/extensionPoint.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,13 @@ const CustomEditorsContribution: IJSONSchema = {
8989
export const customEditorsExtensionPoint = ExtensionsRegistry.registerExtensionPoint<ICustomEditorsExtensionPoint[]>({
9090
extensionPoint: 'customEditors',
9191
deps: [languagesExtPoint],
92-
jsonSchema: CustomEditorsContribution
92+
jsonSchema: CustomEditorsContribution,
93+
activationEventsGenerator: (contribs: ICustomEditorsExtensionPoint[], result: { push(item: string): void }) => {
94+
for (const contrib of contribs) {
95+
const viewType = contrib[Fields.viewType];
96+
if (viewType) {
97+
result.push(`onCustomEditor:${viewType}`);
98+
}
99+
}
100+
},
93101
});

0 commit comments

Comments
 (0)