Skip to content

Commit a12c7ec

Browse files
author
Benjamin Pasero
committed
editors - more 💄
1 parent 13e25f7 commit a12c7ec

3 files changed

Lines changed: 11 additions & 23 deletions

File tree

src/vs/workbench/common/editor.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,6 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
562562
return { typeId: this.getTypeId() };
563563
}
564564

565-
abstract resolve(): Promise<IEditorModel | null>;
566-
567565
isReadonly(): boolean {
568566
return true;
569567
}
@@ -580,6 +578,10 @@ export abstract class EditorInput extends Disposable implements IEditorInput {
580578
return false;
581579
}
582580

581+
async resolve(): Promise<IEditorModel | null> {
582+
return null;
583+
}
584+
583585
async save(group: GroupIdentifier, options?: ISaveOptions): Promise<IEditorInput | undefined> {
584586
return this;
585587
}

src/vs/workbench/contrib/extensions/common/extensionsInput.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { URI } from 'vs/base/common/uri';
88
import { localize } from 'vs/nls';
99
import { EditorInput } from 'vs/workbench/common/editor';
1010
import { IExtension } from 'vs/workbench/contrib/extensions/common/extensions';
11+
import { areSameExtensions } from 'vs/platform/extensionManagement/common/extensionManagementUtil';
1112

1213
export class ExtensionsInput extends EditorInput {
1314

@@ -34,26 +35,15 @@ export class ExtensionsInput extends EditorInput {
3435
return localize('extensionsInputName', "Extension: {0}", this.extension.displayName);
3536
}
3637

37-
async resolve(): Promise<null> {
38-
return null;
39-
}
40-
4138
supportsSplitEditor(): boolean {
4239
return false;
4340
}
4441

4542
matches(other: unknown): boolean {
46-
if (super.matches(other) === true) {
43+
if (super.matches(other)) {
4744
return true;
4845
}
4946

50-
if (!(other instanceof ExtensionsInput)) {
51-
return false;
52-
}
53-
54-
const otherExtensionInput = other as ExtensionsInput;
55-
56-
// TODO@joao is this correct?
57-
return this.extension === otherExtensionInput.extension;
47+
return other instanceof ExtensionsInput && areSameExtensions(this.extension.identifier, other.extension.identifier);
5848
}
5949
}

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ export class RuntimeExtensionsInput extends EditorInput {
3333
return nls.localize('extensionsInputName', "Running Extensions");
3434
}
3535

36-
matches(other: unknown): boolean {
37-
return other instanceof RuntimeExtensionsInput;
38-
}
39-
40-
async resolve(): Promise<null> {
41-
return null;
42-
}
43-
4436
supportsSplitEditor(): boolean {
4537
return false;
4638
}
@@ -50,4 +42,8 @@ export class RuntimeExtensionsInput extends EditorInput {
5042
this.dispose(); // Only dispose if not opened anymore because all runtime extensions inputs are shared
5143
}
5244
}
45+
46+
matches(other: unknown): boolean {
47+
return other instanceof RuntimeExtensionsInput;
48+
}
5349
}

0 commit comments

Comments
 (0)