Skip to content

Commit 72ddb69

Browse files
authored
skip writing to disk cache when a storage write contains container moves precisely this matters if some of the containers are generated as a result of view movement
1 parent b57e1c8 commit 72ddb69

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/vs/workbench/services/views/browser/viewDescriptorService.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
318318
return this.viewContainersRegistry.getDefaultViewContainer(location);
319319
}
320320

321-
moveViewContainerToLocation(viewContainer: ViewContainer, location: ViewContainerLocation, requestedIndex?: number): void {
321+
private doMoveViewContainerToLocation(viewContainer: ViewContainer, location: ViewContainerLocation, requestedIndex?: number, skipDiskWrite?: boolean): void {
322322
const from = this.getViewContainerLocation(viewContainer);
323323
const to = location;
324324
if (from !== to) {
@@ -333,10 +333,18 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
333333
const views = this.getViewsByContainer(viewContainer);
334334
this._onDidChangeLocation.fire({ views, from, to });
335335

336-
this.saveViewContainerLocationsToCache();
336+
// Need to skip when syncing multiple container movements - vscode#148363
337+
if (!skipDiskWrite) {
338+
this.saveViewContainerLocationsToCache();
339+
}
337340
}
338341
}
339342

343+
moveViewContainerToLocation(viewContainer: ViewContainer, location: ViewContainerLocation, requestedIndex?: number): void {
344+
this.doMoveViewContainerToLocation(viewContainer, location, requestedIndex);
345+
}
346+
347+
340348
moveViewToLocation(view: IViewDescriptor, location: ViewContainerLocation): void {
341349
let container = this.registerGeneratedViewContainer(location);
342350
this.moveViewsToContainer([view], container);
@@ -608,7 +616,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
608616

609617
// Execute View Container Movement
610618
for (const [container, location] of viewContainersToMove) {
611-
this.moveViewContainerToLocation(container, location);
619+
this.doMoveViewContainerToLocation(container, location, undefined, true);
612620
}
613621

614622
this.cachedViewContainerInfo = this.getCachedViewContainerLocations();

0 commit comments

Comments
 (0)