Skip to content

Commit 5f5a20f

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Add 'view-autofixes.ts' file for main implementation
1 parent 1103437 commit 5f5a20f

File tree

2 files changed

+38
-6
lines changed

2 files changed

+38
-6
lines changed

extensions/ql-vscode/src/variant-analysis/variant-analysis-manager.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import type {
7373
VariantAnalysisCommands,
7474
} from "../common/commands";
7575
import { exportVariantAnalysisResults } from "./export-results";
76+
import { viewAutofixesForVariantAnalysisResults } from "./view-autofixes";
7677
import {
7778
readRepoStates,
7879
REPO_STATES_FILENAME,
@@ -967,12 +968,20 @@ export class VariantAnalysisManager
967968
);
968969
}
969970

970-
public async viewAutofixes(variantAnalysisId: number) {
971-
const variantAnalysis = this.variantAnalyses.get(variantAnalysisId);
972-
if (!variantAnalysis) {
973-
throw new Error(`No variant analysis with id: ${variantAnalysisId}`);
974-
}
975-
// TODO
971+
public async viewAutofixes(
972+
variantAnalysisId: number,
973+
filterSort: RepositoriesFilterSortStateWithIds = defaultFilterSortState,
974+
) {
975+
await viewAutofixesForVariantAnalysisResults(
976+
variantAnalysisId,
977+
filterSort,
978+
this.variantAnalyses,
979+
this.app.credentials,
980+
this.app.logger,
981+
this.storagePath,
982+
this.app,
983+
this.cliServer,
984+
);
976985
}
977986

978987
public async copyRepoListToClipboard(
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import type { RepositoriesFilterSortStateWithIds } from "./shared/variant-analysis-filter-sort";
2+
import { defaultFilterSortState } from "./shared/variant-analysis-filter-sort";
3+
import type { VariantAnalysis } from "./shared/variant-analysis";
4+
import type { Credentials } from "../common/authentication";
5+
import type { NotificationLogger } from "../common/logging";
6+
import type { App } from "../common/app";
7+
import type { CodeQLCliServer } from "../codeql-cli/cli";
8+
9+
/**
10+
* Generates autofixes for the results of a variant analysis.
11+
*/
12+
export async function viewAutofixesForVariantAnalysisResults(
13+
variantAnalysisId: number,
14+
filterSort: RepositoriesFilterSortStateWithIds = defaultFilterSortState,
15+
variantAnalyses: Map<number, VariantAnalysis>,
16+
credentials: Credentials,
17+
logger: NotificationLogger,
18+
storagePath: string,
19+
app: App,
20+
cliServer: CodeQLCliServer,
21+
): Promise<void> {
22+
// TODO
23+
}

0 commit comments

Comments
 (0)