Move codeQL.chooseDatabaseArchive command

This commit is contained in:
Koen Vlaswinkel
2023-03-21 14:45:54 +01:00
parent 32b6ad53cf
commit 71f22b9a7a
3 changed files with 14 additions and 10 deletions

View File

@@ -65,6 +65,7 @@ export type QueryHistoryCommands = {
export type LocalDatabasesCommands = {
// Command palette commands
"codeQL.chooseDatabaseFolder": () => Promise<void>;
"codeQL.chooseDatabaseArchive": () => Promise<void>;
"codeQL.upgradeCurrentDatabase": () => Promise<void>;
"codeQL.clearCache": () => Promise<void>;

View File

@@ -1220,16 +1220,6 @@ async function activateWithInstalledDistribution(
),
);
ctx.subscriptions.push(
commandRunnerWithProgress(
"codeQL.chooseDatabaseArchive",
(progress: ProgressCallback, token: CancellationToken) =>
databaseUI.chooseDatabaseArchive(progress, token),
{
title: "Choose a Database from an Archive",
},
),
);
ctx.subscriptions.push(
commandRunnerWithProgress(
"codeQL.chooseDatabaseGithub",

View File

@@ -210,6 +210,8 @@ export class DatabaseUI extends DisposableObject {
return {
"codeQL.chooseDatabaseFolder":
this.handleChooseDatabaseFolderFromPalette.bind(this),
"codeQL.chooseDatabaseArchive":
this.handleChooseDatabaseArchiveFromPalette.bind(this),
"codeQL.setCurrentDatabase": this.handleSetCurrentDatabase.bind(this),
"codeQL.setDefaultTourDatabase":
this.handleSetDefaultTourDatabase.bind(this),
@@ -431,6 +433,17 @@ export class DatabaseUI extends DisposableObject {
);
}
private async handleChooseDatabaseArchiveFromPalette(): Promise<void> {
return withProgress(
async (progress, token) => {
await this.chooseDatabaseArchive(progress, token);
},
{
title: "Choose a Database from an Archive",
},
);
}
public async chooseDatabaseInternet(
progress: ProgressCallback,
token: CancellationToken,