contextkey.ts ×5
Frontier kind: Code frontier
unlabeled · c_a48c1b2ea58e
32 tests · 7805 LOC · 37 files · introduces 0 tests · 32 LOC · 3 files
Introduces — evidence that enters the hierarchy at this concept
Code
10 ranges 32 lines · 3 files
Tests
0 tests
Contains — complete concept membership
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.
Focus concept
Ancestors (broader)
Descendants (narrower)
Introduced files
Introduced tests
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.
JavaScript is disabled; use the native relationship evidence on this page to explore the same evidence.
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.
3 files ranked by introduced lines: 32 introduced LOC across 10 ranges.
Expand a file to inspect source; the > gutter marks introduced lines.
src/vs/platform/contextkey/common/contextkey.ts 20 introduced LOC · 5 ranges
Open complete file
1563
* @returns the same instance if nothing changed.
1564
*/
1565
>
function eliminateConstantsInArray ( arr : ContextKeyExpression []) : ( ContextKeyExpression | undefined )[] {
contextkey.ts
1566
>
// Allocate array only if there is a difference
1567
>
let newArr : ( ContextKeyExpression | undefined )[] | null = null ;
1568
>
for ( let i = 0 , len = arr . length ; i < len ; i ++ ) {
1569
>
const newExpr = arr [ i ]. substituteConstants ();
1570
>
1571
>
if ( arr [ i ] !== newExpr ) {
1572
// something has changed!
1573
1580
}
1581
}
1583
>
if ( newArr !== null ) {
1584
newArr [ i ] = newExpr ;
1585
}
1587
>
1588
>
if ( newArr === null ) {
1589
>
return arr ;
1590
>
}
1591
return newArr ;
1592
}
1641
1642
public substituteConstants () : ContextKeyExpression | undefined {
1643
>
const exprArr = eliminateConstantsInArray ( this . expr );
contextkey.ts
1644
>
if ( exprArr === this . expr ) {
1645
>
// no change
1646
>
return this ;
1647
>
}
1648
return ContextKeyAndExpr . create ( exprArr , this . negated , false );
1650
1651
public evaluate ( context : IContext ) : boolean {
src/vs/platform/keybinding/common/keybindingResolver.ts 10 introduced LOC · 4 ranges
Open complete file
190
191
if ( conflict . command === item . command ) {
193
>
}
194
195
// Test if the shorter keybinding is a prefix of the longer one.
198
for ( let i = 1 ; i < conflict . chords . length && i < item . chords . length ; i ++ ) {
199
if ( conflict . chords [ i ] !== item . chords [ i ]) {
201
>
isShorterKbPrefix = false ;
202
>
break ;
203
>
}
204
}
205
if ( ! isShorterKbPrefix ) {
207
>
}
208
209
if ( KeybindingResolver . whenIsEntirelyIncluded ( conflict . when , item . when )) {
258
return false ;
259
}
261
>
return implies ( a , b );
262
}
263
src/vs/platform/keybinding/test/common/keybindingsTestUtils.ts 2 introduced LOC · 1 range
Open complete file
10
export function createUSLayoutResolvedKeybinding ( encodedKeybinding : number | number [], OS : OperatingSystem ) : ResolvedKeybinding | undefined {
11
if ( encodedKeybinding === 0 ) {
13
>
}
14
const keybinding = decodeKeybinding ( encodedKeybinding , OS );
15
if ( ! keybinding ) {