supports.ts ×10

Frontier kind: Code frontier

unlabeled · c_e3973b36f334

888 tests · 6761 LOC · 37 files · introduces 0 tests · 44 LOC · 1 file

Introduces — evidence that enters the hierarchy at this concept

Code
10 ranges44 lines · 1 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
902 ranges6761 lines · 37 files · Browse complete extent
All tests (intent)
888 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.

1 file ranked by introduced lines: 44 introduced LOC across 10 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/languages/supports.ts 44 introduced LOC · 10 ranges

Open complete file

1 > /*--------------------------------------------------------------------------------------------- supports.ts
2 > * Copyright (c) Microsoft Corporation. All rights reserved.
3 > * Licensed under the MIT License. See License.txt in the project root for license information.
4 > *--------------------------------------------------------------------------------------------*/
5 >
6 > import { IViewLineTokens, LineTokens } from '../tokens/lineTokens.js';
7 > import { StandardTokenType } from '../encodedTokenAttributes.js';
8 > import { ILanguageIdCodec } from '../languages.js';
9 >
10 > export function createScopedLineTokens(context: LineTokens, offset: number): ScopedLineTokens {
11 const tokenCount = context.getCount();
12 const tokenIndex = context.findTokenIndexAtOffset(offset);
32 );
33 }
35 > export class ScopedLineTokens {
36 > _scopedLineTokensBrand: void = undefined;
37 >
38 > public readonly languageIdCodec: ILanguageIdCodec;
39 > public readonly languageId: string;
40 > private readonly _actual: LineTokens;
41 > private readonly _firstTokenIndex: number;
42 > private readonly _lastTokenIndex: number;
43 > public readonly firstCharOffset: number;
44 > private readonly _lastCharOffset: number;
45 >
46 > constructor(
47 actual: LineTokens,
48 languageId: string,
60 this.languageIdCodec = actual.languageIdCodec;
61 }
63 > public getLineContent(): string {
64 const actualLineContent = this._actual.getLineContent();
65 return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset);
66 }
68 > public getLineLength(): number {
69 return this._lastCharOffset - this.firstCharOffset;
70 }
72 > public getActualLineContentBefore(offset: number): string {
73 const actualLineContent = this._actual.getLineContent();
74 return actualLineContent.substring(0, this.firstCharOffset + offset);
75 }
77 > public getTokenCount(): number {
78 return this._lastTokenIndex - this._firstTokenIndex;
79 }
81 > public findTokenIndexAtOffset(offset: number): number {
82 return this._actual.findTokenIndexAtOffset(offset + this.firstCharOffset) - this._firstTokenIndex;
83 }
85 > public getStandardTokenType(tokenIndex: number): StandardTokenType {
86 return this._actual.getStandardTokenType(tokenIndex + this._firstTokenIndex);
87 }
89 > public toIViewLineTokens(): IViewLineTokens {
90 return this._actual.sliceAndInflate(this.firstCharOffset, this._lastCharOffset, 0);
91 }
92 > } supports.ts
93 >
94 > const enum IgnoreBracketsInTokens {
95 > value = StandardTokenType.Comment | StandardTokenType.String | StandardTokenType.RegEx
96 > }
97 >
98 > export function ignoreBracketsInToken(standardTokenType: StandardTokenType): boolean {
99 return (standardTokenType & IgnoreBracketsInTokens.value) !== 0;
100 }