Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/debug/common/breakpoints.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 { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
7
import { IBreakpointContribution } from './debug.js';
8
9
export class Breakpoints {
10
11
private breakpointsWhen: ContextKeyExpression | undefined;
12
13
constructor(
14
private readonly breakpointContribution: IBreakpointContribution,
15
@IContextKeyService private readonly contextKeyService: IContextKeyService,
16
) {
17
this.breakpointsWhen = typeof breakpointContribution.when === 'string' ? ContextKeyExpr.deserialize(breakpointContribution.when) : undefined;
18
}
19
20
get language(): string {
21
return this.breakpointContribution.language;
22
}
23
24
get enabled(): boolean {
25
return !this.breakpointsWhen || this.contextKeyService.contextMatchesRules(this.breakpointsWhen);
26
}
27
}
28
29