From 7e9a4359cd42d98c8f0472846e7b9eae4c3389a5 Mon Sep 17 00:00:00 2001 From: Christoph Brandau Date: Thu, 10 Sep 2026 08:45:25 +0200 Subject: [PATCH] feat(cdl): include args in generated event handler snippet The generated event handler snippet now declares the proc with an args block. This enables parameters to be referenced within the handler body. The change makes the snippet compatible with events that pass arguments. - Include an args block in the proc declaration for event handlers. --- client/src/common/cdlEventHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/common/cdlEventHandler.ts b/client/src/common/cdlEventHandler.ts index cdb7742..b6282c9 100644 --- a/client/src/common/cdlEventHandler.ts +++ b/client/src/common/cdlEventHandler.ts @@ -105,7 +105,7 @@ export function createCdlEventHandlerSnippet(handler: CdlEventHandler): string { const globals = [ ...new Set(handler.parameterNames.map((parameter) => momVariableName(parameter))) ] - const lines = [`proc ${momEventName(handler.eventName)} { } {`] + const lines = [`proc ${momEventName(handler.eventName)} {args} {`] if (globals.length > 0) { lines.push(...globals.map((variable) => ` global ${variable}`), "")