Unified · Split
| @@ -328,24 +328,23 @@ export const ResolvedKeybindingFromConfig = KeybindingRule.pipe( · 327 unmodified lines | ||
| 328 | 328 | Effect.map((resolved) => resolved), |
| 329 | 329 | ), |
| 330 | 330 | |
| 331 | − encode: (resolved) => | |
| 332 | − Effect.gen(function* () { | |
| 333 | − const key = encodeShortcut(resolved.shortcut); | |
| 334 | − if (!key) { | |
| 335 | − return yield* Effect.fail( | |
| 336 | − new SchemaIssue.InvalidValue(Option.some(resolved), { | |
| 337 | − title: "Resolved shortcut cannot be encoded to key string", | |
| 338 | − }), | |
| 339 | − ); | |
| 340 | − } | |
| 331 | + encode: Effect.fn("ResolvedKeybindingFromConfig.encode")(function* (resolved) { | |
| 332 | + const key = encodeShortcut(resolved.shortcut); | |
| 333 | + if (!key) { | |
| 334 | + return yield* Effect.fail( | |
| 335 | + new SchemaIssue.InvalidValue(Option.some(resolved), { | |
| 336 | + title: "Resolved shortcut cannot be encoded to key string", | |
| 337 | + }), | |
| 338 | + ); | |
| 339 | + } | |
| 341 | 340 | |
| 342 | − const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined; | |
| 343 | − return { | |
| 344 | − key, | |
| 345 | − command: resolved.command, | |
| 346 | − when, | |
| 347 | − }; | |
| 348 | − }), | |
| 341 | + const when = resolved.whenAst ? encodeWhenAst(resolved.whenAst) : undefined; | |
| 342 | + return { | |
| 343 | + key, | |
| 344 | + command: resolved.command, | |
| 345 | + when, | |
| 346 | + }; | |
| 347 | + }), | |
| 349 | 348 | }), |
| 350 | 349 | ), |
| 351 | 350 | ); |
| @@ -581,8 +580,9 @@ const makeKeybindings = Effect.gen(function* () { · 229 unmodified lines | ||
| 581 | 580 | ), |
| 582 | 581 | ); |
| 583 | 582 | |
| 584 | − return yield* Effect.forEach(rawConfig, (entry) => | |
| 585 | − Effect.gen(function* () { | |
| 583 | + return yield* Effect.forEach( | |
| 584 | + rawConfig, | |
| 585 | + Effect.fn("loadWritableCustomKeybindingsConfig.decodeEntry")(function* (entry) { | |
| 586 | 586 | const decodedRule = Schema.decodeUnknownExit(KeybindingRule)(entry); |
| 587 | 587 | if (decodedRule._tag === "Failure") { |
| 588 | 588 | yield* Effect.logWarning("ignoring invalid keybinding entry", { |