File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
packages/cursorless-engine/src Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,13 @@ export class CommandRunnerImpl implements CommandRunner {
211
211
212
212
default : {
213
213
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
+
214
221
this . finalStages = action . getFinalStages ?.( ) ?? [ ] ;
215
222
this . noAutomaticTokenExpansion =
216
223
action . noAutomaticTokenExpansion ?? false ;
Original file line number Diff line number Diff line change @@ -47,6 +47,13 @@ export class MarkStageFactoryImpl implements MarkStageFactory {
47
47
return new TargetMarkStage ( this . targetPipelineRunner , mark ) ;
48
48
case "explicit" :
49
49
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
+ }
50
57
}
51
58
}
52
59
}
Original file line number Diff line number Diff line change @@ -109,6 +109,13 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory {
109
109
throw Error (
110
110
`Unexpected modifier '${ modifier . type } '; it should have been removed during inference` ,
111
111
) ;
112
+ default : {
113
+ // Ensure we don't miss any new modifiers. Needed because we don't have input validation.
114
+ // FIXME: remove once we have schema validation (#983)
115
+ const _exhaustiveCheck : never = modifier ;
116
+ const { type } = modifier ;
117
+ throw new Error ( `Unknown modifier: ${ type } ` ) ;
118
+ }
112
119
}
113
120
}
114
121
You can’t perform that action at this time.
0 commit comments