@@ -1162,25 +1162,16 @@ export async function initFromStateAndSettings(): Promise<void> {
11621162
11631163 subKey = "extensionOutputFolder" ;
11641164 let updatedExtensionOutputFolder : string | undefined = workspaceConfiguration . get < string > ( subKey ) ;
1165- let switchedToDefault : boolean = false ;
11661165 if ( updatedExtensionOutputFolder ) {
11671166 updatedExtensionOutputFolder = util . resolvePathToRoot ( updatedExtensionOutputFolder ) ;
1168- if ( ! util . checkDirectoryExistsSync ( updatedExtensionOutputFolder ) ) {
1169- logger . message ( `Provided extension output folder does not exist: ${ updatedExtensionOutputFolder } .` ) ;
1170- let defaultExtensionOutputFolder : string | undefined = workspaceConfiguration . inspect < string > ( subKey ) ?. defaultValue ;
1171- if ( defaultExtensionOutputFolder ) {
1172- logger . message ( `Switching to default: ${ defaultExtensionOutputFolder } .` ) ;
1173- updatedExtensionOutputFolder = util . resolvePathToRoot ( defaultExtensionOutputFolder ) ;
1174- // This will trigger another settings changed event
1175- workspaceConfiguration . update ( subKey , defaultExtensionOutputFolder ) ;
1176- updatedSettingsSubkeys . push ( subKey ) ;
1177- // to prevent the below readExtensionOutputFolder to be executed now,
1178- // it will during the next immediate changed event
1179- switchedToDefault = true ;
1180- }
1181- }
1167+ if ( ! util . checkDirectoryExistsSync ( updatedExtensionOutputFolder ) &&
1168+ ! util . createDirectorySync ( updatedExtensionOutputFolder ) ) {
1169+ // No logging necessary about not being able to create the directory,
1170+ // readExtensionOutputFolder called below will complain if it's the case.
1171+ updatedExtensionOutputFolder = undefined ;
1172+ }
11821173 }
1183- if ( updatedExtensionOutputFolder !== extensionOutputFolder && ! switchedToDefault ) {
1174+ if ( updatedExtensionOutputFolder !== extensionOutputFolder ) {
11841175 // No IntelliSense update needed.
11851176 readExtensionOutputFolder ( ) ;
11861177 updatedSettingsSubkeys . push ( subKey ) ;
0 commit comments