lineDecorations.ts ×13

Frontier kind: Code frontier

unlabeled · c_7f4882681e39

13 tests · 7422 LOC · 35 files · introduces 0 tests · 86 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
13 ranges86 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
864 ranges7422 lines · 35 files · Browse complete extent
All tests (intent)
13 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.

Introduced files, introduced tests, and structurally relevant concept specializationviewLineRenderer.test|title=renderViewLine2 issue-124038|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-32436|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-11485|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-136622|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine issue-91178|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-38935|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 unsorted-deco|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…lineDecorations.ts ×1 · 2 introduced LOClineDecorations.ts ×1viewLineRenderer.ts ×1 · 5 introduced LOCviewLineRenderer.ts ×1lineDecorations.ts ×1 · 2 introduced LOClineDecorations.ts ×1viewLineRenderer.ts ×1 · 6 introduced LOCviewLineRenderer.ts ×1viewLineRenderer.test|title=renderViewLine2 issue-18616|occurrence=1 · 0 introduced LOCviewLineRenderer.test|ti…viewLineRenderer.ts ×1 · 3 introduced LOCviewLineRenderer.ts ×1viewLineRenderer.ts ×1 · 1 introduced LOCviewLineRenderer.ts ×1viewLineRenderer.ts ×1 · 3 introduced LOCviewLineRenderer.ts ×1lineDecorations.ts ×1 · 3 introduced LOClineDecorations.ts ×1lineDecorations.ts ×1 · 2 introduced LOClineDecorations.ts ×1viewLineRenderer.ts ×3 · 11 introduced LOCviewLineRenderer.ts ×3viewLineRenderer.ts ×1 · 3 introduced LOCviewLineRenderer.ts ×1viewLineRenderer.ts ×8 · 34 introduced LOCviewLineRenderer.ts ×8lineDecorations.ts ×1 · 2 introduced LOClineDecorations.ts ×1lineDecorations.ts ×1 · 10 introduced LOClineDecorations.ts ×1lineDecorations.ts ×1 · 3 introduced LOClineDecorations.ts ×1lineDecorations.ts ×1 · 1 introduced LOClineDecorations.ts ×1lineDecorations.ts ×2 · 3 introduced LOClineDecorations.ts ×2lineDecorations.ts ×1 · 1 introduced LOClineDecorations.ts ×1lineDecorations.ts ×1 · 6 introduced LOClineDecorations.ts ×1lineDecorations.ts ×14 · 83 introduced LOClineDecorations.ts ×14inlineDecorations.ts ×10 · 131 introduced LOCinlineDecorations.ts ×10strings.ts ×1 · 2 introduced LOCstrings.ts ×1strings.test|title=Strings trimWhitespace|occurrence=1 · 0 introduced LOCstrings.test|title=Strin…strings.ts ×101 · 542 introduced LOCstrings.ts ×101cancellation.test|title=CancellationToken None|occurrence=1 · 0 introduced LOCcancellation.test|title=…cancellation.ts ×18 · 90 introduced LOCcancellation.ts ×18event.ts ×93 · 864 introduced LOCevent.ts ×93range.ts ×40 · 247 introduced LOCrange.ts ×40model.ts ×10 · 1559 introduced LOCmodel.ts ×10position.ts ×16 · 113 introduced LOCposition.ts ×16encodedTokenAttributes.ts ×10 · 128 introduced LOCencodedTokenAttributes.t…uri.test|title=URI URI#file, win-speciale|occurrence=1, charCode.test|title=CharCode has good values|occurrence=1, +2 · 0 introduced LOCuri.test|title=URI URI#f…utils.ts ×3 · 9 introduced LOCutils.ts ×3linkedList.ts ×13 · 44 introduced LOClinkedList.ts ×13objects.ts ×13 · 65 introduced LOCobjects.ts ×13lifecycle.ts ×2 · 4 introduced LOClifecycle.ts ×2lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×4 · 8 introduced LOClifecycle.ts ×4lifecycle.ts ×6 · 16 introduced LOClifecycle.ts ×6lazy.ts ×1 · 2 introduced LOClazy.ts ×1lazy.ts ×3 · 37 introduced LOClazy.ts ×3lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1lifecycle.ts ×1 · 2 introduced LOClifecycle.ts ×1uint.ts ×2 · 43 introduced LOCuint.ts ×2lifecycle.ts ×1 · 3 introduced LOClifecycle.ts ×1map.ts ×97 · 3334 introduced LOCmap.ts ×97src/vs/base/common/arrays.ts · 949 LOCcommon/arrays.tssrc/vs/base/common/arraysFind.ts · 226 LOCcommon/arraysFind.tssrc/vs/base/common/assert.ts · 91 LOCcommon/assert.tssrc/vs/base/common/cache.ts · 153 LOCcommon/cache.tssrc/vs/base/common/cancellation.ts · 206 LOCcommon/cancellation.tssrc/vs/base/common/charCode.ts · 450 LOCcommon/charCode.tssrc/vs/base/common/collections.ts · 176 LOCcommon/collections.tssrc/vs/base/common/errors.ts · 357 LOCcommon/errors.tssrc/vs/base/common/event.ts · 1964 LOCcommon/event.tssrc/vs/base/common/functional.ts · 32 LOCcommon/functional.tssrc/vs/base/common/iterator.ts · 194 LOCcommon/iterator.tssrc/vs/base/common/lazy.ts · 57 LOCcommon/lazy.tssrc/vs/base/common/lifecycle.ts · 974 LOCcommon/lifecycle.tssrc/vs/base/common/linkedList.ts · 151 LOCcommon/linkedList.tssrc/vs/base/common/map.ts · 1016 LOCcommon/map.tssrc/vs/base/common/marshallingIds.ts · 33 LOCcommon/marshallingIds.tssrc/vs/base/common/objects.ts · 286 LOCcommon/objects.tssrc/vs/base/common/path.ts · 1589 LOCcommon/path.tssrc/vs/base/common/platform.ts · 281 LOCcommon/platform.tssrc/vs/base/common/process.ts · 76 LOCcommon/process.tssrc/vs/base/common/stopwatch.ts · 41 LOCcommon/stopwatch.tssrc/vs/base/common/strings.ts · 1413 LOCcommon/strings.tssrc/vs/base/common/types.ts · 410 LOCcommon/types.tssrc/vs/base/common/uint.ts · 59 LOCcommon/uint.tssrc/vs/base/common/uri.ts · 754 LOCcommon/uri.tssrc/vs/base/test/common/utils.ts · 107 LOCcommon/utils.tssrc/vs/editor/common/core/position.ts · 184 LOCcore/position.tssrc/vs/editor/common/core/range.ts · 520 LOCcore/range.tssrc/vs/editor/common/encodedTokenAttributes.ts · 193 LOCcommon/encodedTokenAttri…src/vs/editor/common/model.ts · 1622 LOCcommon/model.tssrc/vs/editor/common/viewLayout/lineDecorations.ts · 265 LOCviewLayout/lineDecoratio…src/vs/editor/common/viewLayout/linePart.ts · 36 LOCviewLayout/linePart.tssrc/vs/editor/common/viewLayout/viewLineRenderer.ts · 1213 LOCviewLayout/viewLineRende…src/vs/editor/common/viewModel/inlineDecorations.ts · 269 LOCviewModel/inlineDecorati…src/vs/editor/common/viewModel/viewModelDecoration.ts · 79 LOCviewModel/viewModelDecor…src/vs/nls.ts · 244 LOCvs/nls.tscancellation.test|title=CancellationToken None|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/cancellation.test|title=CancellationToken None|occurrence=1cancellation.test|title=…charCode.test|title=CharCode has good values|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1charCode.test|title=Char…path.test|title=Paths (Node Implementation) path|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1path.test|title=Paths (N…strings.test|title=Strings trimWhitespace|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/strings.test|title=Strings trimWhitespace|occurrence=1strings.test|title=Strin…uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI File paths containing apostrophes break URI parsing and cannot be opened #276075|occurrence=1uri.test|title=URI File …uri.test|title=URI URI#file, win-speciale|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1uri.test|title=URI URI#f…lineDecorations.test|title=Editor ViewLayout - ViewLineParts Bug 9827:Overlapping inline decorations can cause wrong inline class to be applied|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/lineDecorations.test|title=Editor ViewLayout - ViewLineParts Bug 9827:Overlapping inline decorations can cause wrong inline class to be applied|occurrence=1lineDecorations.test|tit…lineDecorations.test|title=Editor ViewLayout - ViewLineParts ViewLineParts|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/lineDecorations.test|title=Editor ViewLayout - ViewLineParts ViewLineParts|occurrence=1lineDecorations.test|tit…lineDecorations.test|title=Editor ViewLayout - ViewLineParts issue #3462: no whitespace shown at the end of a decorated line|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/lineDecorations.test|title=Editor ViewLayout - ViewLineParts issue #3462: no whitespace shown at the end of a decorated line|occurrence=1lineDecorations.test|tit…viewLineRenderer.test|title=renderViewLine issue-91178|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine issue-91178|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-11485|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-11485|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-124038|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-124038|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-136622|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-136622|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-18616|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-18616|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-19207|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-19207|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-32436|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-32436|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-37208|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-37208|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 issue-38935|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-38935|occurrence=1viewLineRenderer.test|ti…viewLineRenderer.test|title=renderViewLine2 unsorted-deco|occurrence=1 · introduced test · mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 unsorted-deco|occurrence=1viewLineRenderer.test|ti…Focused concept · lineDecorations.ts ×13 · 86 introduced LOClineDecorations.ts ×13

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: 86 introduced LOC across 13 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/viewLayout/lineDecorations.ts 86 introduced LOC · 13 ranges

Open complete file

126
127 constructor(startOffset: number, endOffset: number, className: string, metadata: number) {
128 > this.startOffset = startOffset; lineDecorations.ts
129 > this.endOffset = endOffset;
130 > this.className = className;
131 > this.metadata = metadata;
132 > }
133 }
134
140
141 constructor() {
142 > this.stopOffsets = []; lineDecorations.ts
143 > this.classNames = [];
144 > this.metadata = [];
145 > this.count = 0;
146 > }
147
148 private static _metadata(metadata: number[]): number {
149 > let result = 0; lineDecorations.ts
150 > for (let i = 0, len = metadata.length; i < len; i++) {
151 > result |= metadata[i];
152 > }
153 > return result;
154 > }
155
156 public consumeLowerThan(maxStopOffset: number, nextStartOffset: number, result: DecorationSegment[]): number {
158 > while (this.count > 0 && this.stopOffsets[0] < maxStopOffset) {
159 > let i = 0;
160 >
161 > // Take all equal stopping offsets
162 > while (i + 1 < this.count && this.stopOffsets[i] === this.stopOffsets[i + 1]) {
163 i++;
164 }
166 > // Basically we are consuming the first i + 1 elements of the stack
167 > result.push(new DecorationSegment(nextStartOffset, this.stopOffsets[i], this.classNames.join(' '), Stack._metadata(this.metadata)));
168 > nextStartOffset = this.stopOffsets[i] + 1;
169 >
170 > // Consume them
171 > this.stopOffsets.splice(0, i + 1);
172 > this.classNames.splice(0, i + 1);
173 > this.metadata.splice(0, i + 1);
174 > this.count -= (i + 1);
175 > }
176 >
177 > if (this.count > 0 && nextStartOffset < maxStopOffset) {
178 result.push(new DecorationSegment(nextStartOffset, maxStopOffset - 1, this.classNames.join(' '), Stack._metadata(this.metadata)));
179 nextStartOffset = maxStopOffset;
180 }
182 > return nextStartOffset;
183 > }
184
185 public insert(stopOffset: number, className: string, metadata: number): void {
186 > if (this.count === 0 || this.stopOffsets[this.count - 1] <= stopOffset) { lineDecorations.ts
187 > // Insert at the end
188 > this.stopOffsets.push(stopOffset);
189 > this.classNames.push(className);
190 > this.metadata.push(metadata);
191 > } else {
192 // Find the insertion position for `stopOffset`
193 for (let i = 0; i < this.count; i++) {
210 */
211 public static normalize(lineContent: string, lineDecorations: LineDecoration[]): DecorationSegment[] {
212 > if (lineDecorations.length === 0) { lineDecorations.ts
213 return [];
214 }
216 > const result: DecorationSegment[] = [];
217 >
218 > const stack = new Stack();
219 > let nextStartOffset = 0;
220 >
221 > for (let i = 0, len = lineDecorations.length; i < len; i++) {
222 > const d = lineDecorations[i];
223 > let startColumn = d.startColumn;
224 > let endColumn = d.endColumn;
225 > const className = d.className;
226 > const metadata = (
227 > d.type === InlineDecorationType.Before
228 ? LinePartMetadata.PSEUDO_BEFORE
229 : d.type === InlineDecorationType.After
230 ? LinePartMetadata.PSEUDO_AFTER
231 : 0
233 >
234 > // If the position would end up in the middle of a high-low surrogate pair, we move it to before the pair
235 > if (startColumn > 1) {
236 const charCodeBefore = lineContent.charCodeAt(startColumn - 2);
237 if (strings.isHighSurrogate(charCodeBefore)) {
239 }
240 }
242 > if (endColumn > 1) {
243 > const charCodeBefore = lineContent.charCodeAt(endColumn - 2);
244 > if (strings.isHighSurrogate(charCodeBefore)) {
245 endColumn--;
246 }
248 >
249 > const currentStartOffset = startColumn - 1;
250 > const currentEndOffset = endColumn - 2;
251 >
252 > nextStartOffset = stack.consumeLowerThan(currentStartOffset, nextStartOffset, result);
253 >
254 > if (stack.count === 0) {
255 > nextStartOffset = currentStartOffset;
256 > }
257 > stack.insert(currentEndOffset, className, metadata);
258 > }
259 >
260 > stack.consumeLowerThan(Constants.MAX_SAFE_SMALL_INTEGER, nextStartOffset, result);
261 >
262 > return result;
263 > }
264
265 }