@@ -232,7 +232,11 @@ export function getResolvedConnectionSpec(key: string, dflt: any): any {
232
232
*/
233
233
export const cspApps : Map < string , string [ ] > = new Map ( ) ;
234
234
235
- export async function checkConnection ( clearCookies = false , uri ?: vscode . Uri ) : Promise < void > {
235
+ export async function checkConnection (
236
+ clearCookies = false ,
237
+ uri ?: vscode . Uri ,
238
+ triggerRefreshes ?: boolean
239
+ ) : Promise < void > {
236
240
// Do nothing if already checking the connection
237
241
if ( checkingConnection ) {
238
242
return ;
@@ -419,16 +423,18 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
419
423
} )
420
424
. finally ( ( ) => {
421
425
checkingConnection = false ;
422
- setTimeout ( ( ) => {
423
- explorerProvider . refresh ( ) ;
424
- projectsExplorerProvider . refresh ( ) ;
425
- // Refreshing Files Explorer also switches to it, so only do this if the uri is part of the workspace,
426
- // otherwise files opened from ObjectScript Explorer (objectscript:// or isfs:// depending on the "objectscript.serverSideEditing" setting)
427
- // will cause an unwanted switch.
428
- if ( uri && schemas . includes ( uri . scheme ) && vscode . workspace . getWorkspaceFolder ( uri ) ) {
429
- vscode . commands . executeCommand ( "workbench.files.action.refreshFilesExplorer" ) ;
430
- }
431
- } , 20 ) ;
426
+ if ( triggerRefreshes ) {
427
+ setTimeout ( ( ) => {
428
+ explorerProvider . refresh ( ) ;
429
+ projectsExplorerProvider . refresh ( ) ;
430
+ // Refreshing Files Explorer also switches to it, so only do this if the uri is part of the workspace,
431
+ // otherwise files opened from ObjectScript Explorer (objectscript:// or isfs:// depending on the "objectscript.serverSideEditing" setting)
432
+ // will cause an unwanted switch.
433
+ if ( uri && schemas . includes ( uri . scheme ) && vscode . workspace . getWorkspaceFolder ( uri ) ) {
434
+ vscode . commands . executeCommand ( "workbench.files.action.refreshFilesExplorer" ) ;
435
+ }
436
+ } , 20 ) ;
437
+ }
432
438
} ) ;
433
439
}
434
440
@@ -601,7 +607,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
601
607
try {
602
608
await resolveConnectionSpec ( serverName ) ;
603
609
} finally {
604
- await checkConnection ( true , uri ) ;
610
+ await checkConnection ( true , uri , true ) ;
605
611
}
606
612
} catch ( _ ) {
607
613
// Ignore any failure
@@ -1067,7 +1073,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
1067
1073
refreshFilesExplorer = true ;
1068
1074
}
1069
1075
try {
1070
- await checkConnection ( true , folder . uri ) ;
1076
+ await checkConnection ( true , folder . uri , true ) ;
1071
1077
} catch ( _ ) {
1072
1078
continue ;
1073
1079
}
0 commit comments