pieceTreeTextBuffer.ts ×7

Frontier kind: Code frontier

unlabeled · c_ca3dbb01db49

267 tests · 40664 LOC · 238 files · introduces 0 tests · 21 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
9 ranges21 lines · 2 files
Tests
0 tests

Contains — complete concept membership

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

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

Open complete file

255 const validatedRange = op.range;
256 if (op.text) {
257 > let textMightContainNonBasicASCII = true; pieceTreeTextBuffer.ts
258 > if (!mightContainNonBasicASCII) {
259 textMightContainNonBasicASCII = !strings.isBasicASCII(op.text);
260 mightContainNonBasicASCII = textMightContainNonBasicASCII;
261 }
262 > if (!mightContainRTL && textMightContainNonBasicASCII) { pieceTreeTextBuffer.ts
263 // check if the new inserted text contains RTL
264 mightContainRTL = strings.containsRTL(op.text);
265 }
266 > if (!mightContainUnusualLineTerminators && textMightContainNonBasicASCII) { pieceTreeTextBuffer.ts
267 // check if the new inserted text contains unusual line terminators
268 mightContainUnusualLineTerminators = strings.containsUnusualLineTerminators(op.text);
269 }
271
272 let validText = '';
275 let lastLineLength = 0;
276 if (op.text) {
277 > let strEOL: StringEOL; pieceTreeTextBuffer.ts
278 > [eolCount, firstLineLength, lastLineLength, strEOL] = countEOL(op.text);
279 >
280 > const bufferEOL = this.getEOL();
281 > const expectedStrEOL = (bufferEOL === '\r\n' ? StringEOL.CRLF : StringEOL.LF);
282 > if (strEOL === StringEOL.Unknown || strEOL === expectedStrEOL) {
283 validText = op.text;
284 > } else { pieceTreeTextBuffer.ts
285 validText = op.text.replace(/\r\n|\r|\n/g, bufferEOL);
286 }
288
289 operations[i] = {
src/vs/editor/common/model/textModel.ts 8 introduced LOC · 2 ranges

Open complete file

1305 let opText = rawOperation.text;
1306 if (opText) {
1307 > const endsWithLoneCR = ( textModel.ts
1308 > opText.length > 0 && opText.charCodeAt(opText.length - 1) === CharCode.CarriageReturn
1309 > );
1310 > const removeTrailingCR = (
1311 > this.getEOL() === '\r\n' && endsWithLoneCR && validatedRange.endColumn === this.getLineMaxColumn(validatedRange.endLineNumber)
1312 > );
1313 > if (removeTrailingCR) {
1314 opText = opText.substring(0, opText.length - 1);
1315 }
1316 > } textModel.ts
1317
1318 return new model.ValidAnnotatedEditOperation(