File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
packages/cursorless-engine/src Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,12 @@ 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+ if ( action == null ) {
217+ throw new Error ( `Unknown action: ${ actionDescriptor . name } ` ) ;
218+ }
219+
214220 this . finalStages = action . getFinalStages ?.( ) ?? [ ] ;
215221 this . noAutomaticTokenExpansion =
216222 action . noAutomaticTokenExpansion ?? false ;
Original file line number Diff line number Diff line change @@ -47,6 +47,12 @@ 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+ const _exhaustiveCheck : never = mark ;
53+ const { type } = mark ;
54+ throw new Error ( `Unknown mark: ${ type } ` ) ;
55+ }
5056 }
5157 }
5258}
Original file line number Diff line number Diff line change @@ -109,6 +109,12 @@ export class ModifierStageFactoryImpl implements ModifierStageFactory {
109109 throw Error (
110110 `Unexpected modifier '${ modifier . type } '; it should have been removed during inference` ,
111111 ) ;
112+ default : {
113+ // Ensure we don't miss any new modifiers. Needed because we don't have input validation.
114+ const _exhaustiveCheck : never = modifier ;
115+ const { type } = modifier ;
116+ throw new Error ( `Unknown modifier: ${ type } ` ) ;
117+ }
112118 }
113119 }
114120
You can’t perform that action at this time.
0 commit comments