@@ -488,15 +488,30 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
488488 await checkConnection ( true , uri ) ;
489489 }
490490
491- vscode . workspace . onDidChangeWorkspaceFolders ( ( { added, removed } ) => {
491+ vscode . workspace . onDidChangeWorkspaceFolders ( async ( { added, removed } ) => {
492492 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
493509 if (
494510 folders ?. length === 1 &&
495511 added ?. length === 1 &&
496512 removed ?. length === 0 &&
497513 filesystemSchemas . includes ( added [ 0 ] . uri . scheme )
498514 ) {
499- // First folder has been added and is one of the isfs types, so hide the ObjectScript Explorer for this workspace
500515 vscode . workspace
501516 . getConfiguration ( "objectscript" )
502517 . update ( "showExplorer" , false , vscode . ConfigurationTarget . Workspace ) ;
0 commit comments