Allow multiple file URIs to be passed into prepareRemoteQueryRun (#3241)
This commit is contained in:
Родитель
f993258a27
Коммит
318136f5e5
|
@ -274,11 +274,19 @@ interface PreparedRemoteQuery {
|
|||
export async function prepareRemoteQueryRun(
|
||||
cliServer: CodeQLCliServer,
|
||||
credentials: Credentials,
|
||||
uri: Uri,
|
||||
uris: Uri[],
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
dbManager: DbManager,
|
||||
): Promise<PreparedRemoteQuery> {
|
||||
if (uris.length !== 1) {
|
||||
// For now we only support a single file, but we're aiming
|
||||
// to support multiple files in the near future.
|
||||
throw Error("Exactly one query file must be selected.");
|
||||
}
|
||||
|
||||
const uri = uris[0];
|
||||
|
||||
if (!uri.fsPath.endsWith(".ql")) {
|
||||
throw new UserCancellationException("Not a CodeQL query file.");
|
||||
}
|
||||
|
|
|
@ -220,7 +220,7 @@ export class VariantAnalysisManager
|
|||
private async runVariantAnalysisCommand(uri: Uri): Promise<void> {
|
||||
return withProgress(
|
||||
async (progress, token) => {
|
||||
await this.runVariantAnalysis(uri, progress, token);
|
||||
await this.runVariantAnalysis([uri], progress, token);
|
||||
},
|
||||
{
|
||||
title: "Run Variant Analysis",
|
||||
|
@ -230,7 +230,7 @@ export class VariantAnalysisManager
|
|||
}
|
||||
|
||||
public async runVariantAnalysis(
|
||||
uri: Uri,
|
||||
uris: Uri[],
|
||||
progress: ProgressCallback,
|
||||
token: CancellationToken,
|
||||
): Promise<void> {
|
||||
|
@ -254,7 +254,7 @@ export class VariantAnalysisManager
|
|||
} = await prepareRemoteQueryRun(
|
||||
this.cliServer,
|
||||
this.app.credentials,
|
||||
uri,
|
||||
uris,
|
||||
progress,
|
||||
token,
|
||||
this.dbManager,
|
||||
|
|
|
@ -100,7 +100,7 @@ describe("Variant Analysis Manager", () => {
|
|||
const fileUri = getFile("data-remote-qlpack/in-pack.ql");
|
||||
|
||||
await variantAnalysisManager.runVariantAnalysis(
|
||||
fileUri,
|
||||
[fileUri],
|
||||
progress,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
@ -121,7 +121,7 @@ describe("Variant Analysis Manager", () => {
|
|||
const fileUri = getFile("data-remote-no-qlpack/in-pack.ql");
|
||||
|
||||
await variantAnalysisManager.runVariantAnalysis(
|
||||
fileUri,
|
||||
[fileUri],
|
||||
progress,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
@ -142,7 +142,7 @@ describe("Variant Analysis Manager", () => {
|
|||
const fileUri = getFile("data-remote-qlpack-nested/subfolder/in-pack.ql");
|
||||
|
||||
await variantAnalysisManager.runVariantAnalysis(
|
||||
fileUri,
|
||||
[fileUri],
|
||||
progress,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
@ -163,7 +163,7 @@ describe("Variant Analysis Manager", () => {
|
|||
const fileUri = getFile("data-remote-no-qlpack/in-pack.ql");
|
||||
|
||||
const promise = variantAnalysisManager.runVariantAnalysis(
|
||||
fileUri,
|
||||
[fileUri],
|
||||
progress,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
@ -313,7 +313,7 @@ describe("Variant Analysis Manager", () => {
|
|||
}) {
|
||||
const fileUri = getFile(queryPath);
|
||||
await variantAnalysisManager.runVariantAnalysis(
|
||||
fileUri,
|
||||
[fileUri],
|
||||
progress,
|
||||
cancellationTokenSource.token,
|
||||
);
|
||||
|
|
Загрузка…
Ссылка в новой задаче