11import { CancellationError , QuickPickItem } from 'vscode' ;
22import { adaExtState } from './extension' ;
33import { InputFlowAction , MultiStepInput } from './multiStepInput' ;
4+ import assert from 'assert' ;
45
56interface SPARKOption extends QuickPickItem {
67 cliArgs : string [ ] ;
@@ -14,7 +15,9 @@ const proofLevels: SPARKOption[] = [
1415 { label : '4' , description : 'Slowest, most provers' } ,
1516] . map ( ( v ) => ( { ...v , cliArgs : [ `--level=${ v . label } ` ] } ) ) ;
1617
17- const defaultProofLevel = proofLevels . find ( ( v ) => v . description ?. includes ( 'default' ) ) ! ;
18+ const tmpDefaultProofLevel = proofLevels . find ( ( v ) => v . description ?. includes ( 'default' ) ) ;
19+ assert ( tmpDefaultProofLevel , 'defaultProofLevel should not be null' ) ;
20+ const defaultProofLevel : SPARKOption = tmpDefaultProofLevel ;
1821
1922const options : SPARKOption [ ] = [
2023 { label : 'Multiprocessing' , cliArgs : [ '-j0' ] } ,
@@ -76,7 +79,7 @@ const WS_STATE_KEY_PICKER = 'ada.spark.lastPickerState';
7679 */
7780export async function askSPARKOptions ( ) : Promise < string [ ] > {
7881 const title = 'Select GNATprove Options' ;
79- async function pickProofLevel ( input : MultiStepInput , state : Partial < PickerState > ) {
82+ async function pickProofLevel ( input : MultiStepInput , state : PickerState ) {
8083 const choice : SPARKOption = await input . showQuickPick ( {
8184 title,
8285 step : 1 ,
@@ -89,7 +92,7 @@ export async function askSPARKOptions(): Promise<string[]> {
8992 return ( input : MultiStepInput ) => pickOtherOptions ( input , state ) ;
9093 }
9194
92- async function pickOtherOptions ( input : MultiStepInput , state : Partial < PickerState > ) {
95+ async function pickOtherOptions ( input : MultiStepInput , state : PickerState ) {
9396 const choice : SPARKOption [ ] = await input . showQuickPick ( {
9497 title,
9598 step : 2 ,
@@ -137,7 +140,7 @@ function getSavedPickerState() {
137140 return pickerState ;
138141}
139142
140- function toCLIArgs ( choices : Partial < PickerState > ) : string [ ] {
143+ function toCLIArgs ( choices : PickerState ) : string [ ] {
141144 const args : string [ ] = [ ] ;
142145
143146 if ( choices . proofLevel ) {
0 commit comments