File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const schemas = [
1414 FILESYSTEM_SCHEMA ,
1515 FILESYSTEM_READONLY_SCHEMA ,
1616] ;
17+ export const filesystemSchemas = [ FILESYSTEM_SCHEMA , FILESYSTEM_READONLY_SCHEMA ] ;
1718
1819import * as url from "url" ;
1920import WebSocket = require( "ws" ) ;
@@ -429,6 +430,21 @@ export async function activate(context: vscode.ExtensionContext): Promise<any> {
429430 checkConnection ( true , uri ) ;
430431 } ) ;
431432
433+ vscode . workspace . onDidChangeWorkspaceFolders ( ( { added, removed } ) => {
434+ const folders = vscode . workspace . workspaceFolders ;
435+ if (
436+ folders ?. length === 1 &&
437+ added ?. length === 1 &&
438+ removed ?. length === 0 &&
439+ filesystemSchemas . includes ( added [ 0 ] . uri . scheme )
440+ ) {
441+ // First folder has been added and is one of the isfs types, so hide the ObjectScript Explorer for this workspace
442+ vscode . workspace
443+ . getConfiguration ( "objectscript" )
444+ . update ( "showExplorer" , false , vscode . ConfigurationTarget . Workspace ) ;
445+ }
446+ } ) ;
447+
432448 vscode . workspace . onDidChangeConfiguration ( ( { affectsConfiguration } ) => {
433449 if ( affectsConfiguration ( "objectscript.conn" ) ) {
434450 checkConnection ( true ) ;
You can’t perform that action at this time.
0 commit comments