Skip to content

Commit 69981f4

Browse files
authored
Simplify types (microsoft#167374)
1 parent 7e636fe commit 69981f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/vs/platform/extensionManagement/common/implicitActivationEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
77
import { IExtensionManifest } from 'vs/platform/extensions/common/extensions';
88

99
export interface IActivationEventsGenerator<T> {
10-
(contribution: T, result: { push(item: string): void }): void;
10+
(contributions: T[], result: { push(item: string): void }): void;
1111
}
1212

1313
export class ImplicitActivationEventsImpl {

src/vs/workbench/services/extensions/common/extensionsRegistry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ export const schema: IJSONSchema = {
565565
}
566566
};
567567

568-
export type toArray<T> = T extends Array<any> ? T : T[];
568+
export type removeArray<T> = T extends Array<infer X> ? X : T;
569569

570570
export interface IExtensionPointDescriptor<T> {
571571
extensionPoint: string;
@@ -576,7 +576,7 @@ export interface IExtensionPointDescriptor<T> {
576576
* A function which runs before the extension point has been validated and which
577577
* can should collect automatic activation events from the contribution.
578578
*/
579-
activationEventsGenerator?: IActivationEventsGenerator<toArray<T>>;
579+
activationEventsGenerator?: IActivationEventsGenerator<removeArray<T>>;
580580
}
581581

582582
export class ExtensionsRegistryImpl {

0 commit comments

Comments
 (0)