Skip to content

Commit 38a6401

Browse files
committed
New setting to specify number of paths per alert
1 parent 20b15b6 commit 38a6401

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

extensions/ql-vscode/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Add support for filename pattern in history view. [#930](https://github.com/github/vscode-codeql/pull/930)
66
- Add an option _View Results (CSV)_ to view the results of a non-alert query. The existing options for alert queries have been renamed to _View Alerts_ to avoid confusion. [#929](https://github.com/github/vscode-codeql/pull/929)
7+
- Allow users to specify the number of paths to display for each alert. [#931](https://github.com/github/vscode-codeql/pull/931)
78

89
## 1.5.3 - 18 August 2021
910

extensions/ql-vscode/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@
180180
"default": false,
181181
"description": "Enable debug logging and tuple counting when running CodeQL queries. This information is useful for debugging query performance."
182182
},
183+
"codeQL.runningQueries.maxPaths": {
184+
"type": "integer",
185+
"default": 4,
186+
"markdownDescription": "Max number of paths to display for each alert found by a path query (`@kind path-problem`)."
187+
},
183188
"codeQL.runningQueries.autoSave": {
184189
"type": "boolean",
185190
"default": false,

extensions/ql-vscode/src/cli.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,11 @@ export class CodeQLCliServer implements Disposable {
649649
this.cliConfig.numberThreads.toString(),
650650
);
651651

652+
args.push(
653+
'--max-paths',
654+
this.cliConfig.maxPaths.toString(),
655+
);
656+
652657
args.push(resultsPath);
653658
await this.runCodeQlCliCommand(['bqrs', 'interpret'], args, 'Interpreting query results');
654659
}

extensions/ql-vscode/src/config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ const CACHE_SIZE_SETTING = new Setting('cacheSize', RUNNING_QUERIES_SETTING);
7979
const TIMEOUT_SETTING = new Setting('timeout', RUNNING_QUERIES_SETTING);
8080
const MEMORY_SETTING = new Setting('memory', RUNNING_QUERIES_SETTING);
8181
const DEBUG_SETTING = new Setting('debug', RUNNING_QUERIES_SETTING);
82+
const MAX_PATHS = new Setting('maxPaths', RUNNING_QUERIES_SETTING);
8283
const RUNNING_TESTS_SETTING = new Setting('runningTests', ROOT_SETTING);
8384
const RESULTS_DISPLAY_SETTING = new Setting('resultsDisplay', ROOT_SETTING);
8485

@@ -112,12 +113,13 @@ export interface QueryHistoryConfig {
112113
onDidChangeConfiguration: Event<void>;
113114
}
114115

115-
const CLI_SETTINGS = [ADDITIONAL_TEST_ARGUMENTS_SETTING, NUMBER_OF_TEST_THREADS_SETTING, NUMBER_OF_THREADS_SETTING];
116+
const CLI_SETTINGS = [ADDITIONAL_TEST_ARGUMENTS_SETTING, NUMBER_OF_TEST_THREADS_SETTING, NUMBER_OF_THREADS_SETTING, MAX_PATHS];
116117

117118
export interface CliConfig {
118119
additionalTestArguments: string[];
119120
numberTestThreads: number;
120121
numberThreads: number;
122+
maxPaths: number;
121123
onDidChangeConfiguration?: Event<void>;
122124
}
123125

@@ -264,6 +266,10 @@ export class CliConfigListener extends ConfigListener implements CliConfig {
264266
return NUMBER_OF_THREADS_SETTING.getValue<number>();
265267
}
266268

269+
public get maxPaths(): number {
270+
return MAX_PATHS.getValue<number>();
271+
}
272+
267273
protected handleDidChangeConfiguration(e: ConfigurationChangeEvent): void {
268274
this.handleDidChangeConfigurationForRelevantSettings(CLI_SETTINGS, e);
269275
}

0 commit comments

Comments
 (0)