contextkey.ts ×7

Frontier kind: Code frontier

unlabeled · c_2654bc76debc

1097 tests · 6174 LOC · 29 files · introduces 0 tests · 28 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges28 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1000 ranges6174 lines · 29 files · Browse complete extent
All tests (intent)
1097 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: 28 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/contextkey/common/contextkey.ts 28 introduced LOC · 7 ranges

Open complete file

1697 return expr[0];
1698 }
1699 > contextkey.ts
1700 > expr.sort(cmp);
1701 >
1702 > // eliminate duplicate terms
1703 > for (let i = 1; i < expr.length; i++) {
1704 > if (expr[i - 1].equals(expr[i])) {
1705 expr.splice(i, 1);
1706 i--;
1707 }
1708 > } contextkey.ts
1709 >
1710 > if (expr.length === 1) {
1711 return expr[0];
1712 }
1713 > contextkey.ts
1714 > // We must distribute any OR expression because we don't support parens
1715 > // OR extensions will be at the end (due to sorting rules)
1716 > while (expr.length > 1) {
1717 > const lastElement = expr[expr.length - 1];
1718 > if (lastElement.type !== ContextKeyExprType.Or) {
1719 > break;
1720 > }
1721 // pop the last element
1722 expr.pop();
1738 expr.sort(cmp);
1739 }
1740 > } contextkey.ts
1741 >
1742 > if (expr.length === 1) {
1743 return expr[0];
1744 }
1745 > contextkey.ts
1746 > // resolve false AND expressions
1747 > if (extraRedundantCheck) {
1748 > for (let i = 0; i < expr.length; i++) {
1749 > for (let j = i + 1; j < expr.length; j++) {
1750 > if (expr[i].negate().equals(expr[j])) {
1751 // A && !A case
1752 return ContextKeyFalseExpr.INSTANCE;
1753 }
1754 > } contextkey.ts
1755 }
1756
1758 return expr[0];
1759 }
1760 > } contextkey.ts
1761
1762 return new ContextKeyAndExpr(expr, negated);