viewLineRenderer.ts ×8

Frontier kind: Code frontier

unlabeled · c_2345943bc3d2

10 tests · 9520 LOC · 43 files · introduces 0 tests · 34 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
8 ranges34 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1278 ranges9520 lines · 43 files · Browse complete extent
All tests (intent)
10 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: 34 introduced LOC across 8 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/viewLayout/viewLineRenderer.ts 34 introduced LOC · 8 ranges

Open complete file

494 let containsForeignElements = ForeignElementType.None;
495 if (input.lineDecorations.length > 0) {
496 > for (let i = 0, len = input.lineDecorations.length; i < len; i++) { viewLineRenderer.ts
497 > const lineDecoration = input.lineDecorations[i];
498 > if (lineDecoration.type === InlineDecorationType.RegularAffectingLetterSpacing) {
499 // Pretend there are foreign elements... although not 100% accurate.
500 containsForeignElements |= ForeignElementType.Before;
501 > } else if (lineDecoration.type === InlineDecorationType.Before) { viewLineRenderer.ts
502 containsForeignElements |= ForeignElementType.Before;
503 > } else if (lineDecoration.type === InlineDecorationType.After) { viewLineRenderer.ts
504 containsForeignElements |= ForeignElementType.After;
505 }
507 > tokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations);
508 > }
509 if (!input.containsRTL) {
510 // We can never split RTL text, as it ruins the rendering
918 * Special care must be taken when multiple inline decorations are at play and they overlap.
919 */
920 > function _applyInlineDecorations(lineContent: string, len: number, tokens: LinePart[], _lineDecorations: LineDecoration[]): LinePart[] { viewLineRenderer.ts
921 > _lineDecorations.sort(LineDecoration.compare);
922 > const lineDecorations = LineDecorationsNormalizer.normalize(lineContent, _lineDecorations);
923 > const lineDecorationsLen = lineDecorations.length;
924 >
925 > let lineDecorationIndex = 0;
926 > const result: LinePart[] = [];
927 > let resultLen = 0;
928 > let lastResultEndIndex = 0;
929 > for (let tokenIndex = 0, len = tokens.length; tokenIndex < len; tokenIndex++) {
930 > const token = tokens[tokenIndex];
931 > const tokenEndIndex = token.endIndex;
932 > const tokenType = token.type;
933 > const tokenMetadata = token.metadata;
934 > const tokenContainsRTL = token.containsRTL;
935 >
936 > while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset < tokenEndIndex) {
937 const lineDecoration = lineDecorations[lineDecorationIndex];
938
954 }
955 }
957 > if (tokenEndIndex > lastResultEndIndex) {
958 lastResultEndIndex = tokenEndIndex;
959 result[resultLen++] = new LinePart(lastResultEndIndex, tokenType, tokenMetadata, tokenContainsRTL);
960 }
962 >
963 > const lastTokenEndIndex = tokens[tokens.length - 1].endIndex;
964 > if (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
965 while (lineDecorationIndex < lineDecorationsLen && lineDecorations[lineDecorationIndex].startOffset === lastTokenEndIndex) {
966 const lineDecoration = lineDecorations[lineDecorationIndex];