Skip to content

Commit 9c2bd2a

Browse files
authored
Use streaming SARIF parser (#1109)
1 parent f42f474 commit 9c2bd2a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { Credentials } from '../authentication';
33
import { Logger } from '../logging';
44
import { downloadArtifactFromLink } from './gh-actions-api-client';
55
import * as path from 'path';
6-
import * as fs from 'fs-extra';
76
import { AnalysisSummary } from './shared/remote-query-result';
8-
import * as sarif from 'sarif';
97
import { AnalysisResults, QueryResult } from './shared/analysis-result';
108
import { UserCancellationException } from '../commandRunner';
9+
import { sarifParser } from '../sarif-parser';
1110

1211
export class AnalysesResultsManager {
1312
// Store for the results of various analyses for a single remote query.
@@ -92,8 +91,7 @@ export class AnalysesResultsManager {
9291
private async readResults(filePath: string): Promise<QueryResult[]> {
9392
const queryResults: QueryResult[] = [];
9493

95-
const sarifContents = await fs.readFile(filePath, 'utf8');
96-
const sarifLog = JSON.parse(sarifContents) as sarif.Log;
94+
const sarifLog = await sarifParser(filePath);
9795

9896
// Read the sarif file and extract information that we want to display
9997
// in the UI. For now we're only getting the message texts but we'll gradually

0 commit comments

Comments
 (0)