Merge pull request #2234 from github/robertbrignull/use_app_commands_4_alt
Convert call sites to use typed commands (part 4): cleanDatabases
This commit is contained in:
@@ -1001,6 +1001,15 @@ export class DatabaseManager extends DisposableObject {
|
||||
});
|
||||
}
|
||||
|
||||
public async removeAllDatabases(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
) {
|
||||
for (const item of this.databaseItems) {
|
||||
await this.removeDatabaseItem(progress, token, item);
|
||||
}
|
||||
}
|
||||
|
||||
private async deregisterDatabase(
|
||||
progress: ProgressCallback,
|
||||
token: vscode.CancellationToken,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { join } from "path";
|
||||
import { load, dump } from "js-yaml";
|
||||
import { realpathSync, readFileSync, writeFileSync } from "fs-extra";
|
||||
import { commands, extensions } from "vscode";
|
||||
import { CancellationToken, extensions } from "vscode";
|
||||
import { DatabaseManager } from "../../src/local-databases";
|
||||
import { CodeQLCliServer } from "../../src/cli";
|
||||
import { removeWorkspaceRefs } from "../../src/variant-analysis/run-remote-query";
|
||||
import { CodeQLExtensionInterface } from "../../src/extension";
|
||||
import { ProgressCallback } from "../../src/progress";
|
||||
|
||||
// This file contains helpers shared between tests that work with an activated extension.
|
||||
|
||||
@@ -37,9 +38,10 @@ export async function getActivatedExtension(): Promise<CodeQLExtensionInterface>
|
||||
}
|
||||
|
||||
export async function cleanDatabases(databaseManager: DatabaseManager) {
|
||||
for (const item of databaseManager.databaseItems) {
|
||||
await commands.executeCommand("codeQLDatabases.removeDatabase", item);
|
||||
}
|
||||
await databaseManager.removeAllDatabases(
|
||||
{} as ProgressCallback,
|
||||
{} as CancellationToken,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user