textModel.ts ×3

Frontier kind: Code frontier

unlabeled · c_2bf52e141a65

4 tests · 40939 LOC · 238 files · introduces 0 tests · 51 LOC · 7 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges51 lines · 7 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
5062 ranges40939 lines · 238 files · Browse complete extent
All tests (intent)
4 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.

7 files ranked by introduced lines: 51 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/editor/common/model/textModel.ts 38 introduced LOC · 3 ranges

Open complete file

483
484 public setValue(value: string | model.ITextSnapshot, reason = EditSources.setValue()): void {
485 > this._assertNotDisposed(); textModel.ts
486 >
487 > if (value === null || value === undefined) {
488 throw illegalArgument();
489 }
490 > textModel.ts
491 > const { textBuffer, disposable } = createTextBuffer(value, this._options.defaultEOL);
492 > this._setValueFromTextBuffer(textBuffer, disposable, reason);
493 > }
494
495 private _createContentChanged2(range: Range, rangeOffset: number, rangeLength: number, rangeEndPosition: Position, text: string, isUndoing: boolean, isRedoing: boolean, isFlush: boolean, isEolChange: boolean, reason: TextModelEditSource): IModelContentChangedEvent {
513
514 private _setValueFromTextBuffer(textBuffer: model.ITextBuffer, textBufferDisposable: IDisposable, reason: TextModelEditSource): void {
515 > this._assertNotDisposed(); textModel.ts
516 > const oldFullModelRange = this.getFullModelRange();
517 > const oldModelValueLength = this.getValueLengthInRange(oldFullModelRange);
518 > const endLineNumber = this.getLineCount();
519 > const endColumn = this.getLineMaxColumn(endLineNumber);
520 >
521 > this._buffer = textBuffer;
522 > this._bufferDisposable.dispose();
523 > this._bufferDisposable = textBufferDisposable;
524 > this._increaseVersionId();
525 >
526 > // Destroy all my decorations
527 > this._decorations = Object.create(null);
528 > this._decorationsTree = new DecorationsTrees();
529 >
530 > // Destroy my edit history and settings
531 > this._commandManager.clear();
532 > this._trimAutoWhitespaceLines = null;
533 >
534 > this._emitContentChangedEvent(
535 > new ModelRawContentChangedEvent(
536 > [
537 > new ModelRawFlush()
538 > ],
539 > this._versionId,
540 > false,
541 > false
542 > ),
543 > this._createContentChanged2(new Range(1, 1, endLineNumber, endColumn), 0, oldModelValueLength, new Position(endLineNumber, endColumn), this.getValue(), false, false, true, false, reason)
544 > );
545 > }
546
547 public setEOL(eol: model.EndOfLineSequence): void {
src/vs/platform/undoRedo/common/undoRedoService.ts 4 introduced LOC · 3 ranges

Open complete file

604
605 public removeElements(resource: URI | string): void {
606 > const strResource = typeof resource === 'string' ? resource : this.getUriComparisonKey(resource); undoRedoService.ts
607 > if (this._editStacks.has(strResource)) {
608 const editStack = this._editStacks.get(strResource)!;
609 editStack.dispose();
610 this._editStacks.delete(strResource);
611 }
612 > if (DEBUG) { undoRedoService.ts
613 this._print('removeElements');
614 }
616
617 public setElementsValidFlag(resource: URI, isValid: boolean, filter: (element: IUndoRedoElement) => boolean): void {
src/vs/editor/common/tokens/sparseTokensStore.ts 3 introduced LOC · 1 range

Open complete file

28
29 public flush(): void {
30 > this._pieces = []; sparseTokensStore.ts
31 > this._isComplete = false;
32 > }
33
34 public isEmpty(): boolean {
src/vs/editor/common/model/editStack.ts 2 introduced LOC · 1 range

Open complete file

407
408 public clear(): void {
409 > this._undoRedoService.removeElements(this._model.uri); editStack.ts
410 > }
411
412 private _getOrCreateEditStackElement(beforeCursorState: Selection[] | null, group: UndoRedoGroup | undefined): EditStackElement {
src/vs/editor/common/model/tokens/tokenizerSyntaxTokenBackend.ts 2 introduced LOC · 1 range

Open complete file

189 public handleDidChangeContent(e: IModelContentChangedEvent): void {
190 if (e.isFlush) {
191 > // Don't fire the event, as the view might not have got the text change event yet tokenizerSyntaxTokenBackend.ts
192 > this.todo_resetTokenization(false);
193 } else if (!e.isEolChange) { // We don't have to do anything on an EOL change
194 for (const c of e.changes) {
src/vs/editor/common/model/tokens/tokenizationTextModelPart.ts 1 introduced LOC · 1 range

Open complete file

133 public handleDidChangeContent(e: IModelContentChangedEvent): void {
134 if (e.isFlush) {
135 > this._semanticTokens.flush(); tokenizationTextModelPart.ts
136 } else if (!e.isEolChange) { // We don't have to do anything on an EOL change
137 for (const c of e.changes) {
src/vs/editor/common/textModelEvents.ts 1 introduced LOC · 1 range

Open complete file

232 */
233 export class ModelRawFlush {
234 > public readonly changeType = RawContentChangedType.Flush; textModelEvents.ts
235 }
236