From 71776589163b831768c408bcad2a87d73941bbb6 Mon Sep 17 00:00:00 2001 From: Jackson Kearl Date: Wed, 1 Jul 2020 18:01:45 -0700 Subject: [PATCH] Revert "Fix #98766 - Reloading a dirty saved search editor causes a phantom tab to appear" This reverts commit 028241b16005863c63d96505e54fb95a02dad59f. This fixes #99621, but re-introduces #98766 I'm not sure of a way to remove both bugs, it will likely involve large refactorings. --- .../workbench/contrib/searchEditor/browser/searchEditorInput.ts | 2 +- .../workbench/contrib/searchEditor/browser/searchEditorModel.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts b/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts index 8c29e07887330..36a7e3037d23b 100644 --- a/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts +++ b/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts @@ -110,7 +110,7 @@ export class SearchEditorInput extends EditorInput { const input = this; const workingCopyAdapter = new class implements IWorkingCopy { - readonly resource = input.backingUri ?? input.modelUri; + readonly resource = input.modelUri; get name() { return input.getName(); } readonly capabilities = input.isUntitled() ? WorkingCopyCapabilities.Untitled : 0; readonly onDidChangeDirty = input.onDidChangeDirty; diff --git a/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.ts b/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.ts index 038ddda46724f..fd868994e0867 100644 --- a/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.ts +++ b/src/vs/workbench/contrib/searchEditor/browser/searchEditorModel.ts @@ -34,7 +34,7 @@ export class SearchEditorModel { @IModeService private readonly modeService: IModeService) { this.onModelResolved = new Promise(resolve => this.resolveContents = resolve); this.onModelResolved.then(model => this.cachedContentsModel = model); - this.ongoingResolve = backupService.resolve(existingData.backingUri ?? modelUri) + this.ongoingResolve = backupService.resolve(modelUri) .then(backup => modelService.getModel(modelUri) ?? (backup ? modelService.createModel(backup.value, modeService.create('search-result'), modelUri) : undefined)) .then(model => { if (model) { this.resolveContents(model); } }); }