@@ -488,15 +488,30 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
488
488
await checkConnection ( true , uri ) ;
489
489
}
490
490
491
- vscode . workspace . onDidChangeWorkspaceFolders ( ( { added, removed } ) => {
491
+ vscode . workspace . onDidChangeWorkspaceFolders ( async ( { added, removed } ) => {
492
492
const folders = vscode . workspace . workspaceFolders ;
493
+
494
+ // Make sure we have a resolved connection spec for the targets of all added folders
495
+ const toCheck = new Map < string , vscode . Uri > ( ) ;
496
+ added . map ( ( workspaceFolder ) => {
497
+ const uri = workspaceFolder . uri ;
498
+ const { configName } = connectionTarget ( uri ) ;
499
+ toCheck . set ( configName , uri ) ;
500
+ } ) ;
501
+ for await ( const oneToCheck of toCheck ) {
502
+ const configName = oneToCheck [ 0 ] ;
503
+ const uri = oneToCheck [ 1 ] ;
504
+ const serverName = uri . scheme === "file" ? config ( "conn" , configName ) . server : configName ;
505
+ await resolveConnectionSpec ( serverName ) ;
506
+ }
507
+
508
+ // If it was just the addition of the first folder, and this is one of the isfs types, hide the ObjectScript Explorer for this workspace
493
509
if (
494
510
folders ?. length === 1 &&
495
511
added ?. length === 1 &&
496
512
removed ?. length === 0 &&
497
513
filesystemSchemas . includes ( added [ 0 ] . uri . scheme )
498
514
) {
499
- // First folder has been added and is one of the isfs types, so hide the ObjectScript Explorer for this workspace
500
515
vscode . workspace
501
516
. getConfiguration ( "objectscript" )
502
517
. update ( "showExplorer" , false , vscode . ConfigurationTarget . Workspace ) ;
0 commit comments