Skip to content

Commit 41ae5a4

Browse files
committed
Create new "remoteQueries" setting
1 parent 0493e31 commit 41ae5a4

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@
241241
"scope": "application",
242242
"description": "Specifies whether or not to write telemetry events to the extension log."
243243
},
244-
"codeQL.remoteRepositoryLists": {
244+
"codeQL.remoteQueries.repositoryLists": {
245245
"type": [
246246
"object",
247247
null

extensions/ql-vscode/src/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,14 +298,17 @@ export function isCanary() {
298298
*/
299299
export const NO_CACHE_AST_VIEWER = new Setting('disableCache', AST_VIEWER_SETTING);
300300

301+
// Settings for remote queries
302+
const REMOTE_QUERIES_SETTING = new Setting('remoteQueries', ROOT_SETTING);
303+
301304
/**
302305
* Lists of GitHub repositories that you want to query remotely via the "Run Remote query" command.
303306
* Note: This command is only available for internal users.
304307
*
305308
* This setting should be a JSON object where each key is a user-specified name (string),
306309
* and the value is an array of GitHub repositories (of the form `<owner>/<repo>`).
307310
*/
308-
const REMOTE_REPO_LISTS = new Setting('remoteRepositoryLists', ROOT_SETTING);
311+
const REMOTE_REPO_LISTS = new Setting('repositoryLists', REMOTE_QUERIES_SETTING);
309312

310313
export function getRemoteRepositoryLists(): Record<string, string[]> | undefined {
311314
return REMOTE_REPO_LISTS.getValue<Record<string, string[]>>() || undefined;

extensions/ql-vscode/src/run-remote-query.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export async function getRepositories(): Promise<string[] | undefined> {
3535
const quickpick = await window.showQuickPick<RepoListQuickPickItem>(
3636
quickPickItems,
3737
{
38-
placeHolder: 'Select a repository list. You can define repository lists in the `codeQL.remoteRepositoryLists` setting.',
38+
placeHolder: 'Select a repository list. You can define repository lists in the `codeQL.remoteQueries.repositoryLists` setting.',
3939
ignoreFocusOut: true,
4040
});
4141
if (quickpick?.repoList.length) {
@@ -56,7 +56,7 @@ export async function getRepositories(): Promise<string[] | undefined> {
5656
const remoteRepo = await window.showInputBox({
5757
title: 'Enter a GitHub repository in the format <owner>/<repo> (e.g. github/codeql)',
5858
placeHolder: '<owner>/<repo>',
59-
prompt: 'Tip: you can save frequently used repositories in the `codeql.remoteRepositoryLists` setting',
59+
prompt: 'Tip: you can save frequently used repositories in the `codeQL.remoteQueries.repositoryLists` setting',
6060
ignoreFocusOut: true,
6161
});
6262
if (!remoteRepo) {
@@ -85,7 +85,7 @@ export async function runRemoteQuery(cliServer: cli.CodeQLCliServer, credentials
8585
let repositories: string[] | undefined;
8686

8787
// If the user has an explicit `.repositories` file, use that.
88-
// Otherwise, prompt user to select repositories from the `codeQL.remoteRepositoryLists` setting.
88+
// Otherwise, prompt user to select repositories from the `codeQL.remoteQueries.repositoryLists` setting.
8989
if (await fs.pathExists(repositoriesFile)) {
9090
void logger.log(`Found '${repositoriesFile}'. Using information from that file to run ${queryFile}.`);
9191

0 commit comments

Comments
 (0)