textModel.ts ×8

Frontier kind: Code frontier

unlabeled · c_d0fa3a096f36

11 tests · 40482 LOC · 238 files · introduces 0 tests · 38 LOC · 3 files

Introduces — evidence that enters the hierarchy at this concept

Code
14 ranges38 lines · 3 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4892 ranges40482 lines · 238 files · Browse complete extent
All tests (intent)
11 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.

3 files ranked by introduced lines: 38 introduced LOC across 14 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/textModel.ts 26 introduced LOC · 8 ranges

Open complete file

133
134 constructor(source: model.ITextSnapshot) {
135 > this._source = source; textModel.ts
136 > this._eos = false;
137 > }
138
139 public read(): string | null {
140 > if (this._eos) { textModel.ts
141 return null;
142 }
143 > textModel.ts
144 > const result: string[] = [];
145 > let resultCnt = 0;
146 > let resultLength = 0;
147 >
148 > do {
149 > const tmp = this._source.read();
150 >
151 > if (tmp === null) {
152 > // end-of-stream
153 > this._eos = true;
154 > if (resultCnt === 0) {
155 return null;
156 > } else { textModel.ts
157 return result.join('');
158 }
159 > } textModel.ts
160 >
161 > if (tmp.length > 0) {
162 result[resultCnt++] = tmp;
163 resultLength += tmp.length;
164 }
165 > textModel.ts
166 > if (resultLength >= 64 * 1024) {
167 return result.join('');
168 }
169 > } while (true); textModel.ts
170 > }
171 }
172
814
815 public createSnapshot(preserveBOM: boolean = false): model.ITextSnapshot {
816 > return new TextModelSnapshot(this._buffer.createSnapshot(preserveBOM)); textModel.ts
817 > }
818
819 public getValueLength(eol?: model.EndOfLinePreference, preserveBOM: boolean = false): number {
src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 10 introduced LOC · 5 ranges

Open complete file

164
165 constructor(tree: PieceTreeBase, BOM: string) {
166 > this._pieces = []; pieceTreeBase.ts
167 > this._tree = tree;
168 > this._BOM = BOM;
169 > this._index = 0;
170 > if (tree.root !== SENTINEL) {
171 tree.iterate(tree.root, node => {
172 if (node !== SENTINEL) {
176 });
177 }
179
180 read(): string | null {
181 > if (this._pieces.length === 0) { pieceTreeBase.ts
182 if (this._index === 0) {
183 this._index++;
196 }
197 return this._tree.getPieceContent(this._pieces[this._index++]);
199 }
200
364
365 public createSnapshot(BOM: string): ITextSnapshot {
366 > return new PieceTreeSnapshot(this, BOM); pieceTreeBase.ts
367 > }
368
369 public equal(other: PieceTreeBase): boolean {
src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts 2 introduced LOC · 1 range

Open complete file

84
85 public createSnapshot(preserveBOM: boolean): ITextSnapshot {
86 > return this._pieceTree.createSnapshot(preserveBOM ? this._BOM : ''); pieceTreeTextBuffer.ts
87 > }
88
89 public getOffsetAt(lineNumber: number, column: number): number {