File tree Expand file tree Collapse file tree
extensions/ql-vscode/src/databases Expand file tree Collapse file tree Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import {
6161 tryGetQueryLanguage ,
6262} from "../common/query-language" ;
6363import type { LanguageContextStore } from "../language-context-store" ;
64+ import { extLogger } from "../common/logging/vscode" ;
6465
6566enum SortOrder {
6667 NameAsc = "NameAsc" ,
@@ -755,13 +756,12 @@ export class DatabaseUI extends DisposableObject {
755756 // Check if the database is already in the workspace. If
756757 // so, delete it first before importing the new one.
757758 const existingItem = this . databaseManager . findTestDatabase ( uri ) ;
759+ const baseName = basename ( uri . fsPath ) ;
758760 if ( existingItem !== undefined ) {
759761 progress ( {
760762 maxStep : 9 ,
761763 step : 1 ,
762- message : `Removing existing test database ${ basename (
763- uri . fsPath ,
764- ) } `,
764+ message : `Removing existing test database ${ baseName } ` ,
765765 } ) ;
766766 await this . databaseManager . removeDatabaseItem ( existingItem ) ;
767767 }
@@ -774,6 +774,14 @@ export class DatabaseUI extends DisposableObject {
774774 progress ,
775775 this . queryServer . cliServer ,
776776 ) ;
777+
778+ if ( existingItem !== undefined ) {
779+ progress ( {
780+ maxStep : 9 ,
781+ step : 9 ,
782+ message : `Successfully re-imported ${ baseName } ` ,
783+ } ) ;
784+ }
777785 } catch ( e ) {
778786 // rethrow and let this be handled by default error handling.
779787 throw new Error (
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments