Rename exportSelectedRemoteQueryResults
This commit is contained in:
@@ -108,7 +108,7 @@ import {
|
||||
} from "./packaging";
|
||||
import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider";
|
||||
import {
|
||||
exportSelectedRemoteQueryResults,
|
||||
exportSelectedVariantAnalysisResults,
|
||||
exportVariantAnalysisResults,
|
||||
} from "./remote-queries/export-results";
|
||||
import { EvalLogViewer } from "./eval-log-viewer";
|
||||
@@ -1176,7 +1176,7 @@ async function activateWithInstalledDistribution(
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner("codeQL.exportSelectedVariantAnalysisResults", async () => {
|
||||
await exportSelectedRemoteQueryResults(qhm);
|
||||
await exportSelectedVariantAnalysisResults(qhm);
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import {
|
||||
} from "./markdown-generation";
|
||||
import { pluralize } from "../pure/word";
|
||||
import { VariantAnalysisManager } from "./variant-analysis-manager";
|
||||
import { assertNever } from "../pure/helpers-pure";
|
||||
import {
|
||||
VariantAnalysis,
|
||||
VariantAnalysisScannedRepository,
|
||||
@@ -37,24 +36,20 @@ import { Credentials } from "../common/authentication";
|
||||
/**
|
||||
* Exports the results of the currently-selected remote query or variant analysis.
|
||||
*/
|
||||
export async function exportSelectedRemoteQueryResults(
|
||||
export async function exportSelectedVariantAnalysisResults(
|
||||
queryHistoryManager: QueryHistoryManager,
|
||||
): Promise<void> {
|
||||
const queryHistoryItem = queryHistoryManager.getCurrentQueryHistoryItem();
|
||||
if (!queryHistoryItem || queryHistoryItem.t === "local") {
|
||||
if (!queryHistoryItem || queryHistoryItem.t !== "variant-analysis") {
|
||||
throw new Error(
|
||||
"No variant analysis results currently open. To open results, click an item in the query history view.",
|
||||
);
|
||||
}
|
||||
|
||||
if (queryHistoryItem.t === "variant-analysis") {
|
||||
return commands.executeCommand(
|
||||
"codeQL.exportVariantAnalysisResults",
|
||||
queryHistoryItem.variantAnalysis.id,
|
||||
);
|
||||
} else {
|
||||
assertNever(queryHistoryItem);
|
||||
}
|
||||
return commands.executeCommand(
|
||||
"codeQL.exportVariantAnalysisResults",
|
||||
queryHistoryItem.variantAnalysis.id,
|
||||
);
|
||||
}
|
||||
|
||||
const MAX_VARIANT_ANALYSIS_EXPORT_PROGRESS_STEPS = 2;
|
||||
|
||||
Reference in New Issue
Block a user