@@ -28,7 +28,7 @@ import { CancellationToken } from 'vs/base/common/cancellation';
28
28
import { ConfigurationTarget , IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
29
29
import { ContextKeyExpr , ContextKeyExpression , IContextKeyService , RawContextKey } from 'vs/platform/contextkey/common/contextkey' ;
30
30
import { IRecentFolder , IRecentlyOpened , IRecentWorkspace , isRecentFolder , isRecentWorkspace , IWorkspacesService } from 'vs/platform/workspaces/common/workspaces' ;
31
- import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
31
+ import { IWorkspaceContextService , UNKNOWN_EMPTY_WINDOW_WORKSPACE } from 'vs/platform/workspace/common/workspace' ;
32
32
import { ILabelService , Verbosity } from 'vs/platform/label/common/label' ;
33
33
import { IWindowOpenable } from 'vs/platform/window/common/window' ;
34
34
import { splitName } from 'vs/base/common/labels' ;
@@ -60,7 +60,7 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
60
60
import { KeyCode } from 'vs/base/common/keyCodes' ;
61
61
import { getTelemetryLevel } from 'vs/platform/telemetry/common/telemetryUtils' ;
62
62
import { WorkbenchStateContext } from 'vs/workbench/common/contextkeys' ;
63
- import { OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions' ;
63
+ import { OpenFolderAction , OpenFileFolderAction , OpenFolderViaWorkspaceAction } from 'vs/workbench/browser/actions/workspaceActions' ;
64
64
import { OpenRecentAction } from 'vs/workbench/browser/actions/windowActions' ;
65
65
import { Toggle } from 'vs/base/browser/ui/toggle/toggle' ;
66
66
import { Codicon } from 'vs/base/common/codicons' ;
@@ -1227,6 +1227,28 @@ export class GettingStartedPage extends EditorPane {
1227
1227
if ( ! Array . isArray ( args ) ) {
1228
1228
args = [ args ] ;
1229
1229
}
1230
+
1231
+ // If a step is requesting the OpenFolder action to be executed in an empty workspace...
1232
+ if ( ( commandURI . path === OpenFileFolderAction . ID . toString ( ) ||
1233
+ commandURI . path === OpenFolderAction . ID . toString ( ) ) &&
1234
+ this . workspaceContextService . getWorkspace ( ) . folders . length === 0 ) {
1235
+
1236
+ const selectedStepIndex = this . currentWalkthrough ?. steps . findIndex ( step => step . id === this . editorInput . selectedStep ) ;
1237
+
1238
+ // and there are a few more steps after this step which are yet to be completed...
1239
+ if ( selectedStepIndex !== undefined &&
1240
+ selectedStepIndex > - 1 &&
1241
+ this . currentWalkthrough ?. steps . slice ( selectedStepIndex + 1 ) . some ( step => ! step . done ) ) {
1242
+ const restoreData : RestoreWalkthroughsConfigurationValue = { folder : UNKNOWN_EMPTY_WINDOW_WORKSPACE . id , category : this . editorInput . selectedCategory , step : this . editorInput . selectedStep } ;
1243
+
1244
+ // save state to restore after reload
1245
+ this . storageService . store (
1246
+ restoreWalkthroughsConfigurationKey ,
1247
+ JSON . stringify ( restoreData ) ,
1248
+ StorageScope . PROFILE , StorageTarget . MACHINE ) ;
1249
+ }
1250
+ }
1251
+
1230
1252
this . commandService . executeCommand ( commandURI . path , ...args ) . then ( result => {
1231
1253
const toOpen : URI = result ?. openFolder ;
1232
1254
if ( toOpen ) {
0 commit comments