@@ -11,7 +11,7 @@ import { Action } from 'vs/base/common/actions';
1111import { SyncActionDescriptor , MenuId , MenuRegistry } from 'vs/platform/actions/common/actions' ;
1212import { IWorkbenchActionRegistry , Extensions } from 'vs/workbench/common/actions' ;
1313import { IConfigurationService , ConfigurationTarget } from 'vs/platform/configuration/common/configuration' ;
14- import { IPartService , Parts , Position } from 'vs/workbench/services/part /browser/partService ' ;
14+ import { IWorkbenchLayoutService , Parts , Position } from 'vs/workbench/services/layout /browser/layoutService ' ;
1515import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
1616import { IEditorGroupsService , GroupOrientation } from 'vs/workbench/services/editor/common/editorGroupsService' ;
1717import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
@@ -39,16 +39,16 @@ export class ToggleActivityBarVisibilityAction extends Action {
3939 constructor (
4040 id : string ,
4141 label : string ,
42- @IPartService private readonly partService : IPartService ,
42+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService ,
4343 @IConfigurationService private readonly configurationService : IConfigurationService
4444 ) {
4545 super ( id , label ) ;
4646
47- this . enabled = ! ! this . partService ;
47+ this . enabled = ! ! this . layoutService ;
4848 }
4949
5050 run ( ) : Promise < any > {
51- const visibility = this . partService . isVisible ( Parts . ACTIVITYBAR_PART ) ;
51+ const visibility = this . layoutService . isVisible ( Parts . ACTIVITYBAR_PART ) ;
5252 const newVisibilityValue = ! visibility ;
5353
5454 return this . configurationService . updateValue ( ToggleActivityBarVisibilityAction . activityBarVisibleKey , newVisibilityValue , ConfigurationTarget . USER ) ;
@@ -76,14 +76,14 @@ class ToggleCenteredLayout extends Action {
7676 constructor (
7777 id : string ,
7878 label : string ,
79- @IPartService private readonly partService : IPartService
79+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService
8080 ) {
8181 super ( id , label ) ;
82- this . enabled = ! ! this . partService ;
82+ this . enabled = ! ! this . layoutService ;
8383 }
8484
8585 run ( ) : Promise < any > {
86- this . partService . centerEditorLayout ( ! this . partService . isEditorLayoutCentered ( ) ) ;
86+ this . layoutService . centerEditorLayout ( ! this . layoutService . isEditorLayoutCentered ( ) ) ;
8787
8888 return Promise . resolve ( ) ;
8989 }
@@ -180,23 +180,23 @@ export class ToggleSidebarPositionAction extends Action {
180180 constructor (
181181 id : string ,
182182 label : string ,
183- @IPartService private readonly partService : IPartService ,
183+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService ,
184184 @IConfigurationService private readonly configurationService : IConfigurationService
185185 ) {
186186 super ( id , label ) ;
187187
188- this . enabled = ! ! this . partService && ! ! this . configurationService ;
188+ this . enabled = ! ! this . layoutService && ! ! this . configurationService ;
189189 }
190190
191191 run ( ) : Promise < any > {
192- const position = this . partService . getSideBarPosition ( ) ;
192+ const position = this . layoutService . getSideBarPosition ( ) ;
193193 const newPositionValue = ( position === Position . LEFT ) ? 'right' : 'left' ;
194194
195195 return this . configurationService . updateValue ( ToggleSidebarPositionAction . sidebarPositionConfigurationKey , newPositionValue , ConfigurationTarget . USER ) ;
196196 }
197197
198- static getLabel ( partService : IPartService ) : string {
199- return partService . getSideBarPosition ( ) === Position . LEFT ? nls . localize ( 'moveSidebarRight' , "Move Side Bar Right" ) : nls . localize ( 'moveSidebarLeft' , "Move Side Bar Left" ) ;
198+ static getLabel ( layoutService : IWorkbenchLayoutService ) : string {
199+ return layoutService . getSideBarPosition ( ) === Position . LEFT ? nls . localize ( 'moveSidebarRight' , "Move Side Bar Right" ) : nls . localize ( 'moveSidebarLeft' , "Move Side Bar Left" ) ;
200200 }
201201}
202202
@@ -220,16 +220,16 @@ export class ToggleEditorVisibilityAction extends Action {
220220 constructor (
221221 id : string ,
222222 label : string ,
223- @IPartService private readonly partService : IPartService
223+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService
224224 ) {
225225 super ( id , label ) ;
226226
227- this . enabled = ! ! this . partService ;
227+ this . enabled = ! ! this . layoutService ;
228228 }
229229
230230 run ( ) : Promise < any > {
231- const hideEditor = this . partService . isVisible ( Parts . EDITOR_PART ) ;
232- this . partService . setEditorHidden ( hideEditor ) ;
231+ const hideEditor = this . layoutService . isVisible ( Parts . EDITOR_PART ) ;
232+ this . layoutService . setEditorHidden ( hideEditor ) ;
233233
234234 return Promise . resolve ( ) ;
235235 }
@@ -247,16 +247,16 @@ export class ToggleSidebarVisibilityAction extends Action {
247247 constructor (
248248 id : string ,
249249 label : string ,
250- @IPartService private readonly partService : IPartService
250+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService
251251 ) {
252252 super ( id , label ) ;
253253
254- this . enabled = ! ! this . partService ;
254+ this . enabled = ! ! this . layoutService ;
255255 }
256256
257257 run ( ) : Promise < any > {
258- const hideSidebar = this . partService . isVisible ( Parts . SIDEBAR_PART ) ;
259- this . partService . setSideBarHidden ( hideSidebar ) ;
258+ const hideSidebar = this . layoutService . isVisible ( Parts . SIDEBAR_PART ) ;
259+ this . layoutService . setSideBarHidden ( hideSidebar ) ;
260260
261261 return Promise . resolve ( ) ;
262262 }
@@ -285,16 +285,16 @@ class ToggleStatusbarVisibilityAction extends Action {
285285 constructor (
286286 id : string ,
287287 label : string ,
288- @IPartService private readonly partService : IPartService ,
288+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService ,
289289 @IConfigurationService private readonly configurationService : IConfigurationService
290290 ) {
291291 super ( id , label ) ;
292292
293- this . enabled = ! ! this . partService ;
293+ this . enabled = ! ! this . layoutService ;
294294 }
295295
296296 run ( ) : Promise < any > {
297- const visibility = this . partService . isVisible ( Parts . STATUSBAR_PART ) ;
297+ const visibility = this . layoutService . isVisible ( Parts . STATUSBAR_PART ) ;
298298 const newVisibilityValue = ! visibility ;
299299
300300 return this . configurationService . updateValue ( ToggleStatusbarVisibilityAction . statusbarVisibleKey , newVisibilityValue , ConfigurationTarget . USER ) ;
@@ -353,14 +353,14 @@ class ToggleZenMode extends Action {
353353 constructor (
354354 id : string ,
355355 label : string ,
356- @IPartService private readonly partService : IPartService
356+ @IWorkbenchLayoutService private readonly layoutService : IWorkbenchLayoutService
357357 ) {
358358 super ( id , label ) ;
359- this . enabled = ! ! this . partService ;
359+ this . enabled = ! ! this . layoutService ;
360360 }
361361
362362 run ( ) : Promise < any > {
363- this . partService . toggleZenMode ( ) ;
363+ this . layoutService . toggleZenMode ( ) ;
364364
365365 return Promise . resolve ( ) ;
366366 }
@@ -381,8 +381,8 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
381381 id : 'workbench.action.exitZenMode' ,
382382 weight : KeybindingWeight . EditorContrib - 1000 ,
383383 handler ( accessor : ServicesAccessor ) {
384- const partService = accessor . get ( IPartService ) ;
385- partService . toggleZenMode ( ) ;
384+ const layoutService = accessor . get ( IWorkbenchLayoutService ) ;
385+ layoutService . toggleZenMode ( ) ;
386386 } ,
387387 when : InEditorZenModeContext ,
388388 primary : KeyChord ( KeyCode . Escape , KeyCode . Escape )
@@ -447,15 +447,15 @@ export abstract class BaseResizeViewAction extends Action {
447447 constructor (
448448 id : string ,
449449 label : string ,
450- @IPartService protected partService : IPartService
450+ @IWorkbenchLayoutService protected layoutService : IWorkbenchLayoutService
451451 ) {
452452 super ( id , label ) ;
453453 }
454454
455455 protected resizePart ( sizeChange : number ) : void {
456- const isEditorFocus = this . partService . hasFocus ( Parts . EDITOR_PART ) ;
457- const isSidebarFocus = this . partService . hasFocus ( Parts . SIDEBAR_PART ) ;
458- const isPanelFocus = this . partService . hasFocus ( Parts . PANEL_PART ) ;
456+ const isEditorFocus = this . layoutService . hasFocus ( Parts . EDITOR_PART ) ;
457+ const isSidebarFocus = this . layoutService . hasFocus ( Parts . SIDEBAR_PART ) ;
458+ const isPanelFocus = this . layoutService . hasFocus ( Parts . PANEL_PART ) ;
459459
460460 let part : Parts | undefined ;
461461 if ( isSidebarFocus ) {
@@ -467,7 +467,7 @@ export abstract class BaseResizeViewAction extends Action {
467467 }
468468
469469 if ( part ) {
470- this . partService . resizePart ( part , sizeChange ) ;
470+ this . layoutService . resizePart ( part , sizeChange ) ;
471471 }
472472 }
473473}
@@ -480,9 +480,9 @@ export class IncreaseViewSizeAction extends BaseResizeViewAction {
480480 constructor (
481481 id : string ,
482482 label : string ,
483- @IPartService partService : IPartService
483+ @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService
484484 ) {
485- super ( id , label , partService ) ;
485+ super ( id , label , layoutService ) ;
486486 }
487487
488488 run ( ) : Promise < boolean > {
@@ -499,10 +499,10 @@ export class DecreaseViewSizeAction extends BaseResizeViewAction {
499499 constructor (
500500 id : string ,
501501 label : string ,
502- @IPartService partService : IPartService
502+ @IWorkbenchLayoutService layoutService : IWorkbenchLayoutService
503503
504504 ) {
505- super ( id , label , partService ) ;
505+ super ( id , label , layoutService ) ;
506506 }
507507
508508 run ( ) : Promise < boolean > {
0 commit comments