Skip to content

Commit eb15a90

Browse files
committed
Fix code scanning alert about duplicate command usage
1 parent a5d2164 commit eb15a90

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

extensions/ql-vscode/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,10 @@
634634
"title": "Create query",
635635
"icon": "$(new-file)"
636636
},
637+
{
638+
"command": "codeQL.createQueryFromPrompt",
639+
"title": "CodeQL: Create query from prompt"
640+
},
637641
{
638642
"command": "codeQLVariantAnalysisRepositories.openConfigFile",
639643
"title": "Open database configuration file",
@@ -1346,6 +1350,10 @@
13461350
"command": "codeQLQueries.createQuery",
13471351
"when": "false"
13481352
},
1353+
{
1354+
"command": "codeQL.createQueryFromPrompt",
1355+
"when": "false"
1356+
},
13491357
{
13501358
"command": "codeQL.runLocalQueryFromFileTab",
13511359
"when": "false"

extensions/ql-vscode/src/common/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export type LocalQueryCommands = {
146146
"codeQL.quickQuery": () => Promise<void>;
147147
"codeQL.getCurrentQuery": () => Promise<string>;
148148
"codeQL.createQuery": () => Promise<void>;
149+
"codeQL.createQueryFromPrompt": () => Promise<void>;
149150
};
150151

151152
// Debugger commands

extensions/ql-vscode/src/local-queries/local-queries.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export class LocalQueries extends DisposableObject {
119119
return this.getCurrentQuery(true);
120120
},
121121
"codeQL.createQuery": this.createSkeletonQuery.bind(this),
122+
"codeQL.createQueryFromPrompt": this.createSkeletonQuery.bind(this),
122123
};
123124
}
124125

extensions/ql-vscode/src/local-queries/quick-query.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export async function displayQuickQuery(
9696
updateQuickQueryDir(queriesDir, workspaceFolders.length, 0);
9797
}
9898
if (quickQueryPrompt === createQueryOption) {
99-
await app.queryServerCommands.execute("codeQL.createQuery");
99+
await app.queryServerCommands.execute("codeQL.createQueryFromPrompt");
100100
}
101101
return;
102102
}

0 commit comments

Comments
 (0)