From 8ce265e4174a5b2de4d593f1fc406ff28906c6bb Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Wed, 1 Apr 2026 00:26:51 -0700 Subject: [PATCH] migrate Effect.fn in apps/server/src/keybindings.ts Co-authored-by: codex --- apps/server/src/keybindings.ts | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/apps/server/src/keybindings.ts b/apps/server/src/keybindings.ts index 086d795c0c..538d80e9e8 100644 --- a/apps/server/src/keybindings.ts +++ b/apps/server/src/keybindings.ts @@ -328,24 +328,23 @@ export const ResolvedKeybindingFromConfig = KeybindingRule.pipe( Effect.map((resolved) => resolved), ), - encode: (resolved) => - Effect.gen(function* () { - const key = encodeShortcut(resolved.shortcut); - if (!key) { - return yield* Effect.fail( - new SchemaIssue.InvalidValue(Option.some(resolved), { - title: "Resolved shortcut cannot be encoded to key string", - }), - ); - } + encode: Effect.fn("ResolvedKeybindingFromConfig.encode")(function* (resolved) { + const key = encodeShortcut(resolved.shortcut); + if (!key) { + return yield* Effect.fail( + new SchemaIssue.InvalidValue(Option.some(resolved), { + title: "Resolved shortcut cannot be encoded to key string", + }), + ); + } - const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined; - return { - key, - command: resolved.command, - when, - }; - }), + const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined; + return { + key, + command: resolved.command, + when, + }; + }), }), ), ); @@ -581,8 +580,9 @@ const makeKeybindings = Effect.gen(function* () { ), ); - return yield* Effect.forEach(rawConfig, (entry) => - Effect.gen(function* () { + return yield* Effect.forEach( + rawConfig, + Effect.fn("loadWritableCustomKeybindingsConfig.decodeEntry")(function* (entry) { const decodedRule = Schema.decodeUnknownExit(KeybindingRule)(entry); if (decodedRule._tag === "Failure") { yield* Effect.logWarning("ignoring invalid keybinding entry", {