undoRedoService.ts ×9

Frontier kind: Code frontier

unlabeled · c_96eadedc567e

18 tests · 7525 LOC · 40 files · introduces 0 tests · 31 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
11 ranges31 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
982 ranges7525 lines · 40 files · Browse complete extent
All tests (intent)
18 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: 31 introduced LOC across 11 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/undoRedo/common/undoRedoService.ts 27 introduced LOC · 9 ranges

Open complete file

17 const DEBUG = false;
18
19 > function getResourceLabel(resource: URI): string { undoRedoService.ts
20 > return resource.scheme === Schemas.file ? resource.fsPath : resource.path;
21 > }
22
23 let stackElementCounter = 0;
283
284 public pushElement(element: StackElement): void {
285 > // remove the future undoRedoService.ts
286 > for (const futureElement of this._future) {
287 if (futureElement.type === UndoRedoElementType.Workspace) {
288 futureElement.removeResource(this.resourceLabel, this.strResource, RemovedResourceReason.NoParallelUniverses);
289 }
290 }
291 > this._future = []; undoRedoService.ts
292 > this._past.push(element);
293 > this.versionId++;
294 > }
295
296 public createSnapshot(resource: URI): ResourceEditStackSnapshot {
504
505 public pushElement(element: IUndoRedoElement, group: UndoRedoGroup = UndoRedoGroup.None, source: UndoRedoSource = UndoRedoSource.None): void {
506 > if (element.type === UndoRedoElementType.Resource) { undoRedoService.ts
507 const resourceLabel = getResourceLabel(element.resource);
508 const strResource = this.getUriComparisonKey(element.resource);
509 this._pushElement(new ResourceStackElement(element, resourceLabel, strResource, group.id, group.nextOrder(), source.id, source.nextOrder()));
510 > } else { undoRedoService.ts
511 const seen = new Set<string>();
512 const resourceLabels: string[] = [];
530 }
531 }
532 > if (DEBUG) { undoRedoService.ts
533 this._print('pushElement');
534 }
536
537 private _pushElement(element: StackElement): void {
538 > for (let i = 0, len = element.strResources.length; i < len; i++) { undoRedoService.ts
539 > const resourceLabel = element.resourceLabels[i];
540 > const strResource = element.strResources[i];
541 >
542 > let editStack: ResourceEditStack;
543 > if (this._editStacks.has(strResource)) {
544 editStack = this._editStacks.get(strResource)!;
545 > } else { undoRedoService.ts
546 > editStack = new ResourceEditStack(resourceLabel, strResource);
547 > this._editStacks.set(strResource, editStack);
548 > }
549 >
550 > editStack.pushElement(element);
551 > }
552 > }
553
554 public getLastElement(resource: URI): IUndoRedoElement | null {
src/vs/platform/undoRedo/common/undoRedo.ts 4 introduced LOC · 2 ranges

Open complete file

122
123 public nextOrder(): number {
124 > if (this.id === 0) { undoRedo.ts
125 > return 0;
126 > }
127 return this.order++;
128 > } undoRedo.ts
129
130 public static None = new UndoRedoSource();