Skip to content

Commit 7adcace

Browse files
committed
Add documentation
1 parent 89adef0 commit 7adcace

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

integration/vscode/ada/src/multiStepInput.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*--------------------------------------------------------------------------------------------*/
1010

1111
/**
12-
* This file is laregely based on the Quick Picker Sample project by Microsoft,
12+
* This file is largely based on the Quick Picker Sample project by Microsoft,
1313
* with some additions and fixes by AdaCore.
1414
*/
1515

integration/vscode/ada/src/sparkOptionsPicker.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,31 @@ interface SavedPickerState {
3939
*/
4040
const WS_STATE_KEY_PICKER = 'ada.spark.lastPickerState';
4141

42+
/**
43+
* Prompts the user to select GNATprove options through a multi-step input dialog.
44+
*
45+
* This function presents a two-step selection process:
46+
* 1. First step: Choose a proof level from available options
47+
* 2. Second step: Select additional SPARK options (multiple selection allowed)
48+
*
49+
* The function preserves user selections in workspace state for future use and
50+
* restores previously saved selections as defaults when the dialog is opened again.
51+
*
52+
* @returns A promise that resolves to an array of CLI arguments representing the selected options
53+
* @throws - {@link CancellationError} When the user cancels the selection process
54+
*
55+
* @example
56+
* ```typescript
57+
* try {
58+
* const sparkArgs = await askSPARKOptions();
59+
* console.log('Selected SPARK options:', sparkArgs);
60+
* } catch (error) {
61+
* if (error instanceof CancellationError) {
62+
* console.log('User cancelled the selection');
63+
* }
64+
* }
65+
* ```
66+
*/
4267
export async function askSPARKOptions(): Promise<string[]> {
4368
const title = 'Select GNATprove Options';
4469
async function pickProofLevel(input: MultiStepInput, state: Partial<PickerState>) {

0 commit comments

Comments
 (0)