@@ -8,6 +8,7 @@ import tutorialConfig from '../actions/tutorialConfig'
88import { COMMANDS } from '../editor/commands'
99import logger from '../services/logger'
1010import Context from './context'
11+ import { openWorkspace , checkWorkspaceEmpty } from '../services/workspace'
1112
1213interface Channel {
1314receive ( action :T . Action ) :Promise < void >
@@ -108,6 +109,15 @@ class Channel implements Channel {
108109// update the current stepId on startup
109110vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )
110111return
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
111121// load step actions (git commits, commands, open files)
112122case 'SETUP_ACTIONS' :
113123await vscode . commands . executeCommand ( COMMANDS . SET_CURRENT_STEP , action . payload )