constructor(node: AstNode) {
this.offsets = [lengthZero];
this.idxs = [];
}
/**
Frontier kind: Code frontier
unlabeled · c_9561abf13157
14 tests · 42880 LOC · 238 files · introduces 0 tests · 59 LOC · 5 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/base/test/common/lifecycle.test|title=Lifecycle Action bar has broken accessibility #100273|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/base/test/common/lifecycle.test|title=Lifecycle dispose disposable array|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.
5 files ranked by introduced lines: 59 introduced LOC across 16 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
constructor(node: AstNode) {
this.offsets = [lengthZero];
this.idxs = [];
}
/**
*/
readLongestNodeAt(offset: Length, predicate: (node: AstNode) => boolean): AstNode | undefined {
throw new Error('Invalid offset');
}
// Find the longest node of all those that are closest to the current offset.
while (true) {
const curNode = lastOrUndefined(this.nextNodes);
if (!curNode) {
return undefined;
}
const curNodeOffset = lastOrUndefined(this.offsets)!;
if (lengthLessThan(offset, curNodeOffset)) {
// The next best node is not here yet.
// The reader must advance before a cached node is hit.
return undefined;
}
if (lengthLessThan(curNodeOffset, offset)) {
// The reader is ahead of the current node.
if (lengthAdd(curNodeOffset, curNode.length) <= offset) {
}
}
// readerOffsetBeforeChange === curNodeOffset
if (predicate(curNode)) {
}
}
}
// Navigates to the longest node that continues after the current node.
private nextNodeAfterCurrent(): void {
const currentOffset = lastOrUndefined(this.offsets);
const currentNode = lastOrUndefined(this.nextNodes);
this.nextNodes.pop();
this.offsets.pop();
if (this.idxs.length === 0) {
// We just popped the root node, there is no next node.
break;
}
// Parent is not undefined, because idxs is not empty
this.idxs.pop();
}
// Current node is now parent, so call nextNodeAfterCurrent again
}
}
}
}
return arr.length > 0 ? arr[arr.length - 1] : undefined;
}
private flushQueue() {
if (this.queuedTextEdits.length > 0) {
this.astWithTokens = this.parseDocumentFromTextBuffer(this.queuedTextEdits, this.astWithTokens, false);
bracketPairsTree.ts
this.queuedTextEdits = [];
}
if (this.queuedTextEditsForInitialAstWithoutTokens.length > 0) {
this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens, this.initialAstWithoutTokens, false);
}
this.queuedTextEditsForInitialAstWithoutTokens = [];
}
}
private tryReadChildFromCache(openedBracketIds: SmallImmutableSet<number>): AstNode | undefined {
if (this.oldNodeReader) {
const maxCacheableLength = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);
parser.ts
if (maxCacheableLength === null || !lengthIsZero(maxCacheableLength)) {
const cachedNode = this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset), curNode => {
// The edit could extend the ending token, thus we cannot re-use nodes that touch the edit.
// If there is no edit anymore, we can re-use the node in any case.