Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use codeQL.runningQueries.numberOfThreads to run interpretation #771

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions extensions/ql-vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [UNRELEASED]

- Respect the `codeQL.runningQueries.numberOfThreads` setting when creating SARIF files during result interpretation. [#771](https://github.com/github/vscode-codeql/pull/771)
- Allow using raw LGTM project slugs for fetching LGTM databases. [#769](https://github.com/github/vscode-codeql/pull/769)

## 1.4.3 - 22 February 2021
Expand Down
6 changes: 6 additions & 0 deletions extensions/ql-vscode/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ export class CodeQLCliServer implements Disposable {
'--source-location-prefix', sourceInfo.sourceLocationPrefix
);
}

args.push(
'--threads',
this.cliConfig.numberThreads.toString(),
);

args.push(resultsPath);
await this.runCodeQlCliCommand(['bqrs', 'interpret'], args, 'Interpreting query results');

Expand Down
8 changes: 7 additions & 1 deletion extensions/ql-vscode/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,11 @@ export interface QueryHistoryConfig {
onDidChangeConfiguration: Event<void>;
}

const CLI_SETTINGS = [NUMBER_OF_TEST_THREADS_SETTING];
const CLI_SETTINGS = [NUMBER_OF_TEST_THREADS_SETTING, NUMBER_OF_THREADS_SETTING];

export interface CliConfig {
numberTestThreads: number;
numberThreads: number;
onDidChangeConfiguration?: Event<void>;
}

Expand Down Expand Up @@ -235,6 +236,11 @@ export class CliConfigListener extends ConfigListener implements CliConfig {
return NUMBER_OF_TEST_THREADS_SETTING.getValue();
}


public get numberThreads(): number {
return NUMBER_OF_THREADS_SETTING.getValue<number>();
}

protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
this.handleDidChangeConfigurationForRelevantSettings(CLI_SETTINGS, e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ describe('config listeners', function() {
{
clazz: CliConfigListener,
settings: [{
name: 'codeQL.runningQueries.numberOfThreads',
property: 'numberThreads',
values: [0, 1]
}, {
name: 'codeQL.runningTests.numberOfThreads',
property: 'numberTestThreads',
values: [1, 0]
Expand Down