pieceTreeBase.ts ×6

Frontier kind: Code frontier

unlabeled · c_63e503d8f098

231 tests · 39159 LOC · 238 files · introduces 0 tests · 14 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges14 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4553 ranges39159 lines · 238 files · Browse complete extent
All tests (intent)
231 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: 14 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 14 introduced LOC · 6 ranges

Open complete file

225
226 public get2(lineNumber: number): { node: TreeNode; nodeStartOffset: number; nodeStartLineNumber: number } | null {
227 > for (let i = this._cache.length - 1; i >= 0; i--) { pieceTreeBase.ts
228 const nodePos = this._cache[i];
229 if (nodePos.nodeStartLineNumber && nodePos.nodeStartLineNumber < lineNumber && nodePos.nodeStartLineNumber + nodePos.node.piece.lineFeedCnt >= lineNumber) {
231 }
232 }
233 > return null; pieceTreeBase.ts
234 > }
235
236 public set(nodePosition: CacheEntry) {
1252
1253 public getLineRawContent(lineNumber: number, endOffset: number = 0): string {
1254 > let x = this.root; pieceTreeBase.ts
1255 >
1256 > let ret = '';
1257 > const cache = this._searchCache.get2(lineNumber);
1258 > if (cache) {
1259 x = cache.node;
1260 const prevAccumulatedValue = this.getAccumulatedValue(x, lineNumber - cache.nodeStartLineNumber - 1);
1267 return buffer.substring(startOffset + prevAccumulatedValue, startOffset + accumulatedValue - endOffset);
1268 }
1269 > } else { pieceTreeBase.ts
1270 > let nodeStartOffset = 0;
1271 > const originalLineNumber = lineNumber;
1272 > while (x !== SENTINEL) {
1273 if (x.left !== SENTINEL && x.lf_left >= lineNumber - 1) {
1274 x = x.left;
1299 }
1300 }
1301 > } pieceTreeBase.ts
1302
1303 // search in order, to find the node contains end column
1321
1322 return ret;
1323 > } pieceTreeBase.ts
1324
1325 private computeBufferMetadata() {