Skip to content

Commit 255f1b6

Browse files
committed
Remove codeQL.copyRepoList command
1 parent dcdb303 commit 255f1b6

File tree

5 files changed

+2
-62
lines changed

5 files changed

+2
-62
lines changed

extensions/ql-vscode/src/extension.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,12 +1128,6 @@ async function activateWithInstalledDistribution(
11281128
),
11291129
);
11301130

1131-
ctx.subscriptions.push(
1132-
commandRunner("codeQL.copyRepoList", async (queryId: string) => {
1133-
await rqm.copyRemoteQueryRepoListToClipboard(queryId);
1134-
}),
1135-
);
1136-
11371131
ctx.subscriptions.push(
11381132
commandRunner(
11391133
"codeQL.openVariantAnalysisLogs",

extensions/ql-vscode/src/query-history/query-history-manager.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,12 +1289,7 @@ export class QueryHistoryManager extends DisposableObject {
12891289
return;
12901290
}
12911291

1292-
if (finalSingleItem.t === "remote") {
1293-
await commands.executeCommand(
1294-
"codeQL.copyRepoList",
1295-
finalSingleItem.queryId,
1296-
);
1297-
} else if (finalSingleItem.t === "variant-analysis") {
1292+
if (finalSingleItem.t === "variant-analysis") {
12981293
await commands.executeCommand(
12991294
"codeQL.copyVariantAnalysisRepoList",
13001295
finalSingleItem.variantAnalysis.id,

extensions/ql-vscode/src/remote-queries/remote-queries-manager.ts

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { CancellationToken, env, EventEmitter, ExtensionContext } from "vscode";
1+
import { CancellationToken, EventEmitter, ExtensionContext } from "vscode";
22
import { join } from "path";
33
import { pathExists, readFile, remove } from "fs-extra";
4-
import { EOL } from "os";
54

65
import { CodeQLCliServer } from "../cli";
76
import { showAndLogExceptionWithTelemetry } from "../helpers";
@@ -152,37 +151,10 @@ export class RemoteQueriesManager extends DisposableObject {
152151
);
153152
}
154153

155-
public async copyRemoteQueryRepoListToClipboard(queryId: string) {
156-
const queryResult = await this.getRemoteQueryResult(queryId);
157-
const repos = queryResult.analysisSummaries
158-
.filter((a) => a.resultCount > 0)
159-
.map((a) => a.nwo);
160-
161-
if (repos.length > 0) {
162-
const text = [
163-
'"new-repo-list": [',
164-
...repos.slice(0, -1).map((repo) => ` "${repo}",`),
165-
` "${repos[repos.length - 1]}"`,
166-
"]",
167-
];
168-
169-
await env.clipboard.writeText(text.join(EOL));
170-
}
171-
}
172-
173154
public async openResults(query: RemoteQuery, queryResult: RemoteQueryResult) {
174155
await this.view.showResults(query, queryResult);
175156
}
176157

177-
private async getRemoteQueryResult(
178-
queryId: string,
179-
): Promise<RemoteQueryResult> {
180-
return await this.retrieveJsonFile<RemoteQueryResult>(
181-
queryId,
182-
"query-result.json",
183-
);
184-
}
185-
186158
private async retrieveJsonFile<T>(
187159
queryId: string,
188160
fileName: string,

extensions/ql-vscode/src/remote-queries/remote-queries-view.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ export class RemoteQueriesView extends AbstractWebview<
154154
await this.openVirtualFile(msg.queryText);
155155
break;
156156
case "copyRepoList":
157-
await commands.executeCommand("codeQL.copyRepoList", msg.queryId);
158157
break;
159158
case "remoteQueryDownloadAnalysisResults":
160159
await this.downloadAnalysisResults(msg);

extensions/ql-vscode/test/vscode-tests/no-workspace/query-history/query-history-manager.test.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,26 +1109,6 @@ describe("QueryHistoryManager", () => {
11091109
expect(executeCommandSpy).not.toBeCalled();
11101110
});
11111111

1112-
it("should copy repo list for a single remote query", async () => {
1113-
queryHistoryManager = await createMockQueryHistory(allHistory);
1114-
1115-
const item = remoteQueryHistory[1];
1116-
await queryHistoryManager.handleCopyRepoList(item, [item]);
1117-
expect(executeCommandSpy).toBeCalledWith(
1118-
"codeQL.copyRepoList",
1119-
item.queryId,
1120-
);
1121-
});
1122-
1123-
it("should not copy repo list for multiple remote queries", async () => {
1124-
queryHistoryManager = await createMockQueryHistory(allHistory);
1125-
1126-
const item1 = remoteQueryHistory[1];
1127-
const item2 = remoteQueryHistory[3];
1128-
await queryHistoryManager.handleCopyRepoList(item1, [item1, item2]);
1129-
expect(executeCommandSpy).not.toBeCalled();
1130-
});
1131-
11321112
it("should copy repo list for a single variant analysis", async () => {
11331113
queryHistoryManager = await createMockQueryHistory(allHistory);
11341114

0 commit comments

Comments
 (0)