Skip to content

Commit a92d286

Browse files
committed
fix #434 wait for connection checks during activation
1 parent 24374dc commit a92d286

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/extension.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -454,18 +454,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
454454
panel.command = "vscode-objectscript.serverActions";
455455
panel.show();
456456

457-
// Check once (flushing cookies) each connection used by the workspace(s)
457+
// Check one time (flushing cookies) each connection that is used by the workspace.
458+
// This gets any prompting for missing credentials done upfront, for simplicity.
458459
const toCheck = new Map<string, vscode.Uri>();
459460
vscode.workspace.workspaceFolders?.map((workspaceFolder) => {
460461
const uri = workspaceFolder.uri;
461462
const { configName } = connectionTarget(uri);
462463
toCheck.set(configName, uri);
463464
});
464-
toCheck.forEach(async function (uri, configName) {
465+
for await (const oneToCheck of toCheck) {
466+
const configName = oneToCheck[0];
467+
const uri = oneToCheck[1];
465468
const serverName = uri.scheme === "file" ? config("conn", configName).server : configName;
466469
await resolveConnectionSpec(serverName);
467470
await checkConnection(true, uri);
468-
});
471+
}
469472

470473
vscode.workspace.onDidChangeWorkspaceFolders(({ added, removed }) => {
471474
const folders = vscode.workspace.workspaceFolders;

0 commit comments

Comments
 (0)