MCPcopy Create free account
hub / github.com/Wscats/vscode-explore / ContextKeyTrueExpr

Class ContextKeyTrueExpr

contextKeyExpr/src/contextkey.ts:282–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282export class ContextKeyTrueExpr implements IContextKeyExpression {
283 public static INSTANCE = new ContextKeyTrueExpr();
284
285 public readonly type = ContextKeyExprType.True;
286
287 protected constructor() {
288 }
289
290 public cmp(other: ContextKeyExpression): number {
291 return this.type - other.type;
292 }
293
294 public equals(other: ContextKeyExpression): boolean {
295 return (other.type === this.type);
296 }
297
298 public evaluate(context: IContext): boolean {
299 return true;
300 }
301
302 public serialize(): string {
303 return 'true';
304 }
305
306 public keys(): string[] {
307 return [];
308 }
309
310 public map(mapFnc: IContextKeyExprMapper): ContextKeyExpression {
311 return this;
312 }
313
314 public negate(): ContextKeyExpression {
315 return ContextKeyFalseExpr.INSTANCE;
316 }
317}
318
319export class ContextKeyDefinedExpr implements IContextKeyExpression {
320 public static create(key: string): ContextKeyExpression {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected