Skip to content

Commit 2bfcd11

Browse files
committed
Don't show empty list of DBs
1 parent 5932bdb commit 2bfcd11

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

extensions/ql-vscode/src/extension.ts

+4
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,10 @@ async function activateWithInstalledDistribution(
571571
uri: Uri | undefined
572572
) => {
573573
let filteredDBs = dbm.databaseItems;
574+
if (filteredDBs.length === 0) {
575+
void helpers.showAndLogErrorMessage('No databases found. Please add a suitable database to your workspace.');
576+
return;
577+
}
574578
// If possible, only show databases with the right language (otherwise show all databases).
575579
const queryLanguage = await findLanguage(cliServer, uri);
576580
if (queryLanguage) {

extensions/ql-vscode/src/run-remote-query.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export async function runRemoteQuery(cliServer: cli.CodeQLCliServer, credentials
7171
const repositories = config.repositories;
7272

7373
if (!language) {
74-
return;
74+
return; // No error message needed, since `findlanguage` already displays one.
7575
}
7676

7777
try {

0 commit comments

Comments
 (0)