Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bind multiple Contribution using for of instead foreach #9148

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/core/src/browser/frontend-application-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,18 +224,18 @@ export const frontendApplicationModule = new ContainerModule((bind, unbind, isBo

bind(ResourceContextKey).toSelf().inSingletonScope();
bind(CommonFrontendContribution).toSelf().inSingletonScope();
[FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution, ColorContribution].forEach(serviceIdentifier =>
bind(serviceIdentifier).toService(CommonFrontendContribution)
);
for (const identifier of [FrontendApplicationContribution, CommandContribution, KeybindingContribution, MenuContribution, ColorContribution]) {
bind(identifier).toService(CommonFrontendContribution);
}

bind(QuickOpenService).toSelf().inSingletonScope();
bind(QuickInputService).toSelf().inSingletonScope();
bind(QuickTitleBar).toSelf().inSingletonScope();
bind(QuickCommandService).toSelf().inSingletonScope();
bind(QuickCommandFrontendContribution).toSelf().inSingletonScope();
[CommandContribution, KeybindingContribution, MenuContribution].forEach(serviceIdentifier =>
bind(serviceIdentifier).toService(QuickCommandFrontendContribution)
);
for (const identifier of [CommandContribution, KeybindingContribution, MenuContribution]) {
bind(identifier).toService(QuickCommandFrontendContribution);
}

bind(QuickPickService).to(QuickPickServiceImpl).inSingletonScope().onActivation(({ container }, quickPickService: QuickPickService) => {
WebSocketConnectionProvider.createProxy(container, quickPickServicePath, quickPickService);
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/browser/keybinding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ before(async () => {
bindContributionProvider(bind, KeybindingContribution);

bind(TestContribution).toSelf().inSingletonScope();
[CommandContribution, KeybindingContribution].forEach(serviceIdentifier =>
bind(serviceIdentifier).toService(TestContribution)
);
for (const identifier of [CommandContribution, KeybindingContribution]) {
bind(identifier).toService(TestContribution);
}

bind(KeybindingContext).toConstantValue({
id: 'testContext',
Expand Down
6 changes: 3 additions & 3 deletions packages/editor/src/browser/editor-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ export default new ContainerModule(bind => {

bind(VariableContribution).to(EditorVariableContribution).inSingletonScope();

[CommandContribution, KeybindingContribution, QuickOpenContribution].forEach(serviceIdentifier => {
bind(serviceIdentifier).toService(EditorContribution);
});
for (const identifier of [CommandContribution, KeybindingContribution, QuickOpenContribution]) {
bind(identifier).toService(EditorContribution);
}
bind(EditorQuickOpenService).toSelf().inSingletonScope();

bind(CurrentEditorAccess).toSelf().inSingletonScope();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ export default new ContainerModule((bind: interfaces.Bind) => {
}).inSingletonScope();

bind(QuickFileOpenFrontendContribution).toSelf().inSingletonScope();
[CommandContribution, KeybindingContribution, QuickOpenContribution].forEach(serviceIdentifier =>
bind(serviceIdentifier).toService(QuickFileOpenFrontendContribution)
);
for (const identifier of [CommandContribution, KeybindingContribution, QuickOpenContribution]) {
bind(identifier).toService(QuickFileOpenFrontendContribution);
}

bind(QuickFileOpenService).toSelf().inSingletonScope();
});
6 changes: 3 additions & 3 deletions packages/preview/src/browser/preview-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default new ContainerModule(bind => {
})).inSingletonScope();

bind(PreviewContribution).toSelf().inSingletonScope();
[CommandContribution, MenuContribution, OpenHandler, FrontendApplicationContribution, TabBarToolbarContribution].forEach(serviceIdentifier =>
bind(serviceIdentifier).toService(PreviewContribution)
);
for (const identifier of [CommandContribution, MenuContribution, OpenHandler, FrontendApplicationContribution, TabBarToolbarContribution]) {
bind(identifier).toService(PreviewContribution);
}
});