Skip to content

Commit ae320d0

Browse files
committed
Set up new config setting for auto generating QL packs
In the next commit we will write to this setting when the user chooses to disable the QL pack generation and prefers to never be asked again about it.
1 parent 3eef0e9 commit ae320d0

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

extensions/ql-vscode/package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@
346346
"default": "",
347347
"patternErrorMessage": "Please enter a valid folder",
348348
"markdownDescription": "The name of the folder where we want to create queries and query packs via the \"CodeQL: Create Query\" command. The folder should exist."
349+
},
350+
"codeQL.autogenerateQlPacks": {
351+
"type": "string",
352+
"default": "",
353+
"patternErrorMessage": "Please choose between 'Yes', 'No' and 'No, and never ask me again'",
354+
"markdownDescription": "The choice of whether to autogenerate QL packs for the current workspace. The choice is 'Yes', 'No' or 'No, and never ask me again'."
349355
}
350356
}
351357
},

extensions/ql-vscode/src/config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,3 +635,16 @@ export function getSkeletonWizardFolder(): string | undefined {
635635
export async function setSkeletonWizardFolder(folder: string | undefined) {
636636
await SKELETON_WIZARD_FOLDER.updateValue(folder, ConfigurationTarget.Global);
637637
}
638+
639+
/**
640+
* Option to turn on/off ability to autogenerate QL packs. Values are "Yes" / "No" / "Never ask again"
641+
**/
642+
const AUTOGENERATE_QL_PACKS = new Setting("autogenerateQlPacks", ROOT_SETTING);
643+
644+
export function getAutogenerateQlPacks(): string | undefined {
645+
return AUTOGENERATE_QL_PACKS.getValue<string>() || undefined;
646+
}
647+
648+
export async function setAutogenerateQlPacks(choice: string | undefined) {
649+
await AUTOGENERATE_QL_PACKS.updateValue(choice, ConfigurationTarget.Global);
650+
}

0 commit comments

Comments
 (0)