Skip to content

Commit ff65a33

Browse files
author
Benjamin Pasero
committed
editors - reduce close exposure for now
1 parent 1927f9b commit ff65a33

6 files changed

Lines changed: 5 additions & 32 deletions

File tree

src/vs/workbench/common/editor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,9 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
598598

599599
close(group: GroupIdentifier, openedInOtherGroups: boolean): void {
600600
// TODO@ben revisit this behaviour, should just dispose by default after adoption
601+
// However this requires that we never open the same input in multiple editor groups
602+
// which today we cannot enforce (e.g. when opening the same editor in an empty
603+
// group via quick open editor history)
601604
if (!openedInOtherGroups) {
602605
this.dispose();
603606
}
@@ -798,10 +801,6 @@ export class SideBySideEditorInput extends EditorInput {
798801
this._register(this.master.onDidChangeLabel(() => this._onDidChangeLabel.fire()));
799802
}
800803

801-
async resolve(): Promise<EditorModel | null> {
802-
return null;
803-
}
804-
805804
matches(otherInput: unknown): boolean {
806805
if (super.matches(otherInput) === true) {
807806
return true;

src/vs/workbench/contrib/extensions/electron-browser/runtimeExtensionsInput.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import * as nls from 'vs/nls';
77
import { URI } from 'vs/base/common/uri';
8-
import { EditorInput, GroupIdentifier } from 'vs/workbench/common/editor';
8+
import { EditorInput } from 'vs/workbench/common/editor';
99

1010
export class RuntimeExtensionsInput extends EditorInput {
1111

@@ -37,12 +37,6 @@ export class RuntimeExtensionsInput extends EditorInput {
3737
return false;
3838
}
3939

40-
close(group: GroupIdentifier, openedInOtherGroups: boolean): void {
41-
if (!openedInOtherGroups) {
42-
this.dispose(); // Only dispose if not opened anymore because all runtime extensions inputs are shared
43-
}
44-
}
45-
4640
matches(other: unknown): boolean {
4741
return other instanceof RuntimeExtensionsInput;
4842
}

src/vs/workbench/contrib/files/common/editors/fileEditorInput.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,6 @@ export class FileEditorInput extends AbstractTextResourceEditorInput implements
303303
return undefined;
304304
}
305305

306-
close(group: GroupIdentifier, openedInOtherGroups: boolean): void {
307-
if (!openedInOtherGroups) {
308-
this.dispose(); // Only dispose if not opened anymore because all file inputs are shared
309-
}
310-
}
311-
312306
matches(otherInput: unknown): boolean {
313307
if (super.matches(otherInput) === true) {
314308
return true;

src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ export class SearchEditorInput extends EditorInput {
180180
return localize('searchTitle', "Search");
181181
}
182182

183-
async resolve() {
184-
return null;
185-
}
186-
187183
setDirty(dirty: boolean) {
188184
this.dirty = dirty;
189185
this._onDidChangeDirty.fire();

src/vs/workbench/contrib/webview/browser/webviewEditorInput.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,6 @@ export class WebviewInput extends EditorInput {
9999
this._group = group;
100100
}
101101

102-
public async resolve(): Promise<null> {
103-
return null;
104-
}
105-
106102
public supportsSplitEditor() {
107103
return false;
108104
}

src/vs/workbench/services/untitled/common/untitledTextEditorInput.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { IEncodingSupport, EncodingMode, Verbosity, IModeSupport, GroupIdentifier } from 'vs/workbench/common/editor';
6+
import { IEncodingSupport, EncodingMode, Verbosity, IModeSupport } from 'vs/workbench/common/editor';
77
import { AbstractTextResourceEditorInput } from 'vs/workbench/common/editor/textResourceEditorInput';
88
import { IUntitledTextEditorModel } from 'vs/workbench/services/untitled/common/untitledTextEditorModel';
99
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles';
@@ -121,12 +121,6 @@ export class UntitledTextEditorInput extends AbstractTextResourceEditorInput imp
121121
return this.modelResolve;
122122
}
123123

124-
close(group: GroupIdentifier, openedInOtherGroups: boolean): void {
125-
if (!openedInOtherGroups) {
126-
this.dispose(); // Only dispose if not opened anymore because all untitled inputs are shared
127-
}
128-
}
129-
130124
matches(otherInput: unknown): boolean {
131125
if (super.matches(otherInput) === true) {
132126
return true;

0 commit comments

Comments
 (0)