Skip to content

Commit 234b059

Browse files
author
Dave Bartolomeo
committed
Guard --sourcemap option based on CLI version
1 parent 6d7d0ca commit 234b059

File tree

1 file changed

+10
-1
lines changed
  • extensions/ql-vscode/src

1 file changed

+10
-1
lines changed

extensions/ql-vscode/src/cli.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@ export class CodeQLCliServer implements Disposable {
683683
const subcommandArgs = [
684684
'--format=text',
685685
`--end-summary=${endSummaryPath}`,
686-
'--sourcemap',
686+
...(await this.cliConstraints.supportsSourceMap() ? ['--sourcemap'] : []),
687687
inputPath,
688688
outputPath
689689
];
@@ -1322,6 +1322,11 @@ export class CliVersionConstraint {
13221322
*/
13231323
public static CLI_VERSION_WITH_PER_QUERY_EVAL_LOG = new SemVer('2.9.0');
13241324

1325+
/**
1326+
* CLI version that supports the `--sourcemap` option for log generation.
1327+
*/
1328+
public static CLI_VERSION_WITH_SOURCEMAP = new SemVer('2.10.3');
1329+
13251330
constructor(private readonly cli: CodeQLCliServer) {
13261331
/**/
13271332
}
@@ -1389,4 +1394,8 @@ export class CliVersionConstraint {
13891394
async supportsPerQueryEvalLog() {
13901395
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_PER_QUERY_EVAL_LOG);
13911396
}
1397+
1398+
async supportsSourceMap() {
1399+
return this.isVersionAtLeast(CliVersionConstraint.CLI_VERSION_WITH_SOURCEMAP);
1400+
}
13921401
}

0 commit comments

Comments
 (0)