Skip to content

Commit f222010

Browse files
committed
Mark currently active editor type in reopen with
1 parent 6e90f38 commit f222010

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

src/vs/workbench/contrib/customEditor/browser/customEditors.ts

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,22 @@ export class CustomEditorService extends Disposable implements ICustomEditorServ
129129
...this.getContributedCustomEditors(resource),
130130
], editor => editor.id);
131131

132-
const pick = await this.quickInputService.pick(
133-
customEditors.map((editorDescriptor): IQuickPickItem => ({
134-
label: editorDescriptor.displayName,
135-
id: editorDescriptor.id,
136-
})), {
132+
let currentlyOpenedEditorType: undefined | string;
133+
for (const editor of group ? group.editors : []) {
134+
if (editor.getResource() && isEqual(editor.getResource()!, resource)) {
135+
currentlyOpenedEditorType = editor instanceof CustomFileEditorInput ? editor.viewType : defaultEditorId;
136+
break;
137+
}
138+
}
139+
140+
const items = customEditors.map((editorDescriptor): IQuickPickItem => ({
141+
label: editorDescriptor.displayName,
142+
id: editorDescriptor.id,
143+
description: editorDescriptor.id === currentlyOpenedEditorType
144+
? nls.localize('openWithCurrentlyActive', "Currently Active")
145+
: undefined
146+
}));
147+
const pick = await this.quickInputService.pick(items, {
137148
placeHolder: nls.localize('promptOpenWith.placeHolder', "Select editor to use for '{0}'...", basename(resource)),
138149
});
139150

0 commit comments

Comments
 (0)