pieceTreeBase.ts ×7

Frontier kind: Code frontier

unlabeled · c_15a171a1d61f

596 tests · 35925 LOC · 206 files · introduces 0 tests · 27 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges27 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4102 ranges35925 lines · 206 files · Browse complete extent
All tests (intent)
596 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: 27 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 20 introduced LOC · 7 ranges

Open complete file

69 let isBasicASCII = true;
70 for (let i = 0, len = str.length; i < len; i++) {
71 > const chr = str.charCodeAt(i); pieceTreeBase.ts
72 >
73 > if (chr === CharCode.CarriageReturn) {
74 if (i + 1 < len && str.charCodeAt(i + 1) === CharCode.LineFeed) {
75 // \r\n... case
82 r[rLength++] = i + 1;
83 }
84 > } else if (chr === CharCode.LineFeed) { pieceTreeBase.ts
85 lf++;
86 r[rLength++] = i + 1;
87 > } else { pieceTreeBase.ts
88 if (isBasicASCII) {
89 if (chr !== CharCode.Tab && (chr < 32 || chr > 126)) {
92 }
93 }
95 const result = new LineStarts(createUintArray(r), cr, lf, crlf, isBasicASCII);
96 r.length = 0;
297 for (let i = 0, len = chunks.length; i < len; i++) {
298 if (chunks[i].buffer.length > 0) {
299 > if (!chunks[i].lineStarts) { pieceTreeBase.ts
300 chunks[i].lineStarts = createLineStartsFast(chunks[i].buffer);
301 }
303 > const piece = new Piece(
304 > i + 1,
305 > { line: 0, column: 0 },
306 > { line: chunks[i].lineStarts.length - 1, column: chunks[i].buffer.length - chunks[i].lineStarts[chunks[i].lineStarts.length - 1] },
307 > chunks[i].lineStarts.length - 1,
308 > chunks[i].buffer.length
309 > );
310 > this._buffers.push(chunks[i]);
311 > lastNode = this.rbInsertRight(lastNode, piece);
312 > }
313 }
314
1823 const x = this.root;
1824 if (x === SENTINEL) {
1825 > this.root = z; pieceTreeBase.ts
1826 > z.color = NodeColor.Black;
1827 } else if (node!.right === SENTINEL) {
1828 node!.right = z;
src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBufferBuilder.ts 7 introduced LOC · 3 ranges

Open complete file

100 return;
101 }
103 > if (this.chunks.length === 0) {
104 > if (strings.startsWithUTF8BOM(chunk)) {
105 this.BOM = strings.UTF8_BOM_CHARACTER;
106 chunk = chunk.substr(1);
107 }
109 >
110 > const lastChar = chunk.charCodeAt(chunk.length - 1);
111 if (lastChar === CharCode.CarriageReturn || (lastChar >= 0xD800 && lastChar <= 0xDBFF)) {
112 // last character is \r or a high surrogate => keep it back
114 this._hasPreviousChar = true;
115 this._previousChar = lastChar;
117 this._acceptChunk1(chunk, false);
118 this._hasPreviousChar = false;