Skip to content

Commit cb514f5

Browse files
author
Dave Bartolomeo
committed
Pre-cleanup to avoid merge conflicts
1 parent 57bb8ce commit cb514f5

3 files changed

Lines changed: 14 additions & 30 deletions

File tree

extensions/ql-vscode/src/cli.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -685,23 +685,6 @@ export class CodeQLCliServer implements Disposable {
685685
return await this.runCodeQlCliCommand(['generate', 'log-summary'], subcommandArgs, 'Generating log summary');
686686
}
687687

688-
/**
689-
* Generate a JSON summary of an evaluation log.
690-
* @param inputPath The path of an evaluation event log.
691-
* @param outputPath The path to write a JSON summary of it to.
692-
*/
693-
async generateJsonLogSummary(
694-
inputPath: string,
695-
outputPath: string
696-
): Promise<string> {
697-
const subcommandArgs = [
698-
'--minify-output',
699-
inputPath,
700-
outputPath
701-
];
702-
return await this.runCodeQlCliCommand(['generate', 'log-summary'], subcommandArgs, 'Generating log summary');
703-
}
704-
705688
/**
706689
* Gets the results from a bqrs.
707690
* @param bqrsPath The path to the bqrs.

extensions/ql-vscode/src/log-insights/summary-parser.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,23 @@ const RETURN_REGEXP = /^\s*return /;
4141
* generates the human-readabe summary to avoid having to rely on regular expression matching of the
4242
* human-readable text.
4343
*
44+
* @param summaryPath The path to the summary file.
45+
* @param symbolsPath The path to the symbols file to generate.
46+
*/
47+
export async function generateSummarySymbolsFile(summaryPath: string, symbolsPath: string): Promise<void> {
48+
const symbols = await generateSummarySymbols(summaryPath);
49+
await fs.writeFile(symbolsPath, JSON.stringify(symbols));
50+
}
51+
52+
/**
53+
* Parse a human-readable evaluation log summary to find the location of the RA for each pipeline
54+
* run.
55+
*
4456
* @param fileLocation The path to the summary file.
4557
* @returns Symbol information for the summary file.
4658
*/
47-
export async function generateSummarySymbols(fileLocation: string): Promise<SummarySymbols> {
48-
const summary = await fs.promises.readFile(fileLocation, { encoding: 'utf-8' });
59+
async function generateSummarySymbols(summaryPath: string): Promise<SummarySymbols> {
60+
const summary = await fs.promises.readFile(summaryPath, { encoding: 'utf-8' });
4961
const symbols: SummarySymbols = {
5062
predicates: {}
5163
};

extensions/ql-vscode/src/run-queries.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ import { ensureMetadataIsComplete } from './query-results';
3737
import { SELECT_QUERY_NAME } from './contextual/locationFinder';
3838
import { DecodedBqrsChunk } from './pure/bqrs-cli-types';
3939
import { getErrorMessage } from './pure/helpers-pure';
40-
import { generateSummarySymbols } from './log-insights/summary-parser';
4140

4241
/**
4342
* run-queries.ts
@@ -217,16 +216,6 @@ export class QueryEvaluationInfo {
217216
void qs.logger.log(' --- Evaluator Log Summary --- ');
218217
void qs.logger.log(buffer.toString());
219218
});
220-
221-
// Create the symbol table for the summary file, so we know where each predicate and iteration
222-
// is located. We use this info for jumping to the RA for a specific predicate and iteration.
223-
// TODO: Move this into the CLI once we're more sure of the format.
224-
const symbols = await generateSummarySymbols(this.evalLogSummaryPath);
225-
await fs.writeFile(this.evalLogSummarySymbolsPath, JSON.stringify(symbols));
226-
queryInfo.evalLogSummarySymbolsLocation = this.evalLogSummarySymbolsPath;
227-
228-
await qs.cliServer.generateJsonLogSummary(this.evalLogPath, this.evalLogJsonSummaryPath);
229-
queryInfo.evalLogJsonSummaryLocation = this.evalLogJsonSummaryPath;
230219
} else {
231220
void showAndLogWarningMessage(`Failed to write structured evaluator log to ${this.evalLogPath}.`);
232221
}

0 commit comments

Comments
 (0)