Skip to content

Commit 28745da

Browse files
committed
Replace setCurrentDatabaseItem with openDatabase
1 parent 6e41241 commit 28745da

File tree

1 file changed

+6
-23
lines changed

1 file changed

+6
-23
lines changed

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

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ export class DatabaseUI extends DisposableObject {
633633
this.queryServer?.cliServer,
634634
);
635635
} else {
636-
await this.setCurrentDatabase(progress, token, uri);
636+
await this.databaseManager.openDatabase(progress, token, uri);
637637
}
638638
} catch (e) {
639639
// rethrow and let this be handled by default error handling.
@@ -755,27 +755,6 @@ export class DatabaseUI extends DisposableObject {
755755
return this.databaseManager.currentDatabaseItem;
756756
}
757757

758-
private async setCurrentDatabase(
759-
progress: ProgressCallback,
760-
token: CancellationToken,
761-
uri: Uri,
762-
): Promise<DatabaseItem | undefined> {
763-
let databaseItem = this.databaseManager.findDatabaseItem(uri);
764-
765-
const makeSelected = true;
766-
767-
if (databaseItem === undefined) {
768-
databaseItem = await this.databaseManager.openDatabase(
769-
progress,
770-
token,
771-
uri,
772-
makeSelected,
773-
);
774-
}
775-
776-
return databaseItem;
777-
}
778-
779758
/**
780759
* Ask the user for a database directory. Returns the chosen database, or `undefined` if the
781760
* operation was canceled.
@@ -795,7 +774,11 @@ export class DatabaseUI extends DisposableObject {
795774
if (byFolder) {
796775
const fixedUri = await this.fixDbUri(uri);
797776
// we are selecting a database folder
798-
return await this.setCurrentDatabase(progress, token, fixedUri);
777+
return await this.databaseManager.openDatabase(
778+
progress,
779+
token,
780+
fixedUri,
781+
);
799782
} else {
800783
// we are selecting a database archive. Must unzip into a workspace-controlled area
801784
// before importing.

0 commit comments

Comments
 (0)