contextkey.ts ×9

Frontier kind: Code frontier

unlabeled · c_860359ebae12

1098 tests · 6130 LOC · 29 files · introduces 0 tests · 23 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges23 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
986 ranges6130 lines · 29 files · Browse complete extent
All tests (intent)
1098 testsBrowse complete intent

Neighbourhood graph

The orange circle is the focus. Violet and green circles are every ancestor and descendant, broader and narrower, at any distance; blue squares and pink diamonds are the introduced files and exact introduced tests of every visible concept, not only the focus's. Arrows point from broader to narrower concepts and bridge only concepts omitted from this view. Undirected links show source or test introduction. Concept and file size follows LOC; exact test nodes use test-count units.

Introduced files, introduced tests, and structurally relevant concept specialization

In the embedded map, ordinary wheel input scrolls the page; use the visible controls to zoom and drag to pan. Open the full-screen map for canvas navigation: wheel pans, Ctrl/Command plus wheel zooms, and arrow keys pan when this region is focused. On touch screens, open the full-screen map to pan or pinch. If JavaScript or WebGL is unavailable, use the native relationship evidence on this page.

Graph controls are ready.

Interactive rendering requires JavaScript and WebGL. Use the native relationship evidence on this page while the interactive map is unavailable.

Native relationship evidence

Every exact file and test below is linked only from the concept that introduces it.

Introduced tests

Every collected test enters the hierarchy at exactly one concept.

No tests are introduced at this concept. Its intent tests are introduced by other concepts.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

1 file ranked by introduced lines: 23 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/contextkey/common/contextkey.ts 23 introduced LOC · 9 ranges

Open complete file

607 }
608 public static and(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined {
609 > return ContextKeyAndExpr.create(expr, null, true); contextkey.ts
610 > }
611 public static or(...expr: Array<ContextKeyExpression | undefined | null>): ContextKeyExpression | undefined {
612 return ContextKeyOrExpr.create(expr, null, true);
1659
1660 private static _normalizeArr(arr: ReadonlyArray<ContextKeyExpression | null | undefined>, negated: ContextKeyExpression | null, extraRedundantCheck: boolean): ContextKeyExpression | undefined {
1661 > const expr: ContextKeyExpression[] = []; contextkey.ts
1662 > let hasTrue = false;
1663 >
1664 > for (const e of arr) {
1665 > if (!e) {
1666 continue;
1667 }
1668 > contextkey.ts
1669 > if (e.type === ContextKeyExprType.True) {
1670 // anything && true ==> anything
1671 hasTrue = true;
1672 continue;
1673 }
1674 > contextkey.ts
1675 > if (e.type === ContextKeyExprType.False) {
1676 // anything && false ==> false
1677 return ContextKeyFalseExpr.INSTANCE;
1678 }
1679 > contextkey.ts
1680 > if (e.type === ContextKeyExprType.And) {
1681 expr.push(...e.expr);
1682 continue;
1683 }
1684 > contextkey.ts
1685 > expr.push(e);
1686 > }
1687 >
1688 > if (expr.length === 0 && hasTrue) {
1689 return ContextKeyTrueExpr.INSTANCE;
1690 }
1691 > contextkey.ts
1692 > if (expr.length === 0) {
1693 return undefined;
1694 }
1695 > contextkey.ts
1696 > if (expr.length === 1) {
1697 return expr[0];
1698 }
1761
1762 return new ContextKeyAndExpr(expr, negated);
1763 > } contextkey.ts
1764
1765 public serialize(): string {