Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/browser/debugTitle.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IWorkbenchContribution } from '../../../common/contributions.js';
7
import { IDebugService, State } from '../common/debug.js';
8
import { dispose, IDisposable } from '../../../../base/common/lifecycle.js';
9
import { IHostService } from '../../../services/host/browser/host.js';
10
import { ITitleService } from '../../../services/title/browser/titleService.js';
11
12
export class DebugTitleContribution implements IWorkbenchContribution {
13
14
private toDispose: IDisposable[] = [];
15
16
constructor(
17
@IDebugService debugService: IDebugService,
18
@IHostService hostService: IHostService,
19
@ITitleService titleService: ITitleService
20
) {
21
const updateTitle = () => {
22
if (debugService.state === State.Stopped && !hostService.hasFocus) {
23
titleService.updateProperties({ prefix: '🔴' });
24
} else {
25
titleService.updateProperties({ prefix: '' });
26
}
27
};
28
this.toDispose.push(debugService.onDidChangeState(updateTitle));
29
this.toDispose.push(hostService.onDidChangeFocus(updateTitle));
30
}
31
32
dispose(): void {
33
dispose(this.toDispose);
34
}
35
}
36
37