Skip to content

Commit c5f78e3

Browse files
committed
Replaced "new Parser()" with "parser()"
1 parent f11daaf commit c5f78e3

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

  • extensions/ql-vscode/src

extensions/ql-vscode/src/cli.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as child_process from 'child_process';
33
import * as fs from 'fs-extra';
44
import * as path from 'path';
55
import { chain } from 'stream-chain';
6-
import { Parser } from 'stream-json';
6+
import { parser } from 'stream-json';
77
import Assembler = require('stream-json/Assembler');
88
import * as sarif from 'sarif';
99
import { SemVer } from 'semver';
@@ -20,7 +20,6 @@ import { assertNever } from './pure/helpers-pure';
2020
import { QueryMetadata, SortDirection } from './pure/interface-types';
2121
import { Logger, ProgressReporter } from './logging';
2222
import { CompilationMessage } from './pure/messages';
23-
import Chain = require('stream-chain');
2423

2524
/**
2625
* The version of the SARIF format that we are using.
@@ -673,12 +672,11 @@ export class CodeQLCliServer implements Disposable {
673672

674673
async interpretBqrs(metadata: QueryMetadata, resultsPath: string, interpretedResultsPath: string, sourceInfo?: SourceInfo): Promise<sarif.Log> {
675674
await this.runInterpretCommand(SARIF_FORMAT, metadata, resultsPath, interpretedResultsPath, sourceInfo);
676-
let pipeline: Chain;
677-
675+
let pipeline;
678676
try {
679677
pipeline = chain([
680678
fs.createReadStream(interpretedResultsPath),
681-
new Parser()
679+
parser()
682680
]);
683681
} catch (e) {
684682
throw new Error('Reading output of interpretation failed.');
@@ -688,7 +686,7 @@ export class CodeQLCliServer implements Disposable {
688686
const asm = Assembler.connectTo(pipeline);
689687
asm.on('done', (asm) => asm.current);
690688
// need to return asm.current in place of {}
691-
return {} as sarif.Log;
689+
return {} as unknown as sarif.Log;
692690
} catch (err) {
693691
throw new Error(`Parsing output of interpretation failed: ${err.stderr || err}`);
694692
}

0 commit comments

Comments
 (0)