Skip to content

Commit 2b92a3d

Browse files
Merge branch 'main' into collectionItemScopeProvider
2 parents d9c1937 + a8613a9 commit 2b92a3d

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

packages/cursorless-engine/src/core/commandRunner/CommandRunnerImpl.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ export class CommandRunnerImpl implements CommandRunner {
211211

212212
default: {
213213
const action = this.actions[actionDescriptor.name];
214+
215+
// Ensure we don't miss any new actions. Needed because we don't have input validation.
216+
// FIXME: remove once we have schema validation (#983)
217+
if (action == null) {
218+
throw new Error(`Unknown action: ${actionDescriptor.name}`);
219+
}
220+
214221
this.finalStages = action.getFinalStages?.() ?? [];
215222
this.noAutomaticTokenExpansion =
216223
action.noAutomaticTokenExpansion ?? false;

packages/cursorless-engine/src/processTargets/MarkStageFactoryImpl.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ export class MarkStageFactoryImpl implements MarkStageFactory {
4747
return new TargetMarkStage(this.targetPipelineRunner, mark);
4848
case "explicit":
4949
return new ExplicitMarkStage(mark);
50+
default: {
51+
// Ensure we don't miss any new marks. Needed because we don't have input validation.
52+
// FIXME: remove once we have schema validation (#983)
53+
const _exhaustiveCheck: never = mark;
54+
const { type } = mark;
55+
throw new Error(`Unknown mark: ${type}`);
56+
}
5057
}
5158
}
5259
}

packages/cursorless-engine/src/processTargets/ModifierStageFactoryImpl.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory {
108108
throw Error(
109109
`Unexpected modifier '${modifier.type}'; it should have been removed during inference`,
110110
);
111+
default: {
112+
// Ensure we don't miss any new modifiers. Needed because we don't have input validation.
113+
// FIXME: remove once we have schema validation (#983)
114+
const _exhaustiveCheck: never = modifier;
115+
const { type } = modifier;
116+
throw new Error(`Unknown modifier: ${type}`);
117+
}
111118
}
112119
}
113120

0 commit comments

Comments
 (0)