Skip to content

Commit 2d85018

Browse files
committed
Add better log messages
1 parent f84f792 commit 2d85018

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

extensions/ql-vscode/src/databases/database-fetcher.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ export async function importLocalDatabase(
318318
await commandManager.execute("codeQLDatabases.focus");
319319
void showAndLogInformationMessage(
320320
extLogger,
321-
"Database unzipped and imported successfully.",
321+
origin.type === "testproj"
322+
? "Test database imported successfully."
323+
: "Database unzipped and imported successfully.",
322324
);
323325
}
324326
return item;

extensions/ql-vscode/src/databases/local-databases-ui.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,13 +755,12 @@ export class DatabaseUI extends DisposableObject {
755755
// Check if the database is already in the workspace. If
756756
// so, delete it first before importing the new one.
757757
const existingItem = this.databaseManager.findTestDatabase(uri);
758+
const baseName = basename(uri.fsPath);
758759
if (existingItem !== undefined) {
759760
progress({
760761
maxStep: 9,
761762
step: 1,
762-
message: `Removing existing test database ${basename(
763-
uri.fsPath,
764-
)}`,
763+
message: `Removing existing test database ${baseName}`,
765764
});
766765
await this.databaseManager.removeDatabaseItem(existingItem);
767766
}
@@ -774,6 +773,14 @@ export class DatabaseUI extends DisposableObject {
774773
progress,
775774
this.queryServer.cliServer,
776775
);
776+
777+
if (existingItem !== undefined) {
778+
progress({
779+
maxStep: 9,
780+
step: 9,
781+
message: `Successfully re-imported ${baseName}`,
782+
});
783+
}
777784
} catch (e) {
778785
// rethrow and let this be handled by default error handling.
779786
throw new Error(

extensions/ql-vscode/src/databases/local-databases/database-manager.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ export class DatabaseManager extends DisposableObject {
256256
dateAdded: Date.now(),
257257
language: dbItem.language,
258258
origin: dbItem.origin,
259+
extensionManagedLocation: dbItem.extensionManagedLocation,
259260
});
260261
await this.addDatabaseItem(newDbItem);
261262
await this.setCurrentDatabaseItem(newDbItem);

0 commit comments

Comments
 (0)