Skip to content

Commit 32b6ad5

Browse files
committed
Move codeQL.chooseDatabaseFolder command
1 parent ac2f447 commit 32b6ad5

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
@@ -64,6 +64,7 @@ export type QueryHistoryCommands = {
6464
// Commands used for the local databases panel
6565
export type LocalDatabasesCommands = {
6666
// Command palette commands
67+
"codeQL.chooseDatabaseFolder": () => Promise<void>;
6768
"codeQL.upgradeCurrentDatabase": () => Promise<void>;
6869
"codeQL.clearCache": () => Promise<void>;
6970

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.chooseDatabaseFolder",
1226-
(progress: ProgressCallback, token: CancellationToken) =>
1227-
databaseUI.chooseDatabaseFolder(progress, token),
1228-
{
1229-
title: "Choose a Database from a Folder",
1230-
},
1231-
),
1232-
);
12331223
ctx.subscriptions.push(
12341224
commandRunnerWithProgress(
12351225
"codeQL.chooseDatabaseArchive",

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ export class DatabaseUI extends DisposableObject {
208208

209209
public getCommands(): LocalDatabasesCommands {
210210
return {
211+
"codeQL.chooseDatabaseFolder":
212+
this.handleChooseDatabaseFolderFromPalette.bind(this),
211213
"codeQL.setCurrentDatabase": this.handleSetCurrentDatabase.bind(this),
212214
"codeQL.setDefaultTourDatabase":
213215
this.handleSetDefaultTourDatabase.bind(this),
@@ -268,6 +270,17 @@ export class DatabaseUI extends DisposableObject {
268270
);
269271
}
270272

273+
private async handleChooseDatabaseFolderFromPalette(): Promise<void> {
274+
return withProgress(
275+
async (progress, token) => {
276+
await this.chooseDatabaseFolder(progress, token);
277+
},
278+
{
279+
title: "Choose a Database from a Folder",
280+
},
281+
);
282+
}
283+
271284
private async handleSetDefaultTourDatabase(): Promise<void> {
272285
return withProgress(
273286
async (progress, token) => {

0 commit comments

Comments
 (0)