@@ -8,7 +8,7 @@ import { localize } from 'vs/nls';
88import { registerColor , contrastBorder } from 'vs/platform/theme/common/colorRegistry' ;
99import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
1010import { IWorkbenchLayoutService , Parts } from 'vs/workbench/services/layout/browser/layoutService' ;
11- import { IDebugService , State } from 'vs/workbench/contrib/debug/common/debug' ;
11+ import { IDebugService , State , IDebugSession } from 'vs/workbench/contrib/debug/common/debug' ;
1212import { IWorkspaceContextService , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
1313import { STATUS_BAR_NO_FOLDER_BACKGROUND , STATUS_BAR_NO_FOLDER_FOREGROUND , STATUS_BAR_BACKGROUND , Themable , STATUS_BAR_FOREGROUND , STATUS_BAR_NO_FOLDER_BORDER , STATUS_BAR_BORDER } from 'vs/workbench/common/theme' ;
1414import { addClass , removeClass , createStyleSheet } from 'vs/base/browser/dom' ;
@@ -58,7 +58,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
5858 super . updateStyles ( ) ;
5959
6060 const container = assertIsDefined ( this . layoutService . getContainer ( Parts . STATUSBAR_PART ) ) ;
61- if ( isStatusbarInDebugMode ( this . debugService ) ) {
61+ if ( isStatusbarInDebugMode ( this . debugService . state , this . debugService . getViewModel ( ) . focusedSession ) ) {
6262 addClass ( container , 'debugging' ) ;
6363 } else {
6464 removeClass ( container , 'debugging' ) ;
@@ -90,7 +90,7 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
9090 private getColorKey ( noFolderColor : string , debuggingColor : string , normalColor : string ) : string {
9191
9292 // Not debugging
93- if ( ! isStatusbarInDebugMode ( this . debugService ) ) {
93+ if ( ! isStatusbarInDebugMode ( this . debugService . state , this . debugService . getViewModel ( ) . focusedSession ) ) {
9494 if ( this . contextService . getWorkbenchState ( ) !== WorkbenchState . EMPTY ) {
9595 return normalColor ;
9696 }
@@ -103,12 +103,10 @@ export class StatusBarColorProvider extends Themable implements IWorkbenchContri
103103 }
104104}
105105
106- function isStatusbarInDebugMode ( debugService : IDebugService ) : boolean {
107- if ( debugService . state === State . Inactive || debugService . state === State . Initializing ) {
106+ export function isStatusbarInDebugMode ( state : State , session : IDebugSession | undefined ) : boolean {
107+ if ( state === State . Inactive || state === State . Initializing ) {
108108 return false ;
109109 }
110-
111- const session = debugService . getViewModel ( ) . focusedSession ;
112110 const isRunningWithoutDebug = session ?. configuration ?. noDebug ;
113111 if ( isRunningWithoutDebug ) {
114112 return false ;
0 commit comments