tokenizer.ts ×4

Frontier kind: Code frontier

unlabeled · c_f23d48d3cccc

2 tests · 41654 LOC · 238 files · introduces 0 tests · 26 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
6 ranges26 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5266 ranges41654 lines · 238 files · Browse complete extent
All tests (intent)
2 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.

2 files ranked by introduced lines: 26 introduced LOC across 6 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/tokenizer.ts 22 introduced LOC · 4 ranges

Open complete file

164 public read(): Token | null {
165 if (this.peekedToken) {
166 > const token = this.peekedToken; tokenizer.ts
167 > this.peekedToken = null;
168 > this.lineCharOffset += lengthGetColumnCountIfZeroLineCount(token.length);
169 > return token;
170 > }
171
172 if (this.lineIdx > this.textBufferLineCount - 1 || (this.lineIdx === this.textBufferLineCount - 1 && this.lineCharOffset >= this.textBufferLastLineLength)) {
196 const tokenMetadata = lineTokens.getMetadata(this.lineTokenOffset);
197 while (this.lineTokenOffset + 1 < tokenCount && tokenMetadata === lineTokens.getMetadata(this.lineTokenOffset + 1)) {
198 > // Skip tokens that are identical. tokenizer.ts
199 > // Sometimes, (bracket) identifiers are split up into multiple tokens.
200 > this.lineTokenOffset++;
201 > }
202
203 const isOther = TokenMetadata.getTokenType(tokenMetadata) === StandardTokenType.Other;
216 const match = regexp.exec(text);
217 if (match) {
218 > peekedBracketToken = brackets.getToken(match[0])!; tokenizer.ts
219 > if (peekedBracketToken) {
220 > // Consume leading text of the token
221 > this.lineCharOffset += match.index;
222 > }
223 > }
224 }
225 }
228
229 if (peekedBracketToken) {
230 > // Don't skip the entire token, as a single token could contain multiple brackets. tokenizer.ts
231 >
232 > if (startLineIdx !== this.lineIdx || startLineCharOffset !== this.lineCharOffset) {
233 > // There is text before the bracket
234 > this.peekedToken = peekedBracketToken;
235 > break;
236 > } else {
237 // Consume the peeked token
238 this.lineCharOffset += lengthGetColumnCountIfZeroLineCount(peekedBracketToken.length);
src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsTree/length.ts 4 introduced LOC · 2 ranges

Open complete file

15 return (startLineCount !== endLineCount)
16 ? toLength(endLineCount - startLineCount, endColumnCount)
17 > : toLength(0, endColumnCount - startColumnCount); length.ts
18 }
19
70 */
71 export function lengthGetColumnCountIfZeroLineCount(length: Length): number {
72 > // eslint-disable-next-line local/code-no-any-casts, @typescript-eslint/no-explicit-any length.ts
73 > return length as any as number;
74 > }
75
76