@@ -8,6 +8,7 @@ import tutorialConfig from '../actions/tutorialConfig'
8
8
import { COMMANDS } from '../editor/commands'
9
9
import logger from '../services/logger'
10
10
import Context from './context'
11
+ import { openWorkspace , checkWorkspaceEmpty } from '../services/workspace'
11
12
12
13
interface Channel {
13
14
receive ( action :T . Action ) :Promise < void >
@@ -108,6 +109,15 @@ class Channel implements Channel {
108
109
// update the current stepId on startup
109
110
vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )
110
111
return
112
+ case 'EDITOR_CHECK_WORKSPACE' :
113
+ const isEmptyWorkspace = await checkWorkspaceEmpty ( this . workspaceRoot . uri . path )
114
+ if ( isEmptyWorkspace ) {
115
+ this . send ( { type :'IS_EMPTY_WORKSPACE' } )
116
+ } else {
117
+ openWorkspace ( )
118
+ this . send ( { type :'REQUEST_WORKSPACE' } )
119
+ }
120
+ return
111
121
// load step actions (git commits, commands, open files)
112
122
case 'SETUP_ACTIONS' :
113
123
await vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )