@@ -61,7 +61,6 @@ import { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverServ
6161import { ITextEditorService , TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService'
6262import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService'
6363import { IUntitledTextEditorService , UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService'
64- import { StatusbarPart } from 'vs/workbench/browser/parts/statusbar/statusbarPart'
6564import { IStatusbarService } from 'vs/workbench/services/statusbar/browser/statusbar'
6665import { IHistoryService } from 'vs/workbench/services/history/common/history'
6766import { HistoryService } from 'vs/workbench/services/history/browser/historyService'
@@ -88,10 +87,8 @@ import { IStorageService } from 'vs/platform/storage/common/storage'
8887import { IThemeService } from 'vs/platform/theme/common/themeService'
8988import { ConfirmResult } from 'vs/platform/dialogs/common/dialogs'
9089import { ILayoutService } from 'vs/platform/layout/browser/layoutService'
91- import { BannerPart } from 'vs/workbench/browser/parts/banner/bannerPart'
9290import { IBannerService } from 'vs/workbench/services/banner/browser/bannerService'
9391import { ITitleService } from 'vs/workbench/services/title/common/titleService'
94- import { TitlebarPart } from 'vs/workbench/browser/parts/titlebar/titlebarPart'
9592import { MonacoDelegateEditorGroupsService , MonacoEditorService , OpenEditor } from './tools/editor'
9693import getBulkEditServiceOverride from './bulkEdit'
9794import getLayoutServiceOverride , { LayoutService } from './layout'
@@ -572,9 +569,10 @@ registerServiceInitializePostParticipant(async (accessor) => {
572569 const viewDescriptorService = accessor . get ( IViewDescriptorService )
573570
574571 // force service instantiation
575- accessor . get ( IStatusbarService )
576- accessor . get ( IBannerService )
577- accessor . get ( ITitleService )
572+ const withStatusBar = accessor . get ( IStatusbarService ) instanceof Part
573+ const withBannerPart = accessor . get ( IBannerService ) instanceof Part
574+ const withTitlePart = accessor . get ( ITitleService ) instanceof Part
575+
578576 paneCompositePartService . getPaneComposites ( ViewContainerLocation . Panel )
579577
580578 const layoutService = accessor . get ( ILayoutService ) as LayoutService
@@ -584,16 +582,20 @@ registerServiceInitializePostParticipant(async (accessor) => {
584582 document . body . append ( invisibleContainer )
585583
586584 // Create Parts
587- for ( const { id, role, classes, options } of [
588- { id : Parts . TITLEBAR_PART , role : 'none' , classes : [ 'titlebar' ] } ,
589- { id : Parts . BANNER_PART , role : 'banner' , classes : [ 'banner' ] } ,
585+ for ( const { id, role, classes, options, enabled = true } of [
586+ { id : Parts . TITLEBAR_PART , role : 'none' , classes : [ 'titlebar' ] , enabled : withTitlePart } ,
587+ { id : Parts . BANNER_PART , role : 'banner' , classes : [ 'banner' ] , enabled : withBannerPart } ,
590588 { id : Parts . ACTIVITYBAR_PART , role : 'none' , classes : [ 'activitybar' , 'left' ] } ,
591589 { id : Parts . SIDEBAR_PART , role : 'none' , classes : [ 'sidebar' , 'left' ] } ,
592590 { id : Parts . EDITOR_PART , role : 'main' , classes : [ 'editor' ] , options : { restorePreviousState : false } } ,
593591 { id : Parts . PANEL_PART , role : 'none' , classes : [ 'panel' , 'basepanel' , positionToString ( Position . BOTTOM ) ] } ,
594592 { id : Parts . AUXILIARYBAR_PART , role : 'none' , classes : [ 'auxiliarybar' , 'basepanel' , 'right' ] } ,
595- { id : Parts . STATUSBAR_PART , role : 'status' , classes : [ 'statusbar' ] }
593+ { id : Parts . STATUSBAR_PART , role : 'status' , classes : [ 'statusbar' ] , enabled : withStatusBar }
596594 ] ) {
595+ if ( ! enabled ) {
596+ continue
597+ }
598+
597599 const partContainer = createPart ( id , role , classes )
598600
599601 const part = layoutService . getPart ( id )
@@ -633,9 +635,6 @@ export default function getServiceOverride (openEditorFallback?: OpenEditor, _we
633635 [ ICodeEditorService . toString ( ) ] : new SyncDescriptor ( CodeEditorService , [ ] , true ) ,
634636 [ ITextEditorService . toString ( ) ] : new SyncDescriptor ( TextEditorService , [ ] , false ) ,
635637 [ IEditorGroupsService . toString ( ) ] : new SyncDescriptor ( MonacoEditorPart , [ ] , false ) ,
636- [ ITitleService . toString ( ) ] : new SyncDescriptor ( TitlebarPart , [ ] , false ) ,
637- [ IBannerService . toString ( ) ] : new SyncDescriptor ( BannerPart , [ ] , false ) ,
638- [ IStatusbarService . toString ( ) ] : new SyncDescriptor ( StatusbarPart , [ ] , false ) ,
639638 [ IEditorDropService . toString ( ) ] : new SyncDescriptor ( EditorDropService , [ ] , true ) ,
640639 [ IEditorService . toString ( ) ] : new SyncDescriptor ( MonacoEditorService , [ openEditorFallback , isEditorPartVisible ] , false ) ,
641640 [ IEditorResolverService . toString ( ) ] : new SyncDescriptor ( EditorResolverService , [ ] , false ) ,
@@ -680,7 +679,6 @@ export {
680679
681680 HoverService ,
682681 ActivityService ,
683- StatusbarPart ,
684682 SidebarPart ,
685683 ActivitybarPart ,
686684 PanelPart ,
0 commit comments