@@ -15,7 +15,6 @@ import DOM = require('vs/base/browser/dom');
1515import { Builder , $ } from 'vs/base/browser/builder' ;
1616import { Delayer , RunOnceScheduler } from 'vs/base/common/async' ;
1717import * as browser from 'vs/base/browser/browser' ;
18- import assert = require( 'vs/base/common/assert' ) ;
1918import { StopWatch } from 'vs/base/common/stopwatch' ;
2019import { startTimer } from 'vs/base/node/startupTimers' ;
2120import errors = require( 'vs/base/common/errors' ) ;
@@ -267,9 +266,6 @@ export class Workbench implements IPartService {
267266 * once. Use the shutdown function to free up resources created by the workbench on startup.
268267 */
269268 public startup ( callbacks ?: IWorkbenchCallbacks ) : void {
270- assert . ok ( ! this . workbenchStarted , 'Can not start a workbench that was already started' ) ;
271- assert . ok ( ! this . workbenchShutdown , 'Can not start a workbench that was shutdown' ) ;
272-
273269 try {
274270 this . workbenchStarted = true ;
275271 this . callbacks = callbacks ;
@@ -1224,26 +1220,18 @@ export class Workbench implements IPartService {
12241220 }
12251221
12261222 public getEditorPart ( ) : EditorPart {
1227- assert . ok ( this . workbenchStarted , 'Workbench is not started. Call startup() first.' ) ;
1228-
12291223 return this . editorPart ;
12301224 }
12311225
12321226 public getSidebarPart ( ) : SidebarPart {
1233- assert . ok ( this . workbenchStarted , 'Workbench is not started. Call startup() first.' ) ;
1234-
12351227 return this . sidebarPart ;
12361228 }
12371229
12381230 public getPanelPart ( ) : PanelPart {
1239- assert . ok ( this . workbenchStarted , 'Workbench is not started. Call startup() first.' ) ;
1240-
12411231 return this . panelPart ;
12421232 }
12431233
12441234 public getInstantiationService ( ) : IInstantiationService {
1245- assert . ok ( this . workbenchStarted , 'Workbench is not started. Call startup() first.' ) ;
1246-
12471235 return this . instantiationService ;
12481236 }
12491237
@@ -1265,6 +1253,7 @@ export class Workbench implements IPartService {
12651253
12661254 public toggleZenMode ( skipLayout ?: boolean ) : void {
12671255 this . zenMode . active = ! this . zenMode . active ;
1256+
12681257 // Check if zen mode transitioned to full screen and if now we are out of zen mode -> we need to go out of full screen
12691258 let toggleFullScreen = false ;
12701259 if ( this . zenMode . active ) {
@@ -1279,33 +1268,40 @@ export class Workbench implements IPartService {
12791268 if ( config . hideActivityBar ) {
12801269 this . setActivityBarHidden ( true , true ) ;
12811270 }
1271+
12821272 if ( config . hideStatusBar ) {
12831273 this . setStatusBarHidden ( true , true ) ;
12841274 }
1275+
12851276 if ( config . hideTabs ) {
12861277 this . editorPart . hideTabs ( true ) ;
12871278 }
12881279 } else {
12891280 if ( this . zenMode . wasPanelVisible ) {
12901281 this . setPanelHidden ( false , true ) . done ( undefined , errors . onUnexpectedError ) ;
12911282 }
1283+
12921284 if ( this . zenMode . wasSideBarVisible ) {
12931285 this . setSideBarHidden ( false , true ) . done ( undefined , errors . onUnexpectedError ) ;
12941286 }
1287+
12951288 // Status bar and activity bar visibility come from settings -> update their visibility.
12961289 this . onDidUpdateConfiguration ( true ) ;
12971290 this . editorPart . hideTabs ( false ) ;
12981291 const activeEditor = this . editorPart . getActiveEditor ( ) ;
12991292 if ( activeEditor ) {
13001293 activeEditor . focus ( ) ;
13011294 }
1295+
13021296 toggleFullScreen = this . zenMode . transitionedToFullScreen && browser . isFullscreen ( ) ;
13031297 }
1298+
13041299 this . inZenMode . set ( this . zenMode . active ) ;
13051300
13061301 if ( ! skipLayout ) {
13071302 this . layout ( ) ;
13081303 }
1304+
13091305 if ( toggleFullScreen ) {
13101306 this . windowService . toggleFullScreen ( ) . done ( undefined , errors . onUnexpectedError ) ;
13111307 }
0 commit comments