storage.ts ×2

Frontier kind: Code frontier

unlabeled · c_20b53150e77f

98 tests · 12633 LOC · 50 files · introduces 0 tests · 28 LOC · 2 files

Introduces — evidence that enters the hierarchy at this concept

Code
4 ranges28 lines · 2 files
Tests
0 tests

Contains — complete concept membership

All code (extent)
1839 ranges12633 lines · 50 files · Browse complete extent
All tests (intent)
98 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: 28 introduced LOC across 4 ranges. Expand a file to inspect source; the > gutter marks introduced lines.

src/vs/platform/storage/common/storage.ts 26 introduced LOC · 2 ranges

Open complete file

613
614 async flush(reason = WillSaveStateReason.NONE): Promise<void> {
615 > storage.ts
616 > // Signal event to collect changes
617 > this._onWillSaveState.fire({ reason });
618 >
619 > const applicationStorage = this.getStorage(StorageScope.APPLICATION);
620 > const applicationSharedStorage = this.getStorage(StorageScope.APPLICATION_SHARED);
621 > const profileStorage = this.getStorage(StorageScope.PROFILE);
622 > const workspaceStorage = this.getStorage(StorageScope.WORKSPACE);
623 >
624 > switch (reason) {
625 >
626 > // Unspecific reason: just wait when data is flushed
627 > case WillSaveStateReason.NONE:
628 > await Promises.settled([
629 > applicationStorage?.whenFlushed() ?? Promise.resolve(),
630 > applicationSharedStorage?.whenFlushed() ?? Promise.resolve(),
631 > profileStorage?.whenFlushed() ?? Promise.resolve(),
632 > workspaceStorage?.whenFlushed() ?? Promise.resolve()
633 > ]);
634 > break;
635 >
636 > // Shutdown: we want to flush as soon as possible
637 > // and not hit any delays that might be there
638 > case WillSaveStateReason.SHUTDOWN:
639 await Promises.settled([
640 applicationStorage?.flush(0) ?? Promise.resolve(),
644 ]);
645 break;
646 > } storage.ts
647 > }
648
649 async log(): Promise<void> {
src/vs/base/parts/storage/common/storage.ts 2 introduced LOC · 2 ranges

Open complete file

404
405 async whenFlushed(): Promise<void> {
406 > if (!this.hasPending) { storage.ts
407 return; // return early if nothing to do
408 }
409
410 return new Promise(resolve => this.whenFlushedCallbacks.push(resolve));
411 > } storage.ts
412
413 isInMemory(): boolean {