Remove codeQL.openVariantAnalysisQueryText command
This commit is contained in:
@@ -1198,15 +1198,6 @@ async function activateWithInstalledDistribution(
|
||||
),
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner(
|
||||
"codeQL.openVariantAnalysisQueryText",
|
||||
async (variantAnalysisId: number) => {
|
||||
await variantAnalysisManager.openQueryText(variantAnalysisId);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
ctx.subscriptions.push(
|
||||
commandRunner("codeQL.openReferencedFile", async (selectedQuery: Uri) => {
|
||||
await openReferencedFile(qs, cliServer, selectedQuery);
|
||||
|
||||
@@ -1034,8 +1034,7 @@ export class QueryHistoryManager extends DisposableObject {
|
||||
}
|
||||
|
||||
if (finalSingleItem.t === "variant-analysis") {
|
||||
await commands.executeCommand(
|
||||
"codeQL.openVariantAnalysisQueryText",
|
||||
await this.variantAnalysisManager.openQueryText(
|
||||
finalSingleItem.variantAnalysis.id,
|
||||
);
|
||||
return;
|
||||
|
||||
@@ -25,5 +25,6 @@ export interface VariantAnalysisViewManager<
|
||||
variantAnalysisId: number,
|
||||
): Promise<VariantAnalysisScannedRepositoryState[]>;
|
||||
openQueryFile(variantAnalysisId: number): Promise<void>;
|
||||
openQueryText(variantAnalysisId: number): Promise<void>;
|
||||
cancelVariantAnalysis(variantAnalysisId: number): Promise<void>;
|
||||
}
|
||||
|
||||
@@ -123,10 +123,7 @@ export class VariantAnalysisView
|
||||
await this.manager.openQueryFile(this.variantAnalysisId);
|
||||
break;
|
||||
case "openQueryText":
|
||||
void commands.executeCommand(
|
||||
"codeQL.openVariantAnalysisQueryText",
|
||||
this.variantAnalysisId,
|
||||
);
|
||||
await this.manager.openQueryText(this.variantAnalysisId);
|
||||
break;
|
||||
case "copyRepositoryList":
|
||||
void commands.executeCommand(
|
||||
|
||||
@@ -32,6 +32,7 @@ const openQueryText = () => {
|
||||
vscode.postMessage({
|
||||
t: "openQueryText",
|
||||
});
|
||||
sendTelemetry("variant-analysis-open-query-text");
|
||||
};
|
||||
|
||||
const stopQuery = () => {
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "fs-extra";
|
||||
import { join } from "path";
|
||||
|
||||
import { commands, ExtensionContext, Uri } from "vscode";
|
||||
import { ExtensionContext, Uri } from "vscode";
|
||||
import { DatabaseManager } from "../../../../src/local-databases";
|
||||
import { tmpDir, walkDirectory } from "../../../../src/helpers";
|
||||
import { DisposableBucket } from "../../disposable-bucket";
|
||||
@@ -54,9 +54,12 @@ describe("Variant Analyses and QueryHistoryManager", () => {
|
||||
rehydrateVariantAnalysis: rehydrateVariantAnalysisStub,
|
||||
onVariantAnalysisStatusUpdated: jest.fn(),
|
||||
showView: showViewStub,
|
||||
openQueryText: jest.fn(),
|
||||
} as any as VariantAnalysisManager;
|
||||
|
||||
let executeCommandSpy: jest.SpiedFunction<typeof commands.executeCommand>;
|
||||
let openQueryTextSpy: jest.SpiedFunction<
|
||||
typeof variantAnalysisManagerStub.openQueryText
|
||||
>;
|
||||
|
||||
beforeEach(async () => {
|
||||
// Since these tests change the state of the query history manager, we need to copy the original
|
||||
@@ -95,8 +98,8 @@ describe("Variant Analyses and QueryHistoryManager", () => {
|
||||
);
|
||||
disposables.push(qhm);
|
||||
|
||||
executeCommandSpy = jest
|
||||
.spyOn(commands, "executeCommand")
|
||||
openQueryTextSpy = jest
|
||||
.spyOn(variantAnalysisManagerStub, "openQueryText")
|
||||
.mockResolvedValue(undefined);
|
||||
});
|
||||
|
||||
@@ -180,8 +183,7 @@ describe("Variant Analyses and QueryHistoryManager", () => {
|
||||
await qhm.readQueryHistory();
|
||||
await qhm.handleShowQueryText(qhm.treeDataProvider.allHistory[0], []);
|
||||
|
||||
expect(executeCommandSpy).toHaveBeenCalledWith(
|
||||
"codeQL.openVariantAnalysisQueryText",
|
||||
expect(openQueryTextSpy).toHaveBeenCalledWith(
|
||||
rawQueryHistory[0].variantAnalysis.id,
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user