Skip to content

Commit 98312a7

Browse files
committed
Ensure all result set names are loaded
When the extension loads a sorted result set, it takes a shortcut and avoids loads a file with only the bqrs results for that sorted table. However, it does not load the results for any other table. This causes result set names to go away. This change ensures that if we are loading a sorted table, we also load the result set names for all other tables in that query. Fixes #1005.
1 parent d579cd6 commit 98312a7

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

extensions/ql-vscode/src/interface.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,7 @@ export class InterfaceManager extends DisposableObject {
365365
const showButton = 'View Results';
366366
const queryName = results.queryName;
367367
const resultPromise = vscode.window.showInformationMessage(
368-
`Finished running query ${
369-
queryName.length > 0 ? ` "${queryName}"` : ''
368+
`Finished running query ${queryName.length > 0 ? ` "${queryName}"` : ''
370369
}.`,
371370
showButton
372371
);
@@ -502,7 +501,12 @@ export class InterfaceManager extends DisposableObject {
502501
);
503502

504503
const resultSetSchemas = await this.getResultSetSchemas(results, sorted ? selectedTable : '');
505-
const resultSetNames = resultSetSchemas.map(schema => schema.name);
504+
505+
// If there is a specific sorted table selected, a different bqrs file is loaded that doesn't have all the result set names.
506+
// Make sure that we load all result set names here.
507+
// See https://github.com/github/vscode-codeql/issues/1005
508+
const allResultSetSchemas = sorted ? await this.getResultSetSchemas(results, '') : resultSetSchemas;
509+
const resultSetNames = allResultSetSchemas.map(schema => schema.name);
506510

507511
const schema = resultSetSchemas.find(
508512
(resultSet) => resultSet.name == selectedTable

0 commit comments

Comments
 (0)