From f82baae4b946fa8fa0ef831912851d8e44b8ede6 Mon Sep 17 00:00:00 2001 From: Tobias Ortmayr Date: Thu, 21 Nov 2024 10:01:17 +0100 Subject: [PATCH] Adjust binding for `CommandActionHandlerInitializer` (#473) Make is easier to customize/rebind the `CommmandActionHandlerInitializer` by binding to itself before binding it as IActionHandlerInitializer. (All other multiinjected keys already follow this pattern. See https://github.com/eclipse-sprotty/sprotty/issues/239) --- packages/sprotty/src/base/di.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/sprotty/src/base/di.config.ts b/packages/sprotty/src/base/di.config.ts index 0f8f436..9aa6ac8 100644 --- a/packages/sprotty/src/base/di.config.ts +++ b/packages/sprotty/src/base/di.config.ts @@ -71,7 +71,8 @@ const defaultContainerModule = new ContainerModule((bind, _unbind, isBound) => { bind(TYPES.IDiagramLocker).to(DefaultDiagramLocker).inSingletonScope(); // Action handler - bind(TYPES.IActionHandlerInitializer).to(CommandActionHandlerInitializer); + bind(CommandActionHandlerInitializer).toSelf().inSingletonScope(); + bind(TYPES.IActionHandlerInitializer).toService(CommandActionHandlerInitializer); // Command Stack --------------------------------------------- bind(TYPES.ICommandStack).to(CommandStack).inSingletonScope();