Skip to content

Commit 71f22b9

Browse files
committed
Move codeQL.chooseDatabaseArchive command
1 parent 32b6ad5 commit 71f22b9

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export type QueryHistoryCommands = {
6565
export type LocalDatabasesCommands = {
6666
// Command palette commands
6767
"codeQL.chooseDatabaseFolder": () => Promise<void>;
68+
"codeQL.chooseDatabaseArchive": () => Promise<void>;
6869
"codeQL.upgradeCurrentDatabase": () => Promise<void>;
6970
"codeQL.clearCache": () => Promise<void>;
7071

extensions/ql-vscode/src/extension.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,16 +1220,6 @@ async function activateWithInstalledDistribution(
12201220
),
12211221
);
12221222

1223-
ctx.subscriptions.push(
1224-
commandRunnerWithProgress(
1225-
"codeQL.chooseDatabaseArchive",
1226-
(progress: ProgressCallback, token: CancellationToken) =>
1227-
databaseUI.chooseDatabaseArchive(progress, token),
1228-
{
1229-
title: "Choose a Database from an Archive",
1230-
},
1231-
),
1232-
);
12331223
ctx.subscriptions.push(
12341224
commandRunnerWithProgress(
12351225
"codeQL.chooseDatabaseGithub",

extensions/ql-vscode/src/local-databases-ui.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ export class DatabaseUI extends DisposableObject {
210210
return {
211211
"codeQL.chooseDatabaseFolder":
212212
this.handleChooseDatabaseFolderFromPalette.bind(this),
213+
"codeQL.chooseDatabaseArchive":
214+
this.handleChooseDatabaseArchiveFromPalette.bind(this),
213215
"codeQL.setCurrentDatabase": this.handleSetCurrentDatabase.bind(this),
214216
"codeQL.setDefaultTourDatabase":
215217
this.handleSetDefaultTourDatabase.bind(this),
@@ -431,6 +433,17 @@ export class DatabaseUI extends DisposableObject {
431433
);
432434
}
433435

436+
private async handleChooseDatabaseArchiveFromPalette(): Promise<void> {
437+
return withProgress(
438+
async (progress, token) => {
439+
await this.chooseDatabaseArchive(progress, token);
440+
},
441+
{
442+
title: "Choose a Database from an Archive",
443+
},
444+
);
445+
}
446+
434447
public async chooseDatabaseInternet(
435448
progress: ProgressCallback,
436449
token: CancellationToken,

0 commit comments

Comments
 (0)