Skip to content

Commit

Permalink
Don't show empty list of DBs
Browse files Browse the repository at this point in the history
  • Loading branch information
shati-patel committed Aug 4, 2021
1 parent 5932bdb commit 2bfcd11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions extensions/ql-vscode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,10 @@ async function activateWithInstalledDistribution(
uri: Uri | undefined
) => {
let filteredDBs = dbm.databaseItems;
if (filteredDBs.length === 0) {
void helpers.showAndLogErrorMessage('No databases found. Please add a suitable database to your workspace.');
return;
}
// If possible, only show databases with the right language (otherwise show all databases).
const queryLanguage = await findLanguage(cliServer, uri);
if (queryLanguage) {
Expand Down
2 changes: 1 addition & 1 deletion extensions/ql-vscode/src/run-remote-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function runRemoteQuery(cliServer: cli.CodeQLCliServer, credentials
const repositories = config.repositories;

if (!language) {
return;
return; // No error message needed, since `findlanguage` already displays one.
}

try {
Expand Down

0 comments on commit 2bfcd11

Please sign in to comment.