@@ -232,7 +232,11 @@ export function getResolvedConnectionSpec(key: string, dflt: any): any {
232232 */
233233export const cspApps : Map < string , string [ ] > = new Map ( ) ;
234234
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 > {
236240 // Do nothing if already checking the connection
237241 if ( checkingConnection ) {
238242 return ;
@@ -419,16 +423,18 @@ export async function checkConnection(clearCookies = false, uri?: vscode.Uri): P
419423 } )
420424 . finally ( ( ) => {
421425 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+ }
432438 } ) ;
433439}
434440
@@ -601,7 +607,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
601607 try {
602608 await resolveConnectionSpec ( serverName ) ;
603609 } finally {
604- await checkConnection ( true , uri ) ;
610+ await checkConnection ( true , uri , true ) ;
605611 }
606612 } catch ( _ ) {
607613 // Ignore any failure
@@ -1067,7 +1073,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
10671073 refreshFilesExplorer = true ;
10681074 }
10691075 try {
1070- await checkConnection ( true , folder . uri ) ;
1076+ await checkConnection ( true , folder . uri , true ) ;
10711077 } catch ( _ ) {
10721078 continue ;
10731079 }
0 commit comments