pieceTreeBase.ts ×9

Frontier kind: Code frontier

unlabeled · c_d46f799be8e4

2 tests · 39548 LOC · 238 files · introduces 0 tests · 43 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges43 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4672 ranges39548 lines · 238 files · Browse complete extent
All tests (intent)
2 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: 43 introduced LOC across 9 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 43 introduced LOC · 9 ranges

Open complete file

689
690 public findMatchesInNode(node: TreeNode, searcher: Searcher, startLineNumber: number, startColumn: number, startCursor: BufferCursor, endCursor: BufferCursor, searchData: SearchData, captureMatches: boolean, limitResultCount: number, resultLen: number, result: FindMatch[]) {
691 > const buffer = this._buffers[node.piece.bufferIndex]; pieceTreeBase.ts
692 > const startOffsetInBuffer = this.offsetInBuffer(node.piece.bufferIndex, node.piece.start);
693 > const start = this.offsetInBuffer(node.piece.bufferIndex, startCursor);
694 > const end = this.offsetInBuffer(node.piece.bufferIndex, endCursor);
695 >
696 > let m: RegExpExecArray | null;
697 > // Reset regex to search from the beginning
698 > const ret: BufferCursor = { line: 0, column: 0 };
699 > let searchText: string;
700 > let offsetInBuffer: (offset: number) => number;
701 >
702 > if (searcher._wordSeparators) {
703 searchText = buffer.buffer.substring(start, end);
704 offsetInBuffer = (offset: number) => offset + start;
705 searcher.reset(0);
706 > } else { pieceTreeBase.ts
707 searchText = buffer.buffer;
708 offsetInBuffer = (offset: number) => offset;
709 searcher.reset(start);
710 }
712 > do {
713 > m = searcher.next(searchText);
714 >
715 > if (m) {
716 > if (offsetInBuffer(m.index) >= end) {
717 return resultLen;
718 }
719 > this.positionInBuffer(node, offsetInBuffer(m.index) - startOffsetInBuffer, ret); pieceTreeBase.ts
720 > const lineFeedCnt = this.getLineFeedCnt(node.piece.bufferIndex, startCursor, ret);
721 > const retStartColumn = ret.line === startCursor.line ? ret.column - startCursor.column + startColumn : ret.column + 1;
722 > const retEndColumn = retStartColumn + m[0].length;
723 > result[resultLen++] = createFindMatch(new Range(startLineNumber + lineFeedCnt, retStartColumn, startLineNumber + lineFeedCnt, retEndColumn), m, captureMatches);
724 >
725 > if (offsetInBuffer(m.index) + m[0].length >= end) {
726 return resultLen;
727 }
728 > if (resultLen >= limitResultCount) { pieceTreeBase.ts
729 return resultLen;
730 }
732 >
733 > } while (m);
734 >
735 > return resultLen;
736 > }
737
738 public findMatchesLineByLine(searchRange: Range, searchData: SearchData, captureMatches: boolean, limitResultCount: number): FindMatch[] {
745 return [];
746 }
747 > const endPosition = this.nodeAt2(searchRange.endLineNumber, searchRange.endColumn); pieceTreeBase.ts
748 > if (endPosition === null) {
749 return [];
750 }
751 > let start = this.positionInBuffer(startPosition.node, startPosition.remainder); pieceTreeBase.ts
752 > const end = this.positionInBuffer(endPosition.node, endPosition.remainder);
753 >
754 > if (startPosition.node === endPosition.node) {
755 this.findMatchesInNode(startPosition.node, searcher, searchRange.startLineNumber, searchRange.startColumn, start, end, searchData, captureMatches, limitResultCount, resultLen, result);
756 return result;
1110
1111 if (ret) {
1112 > ret.line = mid; pieceTreeBase.ts
1113 > ret.column = offset - midStart;
1114 > return null;
1115 > }
1116
1117 return {