From 98312a72a7536480223539eefabcbb49521f92cc Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Wed, 17 Nov 2021 09:37:42 -0800 Subject: [PATCH 1/2] 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. --- extensions/ql-vscode/src/interface.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/extensions/ql-vscode/src/interface.ts b/extensions/ql-vscode/src/interface.ts index ddca9e617..100e39417 100644 --- a/extensions/ql-vscode/src/interface.ts +++ b/extensions/ql-vscode/src/interface.ts @@ -365,8 +365,7 @@ export class InterfaceManager extends DisposableObject { const showButton = 'View Results'; const queryName = results.queryName; const resultPromise = vscode.window.showInformationMessage( - `Finished running query ${ - queryName.length > 0 ? ` "${queryName}"` : '' + `Finished running query ${queryName.length > 0 ? ` "${queryName}"` : '' }.`, showButton ); @@ -502,7 +501,12 @@ export class InterfaceManager extends DisposableObject { ); const resultSetSchemas = await this.getResultSetSchemas(results, sorted ? selectedTable : ''); - const resultSetNames = resultSetSchemas.map(schema => schema.name); + + // If there is a specific sorted table selected, a different bqrs file is loaded that doesn't have all the result set names. + // Make sure that we load all result set names here. + // See https://github.com/github/vscode-codeql/issues/1005 + const allResultSetSchemas = sorted ? await this.getResultSetSchemas(results, '') : resultSetSchemas; + const resultSetNames = allResultSetSchemas.map(schema => schema.name); const schema = resultSetSchemas.find( (resultSet) => resultSet.name == selectedTable From 01f24523acb99fdc428f3fa252a164076c8b4765 Mon Sep 17 00:00:00 2001 From: Andrew Eisenberg Date: Wed, 17 Nov 2021 09:39:49 -0800 Subject: [PATCH 2/2] Update changelog --- extensions/ql-vscode/CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/ql-vscode/CHANGELOG.md b/extensions/ql-vscode/CHANGELOG.md index 4b8282b6a..b4a76cab1 100644 --- a/extensions/ql-vscode/CHANGELOG.md +++ b/extensions/ql-vscode/CHANGELOG.md @@ -2,12 +2,13 @@ ## [UNRELEASED] -- Fix the _CodeQL: Open Referenced File_ command for Windows systems. [#979](https://github.com/github/vscode-codeql/pull/979) +- Fix the _CodeQL: Open Referenced File_ command for Windows systems. [#979](https://github.com/github/vscode-codeql/pull/979) - Fix a bug that shows 'Set current database' when hovering over the currently selected database in the databases view. [#976](https://github.com/github/vscode-codeql/pull/976) - Fix a bug with importing large databases. Databases over 4GB can now be imported directly from LGTM or from a zip file. This functionality is only available when using CodeQL CLI version 2.6.0 or later. [#971](https://github.com/github/vscode-codeql/pull/971) -- Replace certain control codes (`U+0000` - `U+001F`) with their corresponding control labels (`U+2400` - `U+241F`) in the results view. [#963](https://github.com/github/vscode-codeql/pull/963) +- Replace certain control codes (`U+0000` - `U+001F`) with their corresponding control labels (`U+2400` - `U+241F`) in the results view. [#963](https://github.com/github/vscode-codeql/pull/963) - Allow case-insensitive project slugs for GitHub repositories when adding a CodeQL database from LGTM. [#978](https://github.com/github/vscode-codeql/pull/961) - Make "Open Referenced File" command accessible from the active editor menu. [#989](https://github.com/github/vscode-codeql/pull/989) +- Fix a bug where result set names in the result set drop-down were disappearing when viewing a sorted table. [#1007](https://github.com/github/vscode-codeql/pull/1007) ## 1.5.6 - 07 October 2021