@@ -2,7 +2,9 @@ import * as cpp from 'child-process-promise';
22import * as child_process from 'child_process' ;
33import * as fs from 'fs-extra' ;
44import * as path from 'path' ;
5+ import { chain } from 'stream-chain' ;
56import { Parser } from 'stream-json' ;
7+ import Assembler = require( 'stream-json/Assembler' ) ;
68import * as sarif from 'sarif' ;
79import { SemVer } from 'semver' ;
810import { Readable } from 'stream' ;
@@ -670,10 +672,16 @@ export class CodeQLCliServer implements Disposable {
670672
671673 async interpretBqrs ( metadata : QueryMetadata , resultsPath : string , interpretedResultsPath : string , sourceInfo ?: SourceInfo ) : Promise < sarif . Log > {
672674 await this . runInterpretCommand ( SARIF_FORMAT , metadata , resultsPath , interpretedResultsPath , sourceInfo ) ;
673- const parsedSarif = new Parser ( ) ;
674- let output : Parser ;
675+
676+ const pipeline = chain ( [
677+ fs . createReadStream ( interpretedResultsPath ) ,
678+ new Parser ( )
679+ ] ) ;
680+
681+ const asm = Assembler . connectTo ( pipeline ) ;
682+ asm . on ( 'done' , asm => console . log ( asm . current ) ) ;
675683 try {
676- output = fs . createReadStream ( interpretedResultsPath ) . pipe ( parsedSarif ) ;
684+ // output = fs.createReadStream('/Users/marcjaramillo/MLH/vscode-codeql-starter/jdk11-tainted-path.sarif' ).pipe(parsedSarif);
677685 } catch ( e ) {
678686 const rawMessage = e . stderr || e . message ;
679687 const errorMessage = rawMessage . startsWith ( 'Cannot create a string' )
@@ -682,7 +690,11 @@ export class CodeQLCliServer implements Disposable {
682690 throw new Error ( `Reading output of interpretation failed: ${ errorMessage } ` ) ;
683691 }
684692 try {
685- return output as unknown as sarif . Log ;
693+ // output.on('data', data => {
694+ // console.log(data);
695+ // });
696+ // output.on('end', () => { console.log('done'); });
697+ return { } as unknown as sarif . Log ;
686698 } catch ( err ) {
687699 throw new Error ( `Parsing output of interpretation failed: ${ err . stderr || err } ` ) ;
688700 }
0 commit comments