characterClassifier.ts ×4

Frontier kind: Code frontier

unlabeled · c_b44530951b76

76 tests · 3492 LOC · 20 files · introduces 0 tests · 20 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
7 ranges20 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
499 ranges3492 lines · 20 files · Browse complete extent
All tests (intent)
76 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.

2 files ranked by introduced lines: 20 introduced LOC across 7 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/core/characterClassifier.ts 16 introduced LOC · 4 ranges

Open complete file

23
24 constructor(_defaultValue: T) {
25 > const defaultValue = toUint8(_defaultValue); characterClassifier.ts
26 >
27 > this._defaultValue = defaultValue;
28 > this._asciiMap = CharacterClassifier._createAsciiMap(defaultValue);
29 > this._map = new Map<number, number>();
30 > }
31
32 private static _createAsciiMap(defaultValue: number): Uint8Array {
33 > const asciiMap = new Uint8Array(256); characterClassifier.ts
34 > asciiMap.fill(defaultValue);
35 > return asciiMap;
36 > }
37
38 public set(charCode: number, _value: T): void {
39 > const value = toUint8(_value); characterClassifier.ts
40 >
41 > if (charCode >= 0 && charCode < 256) {
42 > this._asciiMap[charCode] = value;
43 > } else {
44 this._map.set(charCode, value);
45 }
47
48 public get(charCode: number): T {
src/vs/base/common/uint.ts 4 introduced LOC · 3 ranges

Open complete file

40
41 export function toUint8(v: number): number {
42 > if (v < 0) { uint.ts
43 return 0;
44 }
45 > if (v > Constants.MAX_UINT_8) { uint.ts
46 return Constants.MAX_UINT_8;
47 }
48 > return v | 0; uint.ts
49 > }
50
51 export function toUint32(v: number): number {