Path: blob/main/src/vs/workbench/contrib/debug/browser/debugTitle.ts
3296 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { IWorkbenchContribution } from '../../../common/contributions.js';6import { IDebugService, State } from '../common/debug.js';7import { dispose, IDisposable } from '../../../../base/common/lifecycle.js';8import { IHostService } from '../../../services/host/browser/host.js';9import { ITitleService } from '../../../services/title/browser/titleService.js';1011export class DebugTitleContribution implements IWorkbenchContribution {1213private toDispose: IDisposable[] = [];1415constructor(16@IDebugService debugService: IDebugService,17@IHostService hostService: IHostService,18@ITitleService titleService: ITitleService19) {20const updateTitle = () => {21if (debugService.state === State.Stopped && !hostService.hasFocus) {22titleService.updateProperties({ prefix: '🔴' });23} else {24titleService.updateProperties({ prefix: '' });25}26};27this.toDispose.push(debugService.onDidChangeState(updateTitle));28this.toDispose.push(hostService.onDidChangeFocus(updateTitle));29}3031dispose(): void {32dispose(this.toDispose);33}34}353637