Move packaging command registration to separate file
This commit is contained in:
@@ -103,10 +103,7 @@ import {
|
|||||||
withProgress,
|
withProgress,
|
||||||
} from "./commandRunner";
|
} from "./commandRunner";
|
||||||
import { CodeQlStatusBarHandler } from "./status-bar";
|
import { CodeQlStatusBarHandler } from "./status-bar";
|
||||||
import {
|
import { registerPackagingCommands } from "./packaging";
|
||||||
handleDownloadPacks,
|
|
||||||
handleInstallPackDependencies,
|
|
||||||
} from "./packaging";
|
|
||||||
import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider";
|
import { HistoryItemLabelProvider } from "./query-history/history-item-label-provider";
|
||||||
import { exportSelectedVariantAnalysisResults } from "./variant-analysis/export-results";
|
import { exportSelectedVariantAnalysisResults } from "./variant-analysis/export-results";
|
||||||
import { EvalLogViewer } from "./eval-log-viewer";
|
import { EvalLogViewer } from "./eval-log-viewer";
|
||||||
@@ -1295,27 +1292,9 @@ async function activateWithInstalledDistribution(
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
registerPackagingCommands(ctx, {
|
||||||
commandRunnerWithProgress(
|
cliServer,
|
||||||
"codeQL.installPackDependencies",
|
});
|
||||||
async (progress: ProgressCallback) =>
|
|
||||||
await handleInstallPackDependencies(cliServer, progress),
|
|
||||||
{
|
|
||||||
title: "Installing pack dependencies",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
|
||||||
commandRunnerWithProgress(
|
|
||||||
"codeQL.downloadPacks",
|
|
||||||
async (progress: ProgressCallback) =>
|
|
||||||
await handleDownloadPacks(cliServer, progress),
|
|
||||||
{
|
|
||||||
title: "Downloading packs",
|
|
||||||
},
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
ctx.subscriptions.push(
|
ctx.subscriptions.push(
|
||||||
commandRunner("codeQL.showLogs", async () => {
|
commandRunner("codeQL.showLogs", async () => {
|
||||||
|
|||||||
@@ -4,13 +4,48 @@ import {
|
|||||||
showAndLogExceptionWithTelemetry,
|
showAndLogExceptionWithTelemetry,
|
||||||
showAndLogInformationMessage,
|
showAndLogInformationMessage,
|
||||||
} from "./helpers";
|
} from "./helpers";
|
||||||
import { QuickPickItem, window } from "vscode";
|
import { ExtensionContext, QuickPickItem, window } from "vscode";
|
||||||
import { ProgressCallback, UserCancellationException } from "./commandRunner";
|
import {
|
||||||
|
commandRunnerWithProgress,
|
||||||
|
ProgressCallback,
|
||||||
|
UserCancellationException,
|
||||||
|
} from "./commandRunner";
|
||||||
import { extLogger } from "./common";
|
import { extLogger } from "./common";
|
||||||
import { asError, getErrorStack } from "./pure/helpers-pure";
|
import { asError, getErrorStack } from "./pure/helpers-pure";
|
||||||
import { redactableError } from "./pure/errors";
|
import { redactableError } from "./pure/errors";
|
||||||
import { PACKS_BY_QUERY_LANGUAGE } from "./common/query-language";
|
import { PACKS_BY_QUERY_LANGUAGE } from "./common/query-language";
|
||||||
|
|
||||||
|
type PackagingOptions = {
|
||||||
|
cliServer: CodeQLCliServer;
|
||||||
|
};
|
||||||
|
|
||||||
|
export function registerPackagingCommands(
|
||||||
|
ctx: ExtensionContext,
|
||||||
|
{ cliServer }: PackagingOptions,
|
||||||
|
) {
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.installPackDependencies",
|
||||||
|
async (progress: ProgressCallback) =>
|
||||||
|
await handleInstallPackDependencies(cliServer, progress),
|
||||||
|
{
|
||||||
|
title: "Installing pack dependencies",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
ctx.subscriptions.push(
|
||||||
|
commandRunnerWithProgress(
|
||||||
|
"codeQL.downloadPacks",
|
||||||
|
async (progress: ProgressCallback) =>
|
||||||
|
await handleDownloadPacks(cliServer, progress),
|
||||||
|
{
|
||||||
|
title: "Downloading packs",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prompts user to choose packs to download, and downloads them.
|
* Prompts user to choose packs to download, and downloads them.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user