*/
export function parseDocument(tokenizer: Tokenizer, edits: TextEditInfo[], oldNode: AstNode | undefined, createImmutableLists: boolean): AstNode {
return parser.parseDocument();
}
/**
Frontier kind: Code frontier
unlabeled · c_a7b84b35ab76
45 tests · 40855 LOC · 238 files · introduces 0 tests · 116 LOC · 8 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/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - fixed args|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/platform/instantiation/test/common/instantiationService.test|title=Instantiation Service @Param - simple clase|occurrence=1mocha: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=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/core/range.test|title=Editor Core - Range empty range|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/core/range.test|title=Editor Core - Range no swap same line|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/editor/test/common/core/range.test|title=Editor Core - Range no swap|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication creates new entry when none exists|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate IDs with existing entry - fixed version reuses existing|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate status IDs - buggy version leaks entry|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication duplicate status IDs - fixed version reuses entry from current update|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication mixed unique and duplicate IDs|occurrence=1mocha:v1|namespace=vscode@05c208e9e28d8c1c723fa08f85e2b7a96092e8e5|file=vs/workbench/contrib/languageStatus/test/common/languageStatusDedupe.test|title=LanguageStatus - Dedicated Entry Deduplication reuses existing entry from previous update|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.
8 files ranked by introduced lines: 116 introduced LOC across 28 ranges. Expand a file to inspect source; the > gutter marks introduced lines.
*/
export function parseDocument(tokenizer: Tokenizer, edits: TextEditInfo[], oldNode: AstNode | undefined, createImmutableLists: boolean): AstNode {
return parser.parseDocument();
}
/**
constructor(
edits: TextEditInfo[],
oldNode: AstNode | undefined,
private readonly createImmutableLists: boolean,
) {
if (oldNode && createImmutableLists) {
throw new Error('Not supported');
}
this.oldNodeReader = oldNode ? new NodeReader(oldNode) : undefined;
this.positionMapper = new BeforeEditPositionMapper(edits);
}
parseDocument(): AstNode {
this._itemsFromCache = 0;
let result = this.parseList(SmallImmutableSet.getEmpty(), 0);
if (!result) {
result = ListAstNode.getEmpty();
}
return result;
}
private parseList(
level: number,
): AstNode | null {
const items: AstNode[] = [];
while (true) {
let child = this.tryReadChildFromCache(openedBracketIds);
if (!child) {
const token = this.tokenizer.peek();
if (
!token ||
(token.kind === TokenKind.ClosingBracket &&
token.bracketIds.intersects(openedBracketIds))
break;
}
child = this.parseChild(openedBracketIds, level + 1);
}
if (child.kind === AstNodeKind.List && child.childrenLength === 0) {
continue;
}
items.push(child);
}
// When there is no oldNodeReader, all items are created from scratch and must have the same height.
const result = this.oldNodeReader ? concat23Trees(items) : concat23TreesOfSameHeight(items, this.createImmutableLists);
return result;
}
private tryReadChildFromCache(openedBracketIds: SmallImmutableSet<number>): AstNode | undefined {
const maxCacheableLength = this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);
if (maxCacheableLength === null || !lengthIsZero(maxCacheableLength)) {
}
}
}
private parseChild(
level: number,
): AstNode {
this._itemsConstructed++;
const token = this.tokenizer.read()!;
switch (token.kind) {
case TokenKind.ClosingBracket:
return new InvalidBracketAstNode(token.bracketIds, token.length);
case TokenKind.Text:
return token.astNode as TextAstNode;
case TokenKind.OpeningBracket: {
if (level > 300) {
// To prevent stack overflows
private updateBracketPairsTree() {
if (this.bracketsRequested && this.canBuildAST) {
const store = new DisposableStore();
this.bracketPairsTree.value = createDisposableRef(
store.add(
new BracketPairsTree(this.textModel, (languageId) => {
return this.languageConfigurationService.getLanguageConfiguration(languageId);
),
store
);
store.add(this.bracketPairsTree.value.object.onDidChange(e => this.onDidChangeEmitter.fire(e)));
this.onDidChangeEmitter.fire();
}
} else {
if (this.bracketPairsTree.value) {
}
function createDisposableRef<T>(object: T, disposable?: IDisposable): IReference<T> {
bracketPairsImpl.ts
return {
object,
dispose: () => disposable?.dispose(),
};
}
type ContinueBracketSearchPredicate = (() => boolean);
public constructor(
private readonly getLanguageConfiguration: (languageId: string) => ResolvedLanguageConfiguration
) {
super();
this.didChangeEmitter = this._register(new Emitter<void>());
this.denseKeyProvider = new DenseKeyProvider<string>();
this.brackets = new LanguageAgnosticBracketTokens(this.denseKeyProvider, this.getLanguageConfiguration);
this.onDidChange = this.didChangeEmitter.event;
this.queuedTextEditsForInitialAstWithoutTokens = [];
this.queuedTextEdits = [];
if (!textModel.tokenization.hasTokens) {
const brackets = this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId());
const tokenizer = new FastTokenizer(this.textModel.getValue(), brackets);
this.initialAstWithoutTokens = parseDocument(tokenizer, [], undefined, true);
this.astWithTokens = this.initialAstWithoutTokens;
} else if (textModel.tokenization.backgroundTokenizationState === BackgroundTokenizationState.Completed) {
bracketPairsTree.ts
// Skip the initial ast, as there is no flickering.
// Directly create the tree with token information.
this.astWithTokens = this.initialAstWithoutTokens;
}
//#region TextModel events
private flushQueue() {
this.astWithTokens = this.parseDocumentFromTextBuffer(this.queuedTextEdits, this.astWithTokens, false);
this.queuedTextEdits = [];
}
if (this.initialAstWithoutTokens) {
this.initialAstWithoutTokens = this.parseDocumentFromTextBuffer(this.queuedTextEditsForInitialAstWithoutTokens, this.initialAstWithoutTokens, false);
this.queuedTextEditsForInitialAstWithoutTokens = [];
}
/**
this._register(this._decorationProvider.onDidChange(() => {
this._onDidChangeDecorations.fire();
this._onDidChangeDecorations.endDeferredEmit();
}));
this._register(this._fontTokenDecorationsProvider.onDidChangeLineHeight((affectedLineHeights) => {
public get hasTokens(): boolean {
}
public resetTokenization() {
public get hasTokens(): boolean {
}
}
get hasTokens(): boolean {
}
public getTokens(topLevelLanguageId: string, lineIndex: number, lineText: string): LineTokens {
this._register(textModel.bracketPairs.onDidChange(e => {
}));
}