textModel.ts ×20

Frontier kind: Code frontier

unlabeled · c_983230cb5fb4

528 tests · 40420 LOC · 238 files · introduces 0 tests · 342 LOC · 20 files

Introduces — evidence that enters the hierarchy at this concept

Code
73 ranges342 lines · 20 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
4866 ranges40420 lines · 238 files · Browse complete extent
All tests (intent)
528 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.

20 files ranked by introduced lines: 342 introduced LOC across 73 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/textModel.ts 128 introduced LOC · 20 ranges

Open complete file

204
205 public static resolveOptions(textBuffer: model.ITextBuffer, options: model.ITextModelCreationOptions): model.TextModelResolvedOptions {
206 > if (options.detectIndentation) { textModel.ts
207 const guessedIndentation = guessIndentation(textBuffer, options.tabSize, options.insertSpaces);
208 return new model.TextModelResolvedOptions({
217
218 return new model.TextModelResolvedOptions(options);
219 > } textModel.ts
220
221 //#region Events
304
305 constructor(
306 > source: string | model.ITextBufferFactory, textModel.ts
307 > languageIdOrSelection: string | ILanguageSelection,
308 > creationOptions: model.ITextModelCreationOptions,
309 > associatedResource: URI | null = null,
310 > @IUndoRedoService private readonly _undoRedoService: IUndoRedoService,
311 > @ILanguageService private readonly _languageService: ILanguageService,
312 > @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,
313 > @IInstantiationService private readonly instantiationService: IInstantiationService
314 > ) {
315 > super();
316 >
317 > // Generate a new unique model id
318 > MODEL_ID++;
319 > this.id = '$model' + MODEL_ID;
320 > this.isForSimpleWidget = creationOptions.isForSimpleWidget;
321 > if (typeof associatedResource === 'undefined' || associatedResource === null) {
322 this._associatedResource = URI.parse('inmemory://model/' + MODEL_ID);
323 > } else { textModel.ts
324 this._associatedResource = associatedResource;
325 }
326 > this._attachedEditorCount = 0; textModel.ts
327 >
328 > const { textBuffer, disposable } = createTextBuffer(source, creationOptions.defaultEOL);
329 > this._buffer = textBuffer;
330 > this._bufferDisposable = disposable;
331 >
332 > const bufferLineCount = this._buffer.getLineCount();
333 > const bufferTextLength = this._buffer.getValueLengthInRange(new Range(1, 1, bufferLineCount, this._buffer.getLineLength(bufferLineCount) + 1), model.EndOfLinePreference.TextDefined);
334 >
335 > // !!! Make a decision in the ctor and permanently respect this decision !!!
336 > // If a model is too large at construction time, it will never get tokenized,
337 > // under no circumstances.
338 > if (creationOptions.largeFileOptimizations) {
339 > this._isTooLargeForTokenization = (
340 > (bufferTextLength > TextModel.LARGE_FILE_SIZE_THRESHOLD)
341 > || (bufferLineCount > TextModel.LARGE_FILE_LINE_COUNT_THRESHOLD)
342 > );
343 >
344 > this._isTooLargeForHeapOperation = bufferTextLength > TextModel.LARGE_FILE_HEAP_OPERATION_THRESHOLD;
345 > } else {
346 this._isTooLargeForTokenization = false;
347 this._isTooLargeForHeapOperation = false;
348 }
349 > textModel.ts
350 > this._options = TextModel.resolveOptions(this._buffer, creationOptions);
351 >
352 > const languageId = (typeof languageIdOrSelection === 'string' ? languageIdOrSelection : languageIdOrSelection.languageId);
353 > if (typeof languageIdOrSelection !== 'string') {
354 this._languageSelectionListener.value = languageIdOrSelection.onDidChange(() => this._setLanguage(languageIdOrSelection.languageId));
355 }
356 > textModel.ts
357 > this._bracketPairs = this._register(new BracketPairsTextModelPart(this, this._languageConfigurationService));
358 > this._guidesTextModelPart = this._register(new GuidesTextModelPart(this, this._languageConfigurationService));
359 > this._decorationProvider = this._register(new ColorizedBracketPairsDecorationProvider(this));
360 > this._tokenizationTextModelPart = this.instantiationService.createInstance(TokenizationTextModelPart,
361 > this,
362 > this._bracketPairs,
363 > languageId,
364 > this._attachedViews
365 > );
366 > this._fontTokenDecorationsProvider = this._register(new TokenizationFontDecorationProvider(this, this._tokenizationTextModelPart));
367 >
368 > this._isTooLargeForSyncing = (bufferTextLength > TextModel._MODEL_SYNC_LIMIT);
369 >
370 > this._versionId = 1;
371 > this._alternativeVersionId = 1;
372 > this._initialUndoRedoSnapshot = null;
373 >
374 > this._isDisposed = false;
375 > this.__isDisposing = false;
376 >
377 > this._instanceId = strings.singleLetterHash(MODEL_ID);
378 > this._lastDecorationId = 0;
379 > this._decorations = Object.create(null);
380 > this._decorationsTree = new DecorationsTrees();
381 >
382 > this._commandManager = new EditStack(this, this._undoRedoService);
383 > this._isUndoing = false;
384 > this._isRedoing = false;
385 > this._trimAutoWhitespaceLines = null;
386 >
387 >
388 > this._register(this._decorationProvider.onDidChange(() => {
389 this._onDidChangeDecorations.beginDeferredEmit();
390 this._onDidChangeDecorations.fire();
391 this._onDidChangeDecorations.endDeferredEmit();
392 > })); textModel.ts
393 > this._register(this._fontTokenDecorationsProvider.onDidChangeLineHeight((affectedLineHeights) => {
394 this._onDidChangeDecorations.beginDeferredEmit();
395 this._onDidChangeDecorations.fire();
396 this._fireOnDidChangeLineHeight(affectedLineHeights);
397 this._onDidChangeDecorations.endDeferredEmit();
398 > })); textModel.ts
399 > this._register(this._fontTokenDecorationsProvider.onDidChangeFont((affectedFontLines) => {
400 this._onDidChangeDecorations.beginDeferredEmit();
401 this._onDidChangeDecorations.fire();
402 this._fireOnDidChangeFont(affectedFontLines);
403 this._onDidChangeDecorations.endDeferredEmit();
404 > })); textModel.ts
405 >
406 > this._languageService.requestRichLanguageFeatures(languageId);
407 >
408 > this._register(this._languageConfigurationService.onDidChange(e => {
409 this._bracketPairs.handleLanguageConfigurationServiceChange(e);
410 this._tokenizationTextModelPart.handleLanguageConfigurationServiceChange(e);
411 > })); textModel.ts
412 > }
413
414 public override dispose(): void {
415 > this.__isDisposing = true; textModel.ts
416 > this._onWillDispose.fire();
417 > this._tokenizationTextModelPart.dispose();
418 > this._isDisposed = true;
419 > super.dispose();
420 > this._bufferDisposable.dispose();
421 > this.__isDisposing = false;
422 > // Manually release reference to previous text buffer to avoid large leaks
423 > // in case someone leaks a TextModel reference
424 > const emptyDisposedTextBuffer = new PieceTreeTextBuffer([], '', '\n', false, false, true, true);
425 > emptyDisposedTextBuffer.dispose();
426 > this._buffer = emptyDisposedTextBuffer;
427 > this._bufferDisposable = Disposable.None;
428 > }
429
430 _hasListeners(): boolean {
442
443 private _assertNotDisposed(): void {
444 > if (this._isDisposed) { textModel.ts
445 throw new BugIndicatingError('Model is disposed!');
446 }
447 > } textModel.ts
448
449 public registerViewModel(viewModel: IViewModel): void {
636
637 public isTooLargeForTokenization(): boolean {
638 > return this._isTooLargeForTokenization; textModel.ts
639 > }
640
641 public isTooLargeForHeapOperation(): boolean {
676
677 public getOptions(): model.TextModelResolvedOptions {
678 > this._assertNotDisposed(); textModel.ts
679 > return this._options;
680 > }
681
682 public getFormattingOptions(): FormattingOptions {
845
846 public getLineCount(): number {
847 > this._assertNotDisposed(); textModel.ts
848 > return this._buffer.getLineCount();
849 > }
850
851 public getLineContent(lineNumber: number): string {
2213
2214 constructor() {
2215 > this._decorationsTree0 = new IntervalTree(); textModel.ts
2216 > this._decorationsTree1 = new IntervalTree();
2217 > this._injectedTextDecorationsTree = new IntervalTree();
2218 > }
2219
2220 public ensureAllNodesHaveRanges(host: IDecorationsTreesHost): void {
2600
2601 constructor(private readonly handleBeforeFire: (affectedInjectedTextLines: Set<number> | null, affectedLineHeights: SetWithKey<LineHeightChangingDecoration> | null, affectedFontLines: SetWithKey<LineFontChangingDecoration> | null) => void) {
2602 > super(); textModel.ts
2603 > this._deferredCnt = 0;
2604 > this._shouldFireDeferred = false;
2605 > this._affectsMinimap = false;
2606 > this._affectsOverviewRuler = false;
2607 > this._affectsGlyphMargin = false;
2608 > this._affectsLineNumber = false;
2609 > }
2610
2611 hasListeners(): boolean {
2705
2706 constructor() {
2707 > super(); textModel.ts
2708 > this._deferredCnt = 0;
2709 > this._deferredEvent = null;
2710 > }
2711
2712 public hasListeners(): boolean {
src/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.ts 52 introduced LOC · 13 ranges

Open complete file

42
43 constructor(
44 > languageIdCodec: ILanguageIdCodec, tokenizerSyntaxTokenBackend.ts
45 > textModel: TextModel,
46 > private readonly getLanguageId: () => string,
47 > attachedViews: AttachedViews,
48 > ) {
49 > super(languageIdCodec, textModel);
50 >
51 > this._register(TokenizationRegistry.onDidChange((e) => {
52 const languageId = this.getLanguageId();
53 if (e.changedLanguages.indexOf(languageId) === -1) {
55 }
56 this.todo_resetTokenization();
58 >
59 > this.todo_resetTokenization();
60 >
61 > this._register(attachedViews.onDidChangeVisibleRanges(({ view, state }) => {
62 if (state) {
63 let existing = this._attachedViewStates.get(view);
70 this._attachedViewStates.deleteAndDispose(view);
71 }
73 > }
74
75 public todo_resetTokenization(fireTokenChangeEvent: boolean = true): void {
76 > this._tokens.flush(); tokenizerSyntaxTokenBackend.ts
77 > this._debugBackgroundTokens?.flush();
78 > if (this._debugBackgroundStates) {
79 this._debugBackgroundStates = new TrackingTokenizationStateStore(this._textModel.getLineCount());
80 }
81 > if (fireTokenChangeEvent) { tokenizerSyntaxTokenBackend.ts
82 > this._onDidChangeTokens.fire({
83 > semanticTokensApplied: false,
84 > ranges: [
85 > {
86 > fromLineNumber: 1,
87 > toLineNumber: this._textModel.getLineCount(),
88 > },
89 > ],
90 > });
91 > }
92 >
93 > const initializeTokenization = (): [ITokenizationSupport, IState] | [null, null] => {
94 > if (this._textModel.isTooLargeForTokenization()) {
95 return [null, null];
96 }
97 > const tokenizationSupport = TokenizationRegistry.get(this.getLanguageId()); tokenizerSyntaxTokenBackend.ts
98 > if (!tokenizationSupport) {
99 return [null, null];
100 }
107 }
108 return [tokenizationSupport, initialState];
110 >
111 > const [tokenizationSupport, initialState] = initializeTokenization();
112 > if (tokenizationSupport && initialState) {
113 this._tokenizer = new TokenizerWithStateStoreAndTextModel(this._textModel.getLineCount(), tokenizationSupport, this._textModel, this._languageIdCodec);
115 this._tokenizer = null;
116 }
118 > this._backgroundTokenizer.clear();
119 >
120 > this._defaultBackgroundTokenizer = null;
121 > if (this._tokenizer) {
122 const b: IBackgroundTokenizationStore = {
123 setTokens: (tokens) => {
222
223 private refreshAllVisibleLineTokens(): void {
224 > const ranges = LineRange.joinMany([...this._attachedViewStates].map(([_, s]) => s.lineRanges)); tokenizerSyntaxTokenBackend.ts
225 > this.refreshRanges(ranges);
226 > }
227
228 private refreshRanges(ranges: readonly LineRange[]): void {
229 > for (const range of ranges) { tokenizerSyntaxTokenBackend.ts
230 this.refreshRange(range.startLineNumber, range.endLineNumberExclusive - 1);
231 }
233
234 private refreshRange(startLineNumber: number, endLineNumber: number): void {
src/vs/editor/common/model/tokens/tokenizationTextModelPart.ts 51 introduced LOC · 6 ranges

Open complete file

49
50 constructor(
51 > private readonly _textModel: TextModel, tokenizationTextModelPart.ts
52 > private readonly _bracketPairsTextModelPart: BracketPairsTextModelPart,
53 > private _languageId: string,
54 > private readonly _attachedViews: AttachedViews,
55 > @ILanguageService private readonly _languageService: ILanguageService,
56 > @ILanguageConfigurationService private readonly _languageConfigurationService: ILanguageConfigurationService,
57 > @IInstantiationService private readonly _instantiationService: IInstantiationService,
58 > @ITreeSitterLibraryService private readonly _treeSitterLibraryService: ITreeSitterLibraryService,
59 > ) {
60 > super();
61 >
62 > this._languageIdObs = observableValue(this, this._languageId);
63 >
64 > this._useTreeSitter = derived(this, reader => {
65 > const languageId = this._languageIdObs.read(reader);
66 > return this._treeSitterLibraryService.supportsLanguage(languageId, reader);
67 > });
68 >
69 > this.tokens = derived(this, reader => {
70 > let tokens: AbstractSyntaxTokenBackend;
71 > if (this._useTreeSitter.read(reader)) {
72 tokens = reader.store.add(this._instantiationService.createInstance(
73 TreeSitterSyntaxTokenBackend,
77 this._attachedViews.visibleLineRanges
78 ));
80 > tokens = reader.store.add(new TokenizerSyntaxTokenBackend(this._languageService.languageIdCodec, this._textModel, () => this._languageId, this._attachedViews));
81 > }
82 >
83 > reader.store.add(tokens.onDidChangeTokens(e => {
84 this._emitModelTokensChangedEvent(e);
86 > reader.store.add(tokens.onDidChangeFontTokens(e => {
87 if (!this._textModel._isDisposing()) {
88 this._onDidChangeFontTokens.fire(e);
89 }
91 >
92 > reader.store.add(tokens.onDidChangeBackgroundTokenizationState(e => {
93 this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState();
95 > return tokens;
96 > });
97 >
98 > let hadTokens = false;
99 > this.tokens.recomputeInitiallyAndOnChange(this._store, value => {
100 > if (hadTokens) {
101 // We need to reset the tokenization, as the new token provider otherwise won't have a chance to provide tokens until some action happens in the editor.
102 // TODO@hediet: Look into why this is needed.
103 value.todo_resetTokenization();
104 }
105 > hadTokens = true; tokenizationTextModelPart.ts
106 > });
107 >
108 > this._semanticTokens = new SparseTokensStore(this._languageService.languageIdCodec);
109 > this._onDidChangeLanguage = this._register(new Emitter<IModelLanguageChangedEvent>());
110 > this.onDidChangeLanguage = this._onDidChangeLanguage.event;
111 > this._onDidChangeLanguageConfiguration = this._register(new Emitter<IModelLanguageConfigurationChangedEvent>());
112 > this.onDidChangeLanguageConfiguration = this._onDidChangeLanguageConfiguration.event;
113 > this._onDidChangeTokens = this._register(new Emitter<IModelTokensChangedEvent>());
114 > this.onDidChangeTokens = this._onDidChangeTokens.event;
115 > this._onDidChangeFontTokens = this._register(new Emitter<IModelFontTokensChangedEvent>());
116 > this.onDidChangeFontTokens = this._onDidChangeFontTokens.event;
117 > }
118
119 _hasListeners(): boolean {
src/vs/editor/common/services/languageService.ts 17 introduced LOC · 2 ranges

Open complete file

129
130 public requestBasicLanguageFeatures(languageId: string): void {
131 > if (!this._requestedBasicLanguages.has(languageId)) { languageService.ts
132 > this._requestedBasicLanguages.add(languageId);
133 > this._onDidRequestBasicLanguageFeatures.fire(languageId);
134 > }
135 > }
136
137 public requestRichLanguageFeatures(languageId: string): void {
138 > if (!this._requestedRichLanguages.has(languageId)) { languageService.ts
139 > this._requestedRichLanguages.add(languageId);
140 >
141 > // Ensure basic features are requested
142 > this.requestBasicLanguageFeatures(languageId);
143 >
144 > // Ensure tokenizers are created
145 > TokenizationRegistry.getOrCreate(languageId);
146 >
147 > this._onDidRequestRichLanguageFeatures.fire(languageId);
148 > }
149 > }
150 }
151
src/vs/editor/common/model.ts 15 introduced LOC · 3 ranges

Open complete file

577 */
578 constructor(src: {
579 > tabSize: number; model.ts
580 > indentSize: number | 'tabSize';
581 > insertSpaces: boolean;
582 > defaultEOL: DefaultEndOfLine;
583 > trimAutoWhitespace: boolean;
584 > bracketPairColorizationOptions: BracketPairColorizationOptions;
585 > }) {
586 > this.tabSize = Math.max(1, src.tabSize | 0);
587 > if (src.indentSize === 'tabSize') {
588 this.indentSize = this.tabSize;
589 this._indentSizeIsTabSize = true;
590 > } else { model.ts
591 this.indentSize = Math.max(1, src.indentSize | 0);
592 this._indentSizeIsTabSize = false;
593 }
594 > this.insertSpaces = Boolean(src.insertSpaces); model.ts
595 > this.defaultEOL = src.defaultEOL | 0;
596 > this.trimAutoWhitespace = Boolean(src.trimAutoWhitespace);
597 > this.bracketPairColorizationOptions = src.bracketPairColorizationOptions;
598 > }
599
600 /**
src/vs/editor/common/model/tokens/abstractSyntaxTokenBackend.ts 13 introduced LOC · 4 ranges

Open complete file

32
33 constructor() {
34 > this.visibleLineRanges = derivedOpts({ abstractSyntaxTokenBackend.ts
35 > owner: this,
36 > equalsFn: arrayEqualsC(thisEqualsC())
37 > }, reader => {
38 this._viewsChanged.read(reader);
39 const ranges = LineRange.joinMany(
155
156 constructor(
157 > protected readonly _languageIdCodec: ILanguageIdCodec, abstractSyntaxTokenBackend.ts
158 > protected readonly _textModel: TextModel,
159 > ) {
160 > super();
161 > }
162
163 public abstract todo_resetTokenization(fireTokenChangeEvent?: boolean): void;
src/vs/editor/common/model/bracketPairsTextModelPart/colorizedBracketPairsDecorationProvider.ts 9 introduced LOC · 3 ranges

Open complete file

87 }
88
89 > class ColorProvider { colorizedBracketPairsDecorationProvider.ts
90 > public readonly unexpectedClosingBracketClassName = 'unexpected-closing-bracket';
91
92 getInlineClassName(bracket: BracketInfo, independentColorPoolPerBracketType: boolean): string {
src/vs/editor/common/model/tokens/tokenizationFontDecorationsProvider.ts 7 introduced LOC · 2 ranges

Open complete file

35
36 constructor(
37 > private readonly textModel: ITextModel, tokenizationFontDecorationsProvider.ts
38 > private readonly tokenizationTextModelPart: TokenizationTextModelPart
39 > ) {
40 > super();
41 > this._register(this.tokenizationTextModelPart.onDidChangeFontTokens(fontChanges => {
42
43 const linesChanged = new Set<number>();
95 this._onDidChangeLineHeight.fire(affectedLineHeights);
96 this._onDidChangeFont.fire(affectedLineFonts);
98 > }
99
100 public handleDidChangeContent(change: IModelContentChangedEvent) {
src/vs/editor/common/tokens/contiguousTokensStore.ts 7 introduced LOC · 2 ranges

Open complete file

23
24 constructor(languageIdCodec: ILanguageIdCodec) {
25 > this._lineTokens = []; contiguousTokensStore.ts
26 > this._len = 0;
27 > this._languageIdCodec = languageIdCodec;
28 > }
29
30 public flush(): void {
31 > this._lineTokens = []; contiguousTokensStore.ts
32 > this._len = 0;
33 > }
34
35 get hasTokens(): boolean {
src/vs/editor/common/model/bracketPairsTextModelPart/bracketPairsImpl.ts 5 introduced LOC · 1 range

Open complete file

33
34 public constructor(
35 > private readonly textModel: TextModel, bracketPairsImpl.ts
36 > private readonly languageConfigurationService: ILanguageConfigurationService
37 > ) {
38 > super();
39 > }
40
41 //#region TextModel events
src/vs/editor/common/model/guidesTextModelPart.ts 5 introduced LOC · 1 range

Open complete file

18 export class GuidesTextModelPart extends TextModelPart implements IGuidesTextModelPart {
19 constructor(
20 > private readonly textModel: TextModel, guidesTextModelPart.ts
21 > private readonly languageConfigurationService: ILanguageConfigurationService
22 > ) {
23 > super();
24 > }
25
26 private getLanguageConfiguration(
src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeBase.ts 5 introduced LOC · 2 ranges

Open complete file

655
656 public getLineLength(lineNumber: number): number {
657 > if (lineNumber === this.getLineCount()) { pieceTreeBase.ts
658 > const startOffset = this.getOffsetAt(lineNumber, 1);
659 > return this.getLength() - startOffset;
660 > }
661 return this.getOffsetAt(lineNumber + 1, 1) - this.getOffsetAt(lineNumber, 1) - this._EOLLength;
663
664 public getCharCode(offset: number): number {
src/vs/editor/common/tokenizationRegistry.ts 5 introduced LOC · 3 ranges

Open complete file

62
63 public async getOrCreate(languageId: string): Promise<TSupport | null> {
64 > // check first if the support is already set tokenizationRegistry.ts
65 > const tokenizationSupport = this.get(languageId);
66 > if (tokenizationSupport) {
67 return tokenizationSupport;
68 }
69
70 const factory = this._factories.get(languageId);
71 > if (!factory || factory.isResolved) { tokenizationRegistry.ts
72 // no factory or factory.resolve already finished
73 return null;
77
78 return this.get(languageId);
80
81 public isResolved(languageId: string): boolean {
src/vs/base/common/equals.ts 4 introduced LOC · 2 ranges

Open complete file

45 */
46 export function arrayEqualsC<T>(itemEquals?: EqualityComparer<T>): EqualityComparer<readonly T[]> {
47 > return (a, b) => arrays.equals(a, b, itemEquals ?? strictEquals); equals.ts
48 > }
49
50 /**
156 */
157 export function thisEqualsC<T extends IEquatable<T>>(): EqualityComparer<T> {
158 > return (a, b) => a.equals(b); equals.ts
159 > }
160
161 /**
src/vs/editor/common/core/ranges/lineRange.ts 4 introduced LOC · 2 ranges

Open complete file

50 */
51 public static joinMany(lineRanges: readonly (readonly LineRange[])[]): readonly LineRange[] {
52 > if (lineRanges.length === 0) { lineRange.ts
53 > return [];
54 > }
55 let result = new LineRangeSet(lineRanges[0].slice());
56 for (let i = 1; i < lineRanges.length; i++) {
58 }
59 return result.ranges;
60 > } lineRange.ts
61
62 public static join(lineRanges: LineRange[]): LineRange {
src/vs/editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.ts 4 introduced LOC · 2 ranges

Open complete file

177
178 public getLineCount(): number {
179 > return this._pieceTree.getLineCount(); pieceTreeTextBuffer.ts
180 > }
181
182 public getLinesContent(): string[] {
197
198 public getLineLength(lineNumber: number): number {
199 > return this._pieceTree.getLineLength(lineNumber); pieceTreeTextBuffer.ts
200 > }
201
202 public getLineMinColumn(lineNumber: number): number {
src/vs/editor/common/model/textModelPart.ts 4 introduced LOC · 2 ranges

Open complete file

7
8 export class TextModelPart extends Disposable {
9 > private _isDisposed = false; textModelPart.ts
10
11 public override dispose(): void {
12 > super.dispose(); textModelPart.ts
13 > this._isDisposed = true;
14 > }
15 protected assertNotDisposed(): void {
16 if (this._isDisposed) {
src/vs/editor/common/model/editStack.ts 3 introduced LOC · 1 range

Open complete file

388
389 constructor(model: TextModel, undoRedoService: IUndoRedoService) {
390 > this._model = model; editStack.ts
391 > this._undoRedoService = undoRedoService;
392 > }
393
394 public pushStackElement(): void {
src/vs/base/common/observableInternal/observables/observableSignal.ts 2 introduced LOC · 1 range

Open complete file

21 return new ObservableSignal<TDelta>(debugNameOrOwner, undefined, debugLocation);
22 } else {
23 > return new ObservableSignal<TDelta>(undefined, debugNameOrOwner, debugLocation); observableSignal.ts
24 > }
25 }
26
src/vs/editor/test/common/services/testTreeSitterLibraryService.ts 2 introduced LOC · 1 range

Open complete file

16
17 supportsLanguage(languageId: string, reader: IReader | undefined): boolean {
18 > return false; testTreeSitterLibraryService.ts
19 > }
20
21 getLanguage(languageId: string, ignoreSupportsCheck: boolean, reader: IReader | undefined): Language | undefined {