);
}
return _renderLine(resolveRenderLineInput(input), sb);
}
export class RenderLineOutput2 {
Frontier kind: Code frontier
unlabeled · c_50f5bfdad743
68 tests · 8953 LOC · 43 files · introduces 0 tests · 167 LOC · 4 files
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.
Every exact file and test below is linked only from the concept that introduces it.
mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 ws-sel-multiple|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 ws-sel-unsorted|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 ws-4-leading|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 ws-8-leading|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-22352-2|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-33525-1|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-42700|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine issue-137036|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine issue-260239|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-22352-1|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 issue-33525-2|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine issue-2255-1|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine issue-2255-2|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 simple|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/viewLayout/viewLineRenderer.test|title=renderViewLine2 two-tokens|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/charCode.test|title=CharCode has good values|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/path.test|title=Paths (Node Implementation) path|occurrence=1mocha: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=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/uri.test|title=URI URI#file, win-speciale|occurrence=1Every collected test enters the hierarchy at exactly one concept.
No tests are introduced at this concept. Its intent tests are introduced by other concepts.
Every collected source range enters the hierarchy at exactly one concept.
4 files ranked by introduced lines: 167 introduced LOC across 27 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
);
}
return _renderLine(resolveRenderLineInput(input), sb);
}
export class RenderLineOutput2 {
class ResolvedRenderLineInput {
constructor(
public readonly canUseHalfwidthRightwardsArrow: boolean,
public readonly lineContent: string,
public readonly len: number,
public readonly isOverflowing: boolean,
public readonly overflowingCharCount: number,
public readonly parts: LinePart[],
public readonly containsForeignElements: ForeignElementType,
public readonly fauxIndentLength: number,
public readonly tabSize: number,
public readonly startVisibleColumn: number,
public readonly spaceWidth: number,
public readonly renderSpaceCharCode: number,
public readonly renderWhitespace: RenderWhitespace,
public readonly renderControlCharacters: boolean,
) {
//
}
}
function resolveRenderLineInput(input: RenderLineInput): ResolvedRenderLineInput {
viewLineRenderer.ts
const lineContent = input.lineContent;
let isOverflowing: boolean;
let overflowingCharCount: number;
let len: number;
if (input.stopRenderingLineAfter !== -1 && input.stopRenderingLineAfter < lineContent.length) {
isOverflowing = true;
overflowingCharCount = lineContent.length - input.stopRenderingLineAfter;
len = input.stopRenderingLineAfter;
isOverflowing = false;
overflowingCharCount = 0;
len = lineContent.length;
}
let tokens = transformAndRemoveOverflowing(lineContent, input.containsRTL, input.lineTokens, input.fauxIndentLength, len);
if (input.renderControlCharacters && !input.isBasicASCII) {
// Calling `extractControlCharacters` before adding (possibly empty) line parts
// for inline decorations. `extractControlCharacters` removes empty line parts.
tokens = extractControlCharacters(lineContent, tokens);
}
input.renderWhitespace === RenderWhitespace.Boundary ||
(input.renderWhitespace === RenderWhitespace.Selection && !!input.selectionsOnLine) ||
(input.renderWhitespace === RenderWhitespace.Trailing && !input.continuesWithWrappedLine)
tokens = _applyRenderWhitespace(input, lineContent, len, tokens);
}
if (input.lineDecorations.length > 0) {
for (let i = 0, len = input.lineDecorations.length; i < len; i++) {
const lineDecoration = input.lineDecorations[i];
tokens = _applyInlineDecorations(lineContent, len, tokens, input.lineDecorations);
}
// We can never split RTL text, as it ruins the rendering
tokens = splitLargeTokens(lineContent, tokens, !input.isBasicASCII || input.fontLigatures);
// Split the first token if it contains both leading whitespace and RTL text
tokens = splitLeadingWhitespaceFromRTL(lineContent, tokens);
}
return new ResolvedRenderLineInput(
input.useMonospaceOptimizations,
input.canUseHalfwidthRightwardsArrow,
lineContent,
len,
isOverflowing,
overflowingCharCount,
tokens,
containsForeignElements,
input.fauxIndentLength,
input.tabSize,
input.startVisibleColumn,
input.spaceWidth,
input.renderSpaceCharCode,
input.renderWhitespace,
input.renderControlCharacters
);
}
/**
* Ensure that all tokens end before `len` and the last one ends precisely at `len`.
*/
function transformAndRemoveOverflowing(lineContent: string, lineContainsRTL: boolean, tokens: IViewLineTokens, fauxIndentLength: number, len: number): LinePart[] {
viewLineRenderer.ts
const result: LinePart[] = [];
let resultLen = 0;
// The faux indent part of the line should have no token type
if (fauxIndentLength > 0) {
result[resultLen++] = new LinePart(fauxIndentLength, '', 0, false);
}
for (let tokenIndex = 0, tokensLen = tokens.getCount(); tokenIndex < tokensLen; tokenIndex++) {
const endIndex = tokens.getEndOffset(tokenIndex);
if (endIndex <= fauxIndentLength) {
// The faux indent part of the line should have no token type
continue;
}
if (endIndex >= len) {
const tokenContainsRTL = (lineContainsRTL ? strings.containsRTL(lineContent.substring(startOffset, len)) : false);
result[resultLen++] = new LinePart(len, type, 0, tokenContainsRTL);
break;
}
const tokenContainsRTL = (lineContainsRTL ? strings.containsRTL(lineContent.substring(startOffset, endIndex)) : false);
result[resultLen++] = new LinePart(endIndex, type, 0, tokenContainsRTL);
startOffset = endIndex;
}
return result;
}
/**
* Notice how all the needed data is fully resolved and passed in (i.e. no other calls).
*/
function _renderLine(input: ResolvedRenderLineInput, sb: StringBuilder): RenderLineOutput {
viewLineRenderer.ts
const fontIsMonospace = input.fontIsMonospace;
const canUseHalfwidthRightwardsArrow = input.canUseHalfwidthRightwardsArrow;
const containsForeignElements = input.containsForeignElements;
const lineContent = input.lineContent;
const len = input.len;
const isOverflowing = input.isOverflowing;
const overflowingCharCount = input.overflowingCharCount;
const parts = input.parts;
const fauxIndentLength = input.fauxIndentLength;
const tabSize = input.tabSize;
const startVisibleColumn = input.startVisibleColumn;
const spaceWidth = input.spaceWidth;
const renderSpaceCharCode = input.renderSpaceCharCode;
const renderWhitespace = input.renderWhitespace;
const renderControlCharacters = input.renderControlCharacters;
const characterMapping = new CharacterMapping(len + 1, parts.length);
let lastCharacterMappingDefined = false;
let charIndex = 0;
let visibleColumn = startVisibleColumn;
let charOffsetInPart = 0; // the character offset in the current part
let charHorizontalOffset = 0; // the character horizontal position in terms of chars relative to line start
let partDisplacement = 0;
sb.appendString('<span>');
for (let partIndex = 0, tokensLen = parts.length; partIndex < tokensLen; partIndex++) {
const part = parts[partIndex];
const partEndIndex = part.endIndex;
const partType = part.type;
const partContainsRTL = part.containsRTL;
const partRendersWhitespace = (renderWhitespace !== RenderWhitespace.None && part.isWhitespace());
const partRendersWhitespaceWithWidth = partRendersWhitespace && !fontIsMonospace && (partType === 'mtkw'/*only whitespace*/ || !containsForeignElements);
const partIsEmptyAndHasPseudoAfter = (charIndex === partEndIndex && part.isPseudoAfter());
charOffsetInPart = 0;
sb.appendString('<span ');
if (partContainsRTL) {
sb.appendString('style="unicode-bidi:isolate" ');
}
sb.appendString(partRendersWhitespaceWithWidth ? 'mtkz' : partType);
sb.appendASCIICharCode(CharCode.DoubleQuote);
if (partRendersWhitespace) {
let partWidth = 0;
}
sb.appendASCIICharCode(CharCode.GreaterThan);
}
}
if (partIsEmptyAndHasPseudoAfter) {
partDisplacement++;
partDisplacement = 0;
}
if (charIndex >= len && !lastCharacterMappingDefined && part.isPseudoAfter()) {
lastCharacterMappingDefined = true;
characterMapping.setColumnInfo(charIndex + 1, partIndex, charOffsetInPart, charHorizontalOffset);
}
sb.appendString('</span>');
}
if (!lastCharacterMappingDefined) {
// When getting client rects for the last character, we will position the
// text range at the end of the span, insteaf of at the beginning of next span
characterMapping.setColumnInfo(len + 1, parts.length - 1, charOffsetInPart, charHorizontalOffset);
}
if (isOverflowing) {
sb.appendString('<span class="mtkoverflow">');
sb.appendString(nls.localize('showMore', "Show more ({0})", renderOverflowingCharCount(overflowingCharCount)));
sb.appendString('</span>');
}
sb.appendString('</span>');
return new RenderLineOutput(characterMapping, containsForeignElements);
}
function to4CharHex(n: number): string {
constructor(
* last char index of this token (not inclusive).
*/
public readonly endIndex: number,
public readonly type: string,
public readonly metadata: number,
public readonly containsRTL: boolean
) { }
public isWhitespace(): boolean {
public isPseudoAfter(): boolean {
}
}
*/
public appendCharCode(charCode: number): void {
if (remainingSpace <= 1) {
if (remainingSpace === 0 || strings.isHighSurrogate(charCode)) {
this._flushBuffer();
}
}
this._buffer[this._bufferLength++] = charCode;
}
/**
public getClassName(tokenIndex: number): string {
}
public getInlineStyle(tokenIndex: number, colorMap: string[]): string {