Path: blob/main/src/vs/workbench/contrib/debug/common/breakpoints.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 { ContextKeyExpr, ContextKeyExpression, IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';6import { IBreakpointContribution } from './debug.js';78export class Breakpoints {910private breakpointsWhen: ContextKeyExpression | undefined;1112constructor(13private readonly breakpointContribution: IBreakpointContribution,14@IContextKeyService private readonly contextKeyService: IContextKeyService,15) {16this.breakpointsWhen = typeof breakpointContribution.when === 'string' ? ContextKeyExpr.deserialize(breakpointContribution.when) : undefined;17}1819get language(): string {20return this.breakpointContribution.language;21}2223get enabled(): boolean {24return !this.breakpointsWhen || this.contextKeyService.contextMatchesRules(this.breakpointsWhen);25}26}272829