pieceTreeBase.ts ×5

Frontier kind: Code frontier

unlabeled · c_46d83ae7c4ed

145 tests · 39341 LOC · 238 files · introduces 0 tests · 13 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
5 ranges13 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4605 ranges39341 lines · 238 files · Browse complete extent
All tests (intent)
145 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: 13 introduced LOC across 5 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 13 introduced LOC · 5 ranges

Open complete file

870
871 if (nodeStartOffset === offset) {
872 > this.insertContentToNodeLeft(value, node); pieceTreeBase.ts
873 > this._searchCache.validate(offset);
874 } else if (nodeStartOffset + node.piece.length > offset) {
875 // we are inserting into the middle of a node.
1019
1020 private insertContentToNodeLeft(value: string, node: TreeNode) {
1021 > // we are inserting content to the beginning of node pieceTreeBase.ts
1022 > const nodesToDel: TreeNode[] = [];
1023 > if (this.shouldCheckCRLF() && this.endWithCR(value) && this.startWithLF(node)) {
1024 // move `\n` to new node.
1025
1043 }
1044 }
1046 > const newPieces = this.createNewPieces(value);
1047 > let newNode = this.rbInsertLeft(node, newPieces[newPieces.length - 1]);
1048 > for (let k = newPieces.length - 2; k >= 0; k--) {
1049 newNode = this.rbInsertLeft(newNode, newPieces[k]);
1050 }
1051 > this.validateCRLFWithPrevNode(newNode); pieceTreeBase.ts
1052 > this.deleteNodes(nodesToDel);
1053 > }
1054
1055 private insertContentToNodeRight(value: string, node: TreeNode) {
1859 node!.left = z;
1860 z.parent = node!;
1861 > } else { pieceTreeBase.ts
1862 const prevNode = righttest(node!.left); // a
1863 prevNode.right = z;