Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

keybindings.test.ts

605 lines22.7 KB

1import { KeybindingCommand, KeybindingRule, KeybindingsConfig } from "@t3tools/contracts";
2import * as NodeServices from "@effect/platform-node/NodeServices";
3import { assert, it } from "@effect/vitest";
4import { assertFailure } from "@effect/vitest/utils";
5import * as Cause from "effect/Cause";
6import * as Effect from "effect/Effect";
7import * as FileSystem from "effect/FileSystem";
8import * as Layer from "effect/Layer";
9import * as Logger from "effect/Logger";
10import * as Path from "effect/Path";
11import * as Schema from "effect/Schema";
12import * as ServerConfig from "./config.ts";
13import * as Keybindings from "./keybindings.ts";
14import { KeybindingsConfigError } from "@t3tools/contracts";
15​
16const KeybindingsConfigJson = Schema.fromJsonString(KeybindingsConfig);
17const encodeKeybindingsConfigJson = Schema.encodeEffect(KeybindingsConfigJson);
18const decodeKeybindingsConfigJson = Schema.decodeUnknownEffect(KeybindingsConfigJson);
19const encodeResolvedKeybindingFromConfig = Schema.encodeEffect(
20 Keybindings.ResolvedKeybindingFromConfig,
21);
22const decodeResolvedKeybindingFromConfigExit = Schema.decodeUnknownExit(
23 Keybindings.ResolvedKeybindingFromConfig,
24);
25const makeKeybindingsLayer = () => {
26 return Keybindings.layer.pipe(
27 Layer.provideMerge(
28 Layer.fresh(
29 ServerConfig.layerTest(process.cwd(), {
30 prefix: "t3code-keybindings-test-",
31 }),
32 ),
33 ),
34 );
35};
36​
37const toDetailResult = <A, R>(effect: Effect.Effect<A, KeybindingsConfigError, R>) =>
38 effect.pipe(
39 Effect.mapError((error) => error.detail),
40 Effect.result,
41 );
42​
43const writeKeybindingsConfig = (configPath: string, rules: readonly KeybindingRule[]) =>
44 Effect.gen(function* () {
45 const fileSystem = yield* FileSystem.FileSystem;
46 const path = yield* Path.Path;
47 const encoded = yield* encodeKeybindingsConfigJson(rules);
48 yield* fileSystem.makeDirectory(path.dirname(configPath), { recursive: true });
49 yield* fileSystem.writeFileString(configPath, encoded);
50 });
51​
52const readKeybindingsConfig = (configPath: string) =>
53 Effect.gen(function* () {
54 const fileSystem = yield* FileSystem.FileSystem;
55 const rawConfig = yield* fileSystem.readFileString(configPath);
56 return yield* decodeKeybindingsConfigJson(rawConfig);
57 });
58​
59it.layer(NodeServices.layer)("keybindings", (it) => {
60 it.effect("parses shortcuts including plus key", () =>
61 Effect.sync(() => {
62 assert.deepEqual(Keybindings.parseKeybindingShortcut("mod+j"), {
63 key: "j",
64 metaKey: false,
65 ctrlKey: false,
66 shiftKey: false,
67 altKey: false,
68 modKey: true,
69 });
70 assert.deepEqual(Keybindings.parseKeybindingShortcut("mod++"), {
71 key: "+",
72 metaKey: false,
73 ctrlKey: false,
74 shiftKey: false,
75 altKey: false,
76 modKey: true,
77 });
78 }),
79 );
80​
81 it.effect("compiles valid rule with parsed when AST", () =>
82 Effect.sync(() => {
83 const compiled = Keybindings.compileResolvedKeybindingRule({
84 key: "mod+d",
85 command: "terminal.split",
86 when: "terminalOpen && !terminalFocus",
87 });
88​
89 assert.deepEqual(compiled, {
90 command: "terminal.split",
91 shortcut: {
92 key: "d",
93 metaKey: false,
94 ctrlKey: false,
95 shiftKey: false,
96 altKey: false,
97 modKey: true,
98 },
99 whenAst: {
100 type: "and",
101 left: { type: "identifier", name: "terminalOpen" },
102 right: {
103 type: "not",
104 node: { type: "identifier", name: "terminalFocus" },
105 },
106 },
107 });
108 }),
109 );
110​
111 it.effect("encodes resolved plus-key shortcuts", () =>
112 Effect.gen(function* () {
113 const encoded = yield* encodeResolvedKeybindingFromConfig({
114 command: "terminal.toggle",
115 shortcut: {
116 key: "+",
117 metaKey: false,
118 ctrlKey: false,
119 shiftKey: false,
120 altKey: false,
121 modKey: true,
122 },
123 });
124​
125 assert.equal(encoded.key, "mod++");
126 assert.equal(encoded.command, "terminal.toggle");
127 }),
128 );
129​
130 it.effect("rejects invalid rules", () =>
131 Effect.sync(() => {
132 assert.isNull(
133 Keybindings.compileResolvedKeybindingRule({
134 key: "mod+shift+d+o",
135 command: "terminal.new",
136 }),
137 );
138​
139 assert.isNull(
140 Keybindings.compileResolvedKeybindingRule({
141 key: "mod+d",
142 command: "terminal.split",
143 when: "terminalFocus && (",
144 }),
145 );
146​
147 assert.isNull(
148 Keybindings.compileResolvedKeybindingRule({
149 key: "mod+d",
150 command: "terminal.split",
151 when: `${"!".repeat(300)}terminalFocus`,
152 }),
153 );
154 }),
155 );
156​
157 it.effect("formats invalid resolved keybinding rules with the custom message", () =>
158 Effect.sync(() => {
159 const result = decodeResolvedKeybindingFromConfigExit({
160 key: "mod+shift+d+o",
161 command: "terminal.new",
162 });
163​
164 if (result._tag !== "Failure") {
165 assert.fail("Expected invalid keybinding decode to fail");
166 }
167​
168 const detail = Cause.pretty(result.cause);
169 assert.isTrue(detail.includes("Invalid keybinding rule"));
170 assert.isFalse(detail.includes("Invalid data"));
171 }),
172 );
173​
174 it.effect("bootstraps default keybindings when config file is missing", () =>
175 Effect.gen(function* () {
176 const fs = yield* FileSystem.FileSystem;
177 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
178 assert.isFalse(yield* fs.exists(keybindingsConfigPath));
179​
180 yield* Effect.gen(function* () {
181 const keybindings = yield* Keybindings.Keybindings;
182 yield* keybindings.syncDefaultKeybindingsOnStartup;
183 });
184​
185 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
186 assert.deepEqual(persisted, Keybindings.DEFAULT_KEYBINDINGS);
187 }).pipe(Effect.provide(makeKeybindingsLayer())),
188 );
189​
190 it.effect("ships configurable thread navigation defaults", () =>
191 Effect.sync(() => {
192 const defaultsByCommand = new Map(
193 Keybindings.DEFAULT_KEYBINDINGS.map((binding) => [binding.command, binding.key] as const),
194 );
195​
196 assert.equal(defaultsByCommand.get("thread.previous"), "mod+shift+[");
197 assert.equal(defaultsByCommand.get("thread.next"), "mod+shift+]");
198 assert.equal(defaultsByCommand.get("thread.jump.1"), "mod+1");
199 assert.equal(defaultsByCommand.get("thread.jump.9"), "mod+9");
200 assert.equal(defaultsByCommand.get("modelPicker.toggle"), "mod+shift+m");
201 assert.equal(defaultsByCommand.get("filePicker.toggle"), "mod+p");
202 assert.equal(defaultsByCommand.get("projectSearch.toggle"), "mod+shift+f");
203 assert.equal(defaultsByCommand.get("sidebar.toggle"), "mod+b");
204 assert.equal(defaultsByCommand.get("rightPanel.toggle"), "mod+alt+b");
205 assert.equal(defaultsByCommand.get("terminal.splitVertical"), "mod+shift+d");
206 assert.equal(defaultsByCommand.get("modelPicker.jump.1"), "mod+1");
207 assert.equal(defaultsByCommand.get("modelPicker.jump.9"), "mod+9");
208 }),
209 );
210​
211 it.effect("uses defaults in runtime when config is malformed without overriding file", () =>
212 Effect.gen(function* () {
213 const fs = yield* FileSystem.FileSystem;
214 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
215 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
216​
217 const configState = yield* Effect.gen(function* () {
218 const keybindings = yield* Keybindings.Keybindings;
219 return yield* keybindings.loadConfigState;
220 });
221​
222 assert.deepEqual(
223 configState.keybindings,
224 Keybindings.compileResolvedKeybindingsConfig(Keybindings.DEFAULT_KEYBINDINGS),
225 );
226 assert.deepEqual(configState.issues, [
227 {
228 kind: "keybindings.malformed-config",
229 message: configState.issues[0]?.message ?? "",
230 },
231 ]);
232 assert.equal(yield* fs.readFileString(keybindingsConfigPath), "{ not-json");
233 }).pipe(Effect.provide(makeKeybindingsLayer())),
234 );
235​
236 it.effect("ignores invalid entries in runtime and reports them as issues", () =>
237 Effect.gen(function* () {
238 const fs = yield* FileSystem.FileSystem;
239 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
240 yield* fs.writeFileString(
241 keybindingsConfigPath,
242 // @effect-diagnostics-next-line preferSchemaOverJson:off
243 JSON.stringify([
244 { key: "mod+j", command: "terminal.toggle" },
245 { key: "mod+shift+d+o", command: "terminal.new" },
246 { key: "mod+x", command: "invalid.command" },
247 ]),
248 );
249​
250 const configState = yield* Effect.gen(function* () {
251 const keybindings = yield* Keybindings.Keybindings;
252 return yield* keybindings.loadConfigState;
253 });
254​
255 assert.isTrue(configState.keybindings.some((entry) => entry.command === "terminal.toggle"));
256 assert.isFalse(
257 configState.keybindings.some((entry) => String(entry.command) === "invalid.command"),
258 );
259 assert.deepEqual(configState.issues, [
260 {
261 kind: "keybindings.invalid-entry",
262 index: 1,
263 message: configState.issues[0]?.message ?? "",
264 },
265 {
266 kind: "keybindings.invalid-entry",
267 index: 2,
268 message: configState.issues[1]?.message ?? "",
269 },
270 ]);
271 }).pipe(Effect.provide(makeKeybindingsLayer())),
272 );
273​
274 it.effect(
275 "upserts missing default keybindings on startup without overriding existing command rules",
276 () =>
277 Effect.gen(function* () {
278 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
279 yield* writeKeybindingsConfig(keybindingsConfigPath, [
280 { key: "mod+shift+t", command: "terminal.toggle" },
281 { key: "mod+shift+r", command: "script.run-tests.run" },
282 ]);
283​
284 yield* Effect.gen(function* () {
285 const keybindings = yield* Keybindings.Keybindings;
286 yield* keybindings.syncDefaultKeybindingsOnStartup;
287 });
288​
289 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
290 const byCommand = new Map(persisted.map((entry) => [entry.command, entry]));
291​
292 const persistedToggle = byCommand.get("terminal.toggle");
293 assert.isNotNull(persistedToggle);
294 assert.equal(persistedToggle?.key, "mod+shift+t");
295 assert.isFalse(
296 persisted.some((entry) => entry.command === "terminal.toggle" && entry.key === "mod+j"),
297 );
298​
299 for (const defaultRule of Keybindings.DEFAULT_KEYBINDINGS) {
300 assert.isTrue(byCommand.has(defaultRule.command), `expected ${defaultRule.command}`);
301 }
302 assert.isTrue(byCommand.has("script.run-tests.run"));
303 }).pipe(Effect.provide(makeKeybindingsLayer())),
304 );
305​
306 it.effect("skips conflicting default keybindings on startup and logs a detailed warning", () => {
307 const messages: string[] = [];
308 const logger = Logger.make(({ message }) => {
309 messages.push(String(message));
310 });
311​
312 return Effect.gen(function* () {
313 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
314 yield* writeKeybindingsConfig(keybindingsConfigPath, [
315 { key: "mod+j", command: "script.custom-action.run" },
316 ]);
317​
318 yield* Effect.gen(function* () {
319 const keybindings = yield* Keybindings.Keybindings;
320 yield* keybindings.syncDefaultKeybindingsOnStartup;
321 });
322​
323 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
324 assert.isFalse(persisted.some((entry) => entry.command === "terminal.toggle"));
325 assert.isTrue(persisted.some((entry) => entry.command === "script.custom-action.run"));
326​
327 assert.isTrue(
328 messages.some((message) =>
329 message.includes("skipping default keybinding due to shortcut conflict"),
330 ),
331 );
332 }).pipe(
333 Effect.provide(
334 Layer.mergeAll(
335 makeKeybindingsLayer(),
336 Logger.layer([logger], { mergeWithExisting: false }),
337 ),
338 ),
339 );
340 });
341​
342 it.effect("upserts custom keybindings to configured path", () =>
343 Effect.gen(function* () {
344 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
345 yield* writeKeybindingsConfig(keybindingsConfigPath, [
346 { key: "mod+j", command: "terminal.toggle" },
347 ]);
348​
349 const resolved = yield* Effect.gen(function* () {
350 const keybindings = yield* Keybindings.Keybindings;
351 return yield* keybindings.upsertKeybindingRule({
352 key: "mod+shift+r",
353 command: "script.run-tests.run",
354 });
355 });
356​
357 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
358 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
359​
360 assert.deepEqual(persistedView, [
361 { key: "mod+j", command: "terminal.toggle" },
362 { key: "mod+shift+r", command: "script.run-tests.run" },
363 ]);
364 assert.isTrue(resolved.some((entry) => entry.command === "script.run-tests.run"));
365 }).pipe(Effect.provide(makeKeybindingsLayer())),
366 );
367​
368 it.effect("appends additional custom keybindings for the same command", () =>
369 Effect.gen(function* () {
370 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
371 yield* writeKeybindingsConfig(keybindingsConfigPath, [
372 { key: "mod+r", command: "script.run-tests.run" },
373 ]);
374 yield* Effect.gen(function* () {
375 const keybindings = yield* Keybindings.Keybindings;
376 return yield* keybindings.upsertKeybindingRule({
377 key: "mod+shift+r",
378 command: "script.run-tests.run",
379 });
380 });
381​
382 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
383 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
384 assert.deepEqual(persistedView, [
385 { key: "mod+r", command: "script.run-tests.run" },
386 { key: "mod+shift+r", command: "script.run-tests.run" },
387 ]);
388 }).pipe(Effect.provide(makeKeybindingsLayer())),
389 );
390​
391 it.effect("replaces only the targeted custom keybinding", () =>
392 Effect.gen(function* () {
393 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
394 yield* writeKeybindingsConfig(keybindingsConfigPath, [
395 { key: "mod+r", command: "script.run-tests.run" },
396 { key: "mod+shift+r", command: "script.run-tests.run" },
397 ]);
398 yield* Effect.gen(function* () {
399 const keybindings = yield* Keybindings.Keybindings;
400 return yield* keybindings.upsertKeybindingRule({
401 key: "mod+alt+r",
402 command: "script.run-tests.run",
403 replace: { key: "mod+r", command: "script.run-tests.run" },
404 });
405 });
406​
407 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
408 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
409 assert.deepEqual(persistedView, [
410 { key: "mod+shift+r", command: "script.run-tests.run" },
411 { key: "mod+alt+r", command: "script.run-tests.run" },
412 ]);
413 }).pipe(Effect.provide(makeKeybindingsLayer())),
414 );
415​
416 it.effect("replacing with a rule that already exists elsewhere does not duplicate it", () =>
417 Effect.gen(function* () {
418 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
419 yield* writeKeybindingsConfig(keybindingsConfigPath, [
420 { key: "mod+r", command: "script.run-tests.run" },
421 { key: "mod+alt+r", command: "script.run-tests.run" },
422 ]);
423 yield* Effect.gen(function* () {
424 const keybindings = yield* Keybindings.Keybindings;
425 return yield* keybindings.upsertKeybindingRule({
426 key: "mod+alt+r",
427 command: "script.run-tests.run",
428 replace: { key: "mod+r", command: "script.run-tests.run" },
429 });
430 });
431​
432 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
433 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
434 assert.deepEqual(persistedView, [{ key: "mod+alt+r", command: "script.run-tests.run" }]);
435 }).pipe(Effect.provide(makeKeybindingsLayer())),
436 );
437​
438 it.effect("removes only the targeted custom keybinding", () =>
439 Effect.gen(function* () {
440 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
441 yield* writeKeybindingsConfig(keybindingsConfigPath, [
442 { key: "mod+r", command: "script.run-tests.run" },
443 { key: "mod+shift+r", command: "script.run-tests.run" },
444 ]);
445 yield* Effect.gen(function* () {
446 const keybindings = yield* Keybindings.Keybindings;
447 return yield* keybindings.removeKeybindingRule({
448 key: "mod+r",
449 command: "script.run-tests.run",
450 });
451 });
452​
453 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
454 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
455 assert.deepEqual(persistedView, [{ key: "mod+shift+r", command: "script.run-tests.run" }]);
456 }).pipe(Effect.provide(makeKeybindingsLayer())),
457 );
458​
459 it.effect("refuses to overwrite malformed keybindings config", () =>
460 Effect.gen(function* () {
461 const fs = yield* FileSystem.FileSystem;
462 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
463 yield* fs.writeFileString(keybindingsConfigPath, "{ not-json");
464​
465 const result = yield* Effect.gen(function* () {
466 const keybindings = yield* Keybindings.Keybindings;
467 return yield* keybindings.upsertKeybindingRule({
468 key: "mod+shift+r",
469 command: "script.run-tests.run",
470 });
471 }).pipe(toDetailResult);
472 assertFailure(result, "expected JSON array");
473​
474 const persistedRaw = yield* fs.readFileString(keybindingsConfigPath);
475 assert.equal(persistedRaw, "{ not-json");
476 }).pipe(Effect.provide(makeKeybindingsLayer())),
477 );
478​
479 it.effect("reports non-array config parse errors without duplicate prefix", () =>
480 Effect.gen(function* () {
481 const fs = yield* FileSystem.FileSystem;
482 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
483 yield* fs.writeFileString(
484 keybindingsConfigPath,
485 '{"key":"mod+j","command":"terminal.toggle"}',
486 );
487​
488 const firstResult = yield* Effect.gen(function* () {
489 const keybindings = yield* Keybindings.Keybindings;
490 return yield* keybindings.upsertKeybindingRule({
491 key: "mod+shift+r",
492 command: "script.run-tests.run",
493 });
494 }).pipe(toDetailResult);
495 assertFailure(firstResult, "expected JSON array");
496​
497 const secondResult = yield* Effect.gen(function* () {
498 const keybindings = yield* Keybindings.Keybindings;
499 return yield* keybindings.upsertKeybindingRule({
500 key: "mod+shift+r",
501 command: "script.run-tests.run",
502 });
503 }).pipe(toDetailResult);
504 assertFailure(secondResult, "expected JSON array");
505 }).pipe(Effect.provide(makeKeybindingsLayer())),
506 );
507​
508 it.effect("fails when config directory is not writable", () =>
509 Effect.gen(function* () {
510 const fs = yield* FileSystem.FileSystem;
511 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
512 const { dirname } = yield* Path.Path;
513 yield* writeKeybindingsConfig(keybindingsConfigPath, [
514 { key: "mod+j", command: "terminal.toggle" },
515 ]);
516 yield* fs.chmod(dirname(keybindingsConfigPath), 0o500);
517​
518 const result = yield* Effect.gen(function* () {
519 const keybindings = yield* Keybindings.Keybindings;
520 return yield* keybindings.upsertKeybindingRule({
521 key: "mod+shift+r",
522 command: "script.run-tests.run",
523 });
524 }).pipe(toDetailResult);
525 assertFailure(result, "failed to write keybindings config");
526​
527 yield* fs.chmod(dirname(keybindingsConfigPath), 0o700);
528​
529 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
530 const persistedView = persisted.map(({ key, command }) => ({ key, command }));
531 assert.deepEqual(persistedView, [{ key: "mod+j", command: "terminal.toggle" }]);
532 }).pipe(Effect.provide(makeKeybindingsLayer())),
533 );
534​
535 it.effect("caches loaded resolved config across repeated reads", () =>
536 Effect.gen(function* () {
537 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
538 yield* writeKeybindingsConfig(keybindingsConfigPath, [
539 { key: "mod+j", command: "terminal.toggle" },
540 ]);
541​
542 const [first, second] = yield* Effect.gen(function* () {
543 const keybindings = yield* Keybindings.Keybindings;
544 const firstLoad = (yield* keybindings.loadConfigState).keybindings;
545 const secondLoad = (yield* keybindings.loadConfigState).keybindings;
546 return [firstLoad, secondLoad] as const;
547 });
548​
549 assert.deepEqual(first, second);
550 assert.isTrue(second.some((entry) => entry.command === "terminal.toggle"));
551 }).pipe(Effect.provide(makeKeybindingsLayer())),
552 );
553​
554 it.effect("updates cached resolved config after upsert", () =>
555 Effect.gen(function* () {
556 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
557 yield* writeKeybindingsConfig(keybindingsConfigPath, [
558 { key: "mod+j", command: "terminal.toggle" },
559 ]);
560​
561 const loadedAfterUpsert = yield* Effect.gen(function* () {
562 const keybindings = yield* Keybindings.Keybindings;
563 yield* keybindings.loadConfigState;
564 yield* keybindings.upsertKeybindingRule({
565 key: "mod+shift+r",
566 command: "script.run-tests.run",
567 });
568 return (yield* keybindings.loadConfigState).keybindings;
569 });
570​
571 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "script.run-tests.run"));
572 assert.isTrue(loadedAfterUpsert.some((entry) => entry.command === "terminal.toggle"));
573 }).pipe(Effect.provide(makeKeybindingsLayer())),
574 );
575​
576 it.effect("serializes concurrent upserts to avoid lost updates", () =>
577 Effect.gen(function* () {
578 const { keybindingsConfigPath } = yield* ServerConfig.ServerConfig;
579 yield* writeKeybindingsConfig(keybindingsConfigPath, []);
580​
581 const commands = Array.from(
582 { length: 20 },
583 (_, index): KeybindingCommand => `script.concurrent-${index}.run`,
584 );
585 yield* Effect.gen(function* () {
586 const keybindings = yield* Keybindings.Keybindings;
587 yield* Effect.all(
588 commands.map((command, index) =>
589 keybindings.upsertKeybindingRule({
590 key: `mod+${String.fromCharCode(97 + index)}`,
591 command,
592 }),
593 ),
594 { concurrency: "unbounded", discard: true },
595 );
596 });
597​
598 const persisted = yield* readKeybindingsConfig(keybindingsConfigPath);
599 const persistedCommands = new Set(persisted.map((entry) => entry.command));
600 for (const command of commands) {
601 assert.isTrue(persistedCommands.has(command), `expected persisted command ${command}`);
602 }
603 }).pipe(Effect.provide(makeKeybindingsLayer())),
604 );
605});