sparseMultilineTokens.ts ×10

Frontier kind: Joint frontier

unlabeled · c_c5ad38668c83

1 test · 42581 LOC · 240 files · introduces 1 test · 49 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges49 lines · 2 files
Tests
1 test

Contains — complete concept membership

All code (extent)
5505 ranges42581 lines · 240 files · Browse complete extent
All tests (intent)
1 testBrowse 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.

1 test introduced at this concept.

Introduced code

Every collected source range enters the hierarchy at exactly one concept.

2 files ranked by introduced lines: 49 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/tokens/sparseMultilineTokens.ts 47 introduced LOC · 10 ranges

Open complete file

262 return new SparseLineTokens(this._tokens.subarray(4 * low, 4 * low + 4));
263 }
265 > return null;
266 }
267
412 continue;
413 } else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter < startCharacter) {
414 > // 1b, 1c, 1d sparseMultilineTokens.ts
415 > // => the token survives, but it needs to shrink
416 > if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {
417 > // 1d. The token starts before, the deletion range is inside the token
418 > // => the token shrinks by the deletion character count
419 > tokenEndCharacter -= (endCharacter - startCharacter);
420 > } else {
421 > // 1b. The token starts before, the deletion range ends after the token
422 > // 1c. The token starts before, the deletion range ends precisely with the token
423 > // => the token shrinks its ending to the deletion start
424 > tokenEndCharacter = startCharacter;
425 > }
426 } else if (tokenDeltaLine === startDeltaLine && tokenStartCharacter === startCharacter) {
427 // 2a, 2b, 2c
438 }
439 } else if (tokenDeltaLine < endDeltaLine || (tokenDeltaLine === endDeltaLine && tokenStartCharacter < endCharacter)) {
440 > // 3a, 3b, 3c sparseMultilineTokens.ts
441 > if (tokenDeltaLine === endDeltaLine && tokenEndCharacter > endCharacter) {
442 > // 3c. The token starts inside the deletion range, and ends after the deletion range
443 > // => the token moves to continue right after the deletion
444 > tokenDeltaLine = startDeltaLine;
445 > tokenStartCharacter = startCharacter;
446 > tokenEndCharacter = tokenStartCharacter + (tokenEndCharacter - endCharacter);
447 > } else {
448 > // 3a. The token is inside the deletion range
449 > // 3b. The token starts inside the deletion range, and ends at the same position as the deletion range
450 > // => the token is deleted
451 > hasDeletedTokens = true;
452 > continue;
453 > }
454 } else if (tokenDeltaLine > endDeltaLine) {
455 > // 4. (partial) The token starts after the deletion range, on a line below... sparseMultilineTokens.ts
456 > if (deletedLineCount === 0 && !hasDeletedTokens) {
457 // early stop, there is no need to walk all the tokens and do nothing...
458 newTokenCount = tokenCount;
459 break;
460 }
461 > tokenDeltaLine -= deletedLineCount; sparseMultilineTokens.ts
462 } else if (tokenDeltaLine === endDeltaLine && tokenStartCharacter >= endCharacter) {
463 // 4. (continued) The token starts after the deletion range, on the last line where a deletion occurs
500 const isInsertingPreciselyOneWordCharacter = (
501 eolCount === 0
502 > && firstLineLength === 1 sparseMultilineTokens.ts
503 && (
504 (firstCharCode >= CharCode.Digit0 && firstCharCode <= CharCode.Digit9)
528 }
529 } else if (tokenDeltaLine === deltaLine && tokenStartCharacter < character && character < tokenEndCharacter) {
530 > // 3. The token contains the insertion point sparseMultilineTokens.ts
531 > if (eolCount === 0) {
532 > // => just expand the end character
533 > tokenEndCharacter += firstLineLength;
534 > } else {
535 > // => cut off the token
536 > tokenEndCharacter = character;
537 > }
538 } else {
539 // 4. or 5.
540 if (tokenDeltaLine === deltaLine && tokenStartCharacter === character) {
541 > // 4. The token starts precisely at the insertion point sparseMultilineTokens.ts
542 > // => grow the token (by keeping its start constant) only if inserting precisely one character that is a word character
543 > // => otherwise behave as in case 5.
544 > if (isInsertingPreciselyOneWordCharacter) {
545 continue;
546 }
548 // => the token must move and keep its size constant
549 if (tokenDeltaLine === deltaLine) {
src/vs/editor/common/tokens/sparseTokensStore.ts 2 introduced LOC · 1 range

Open complete file

147
148 if (!bTokens) {
149 > return aTokens; sparseTokensStore.ts
150 > }
151
152 const aLen = aTokens.getCount();