From 3f8f022200b8e227059569a5f5a928a9582de2bd Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Wed, 9 Sep 2020 15:49:06 -0700 Subject: [PATCH] Use destructuring to make code more clear --- .../services/editor/common/editorOpenWith.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/vs/workbench/services/editor/common/editorOpenWith.ts b/src/vs/workbench/services/editor/common/editorOpenWith.ts index a824ac2e408..807464f51f8 100644 --- a/src/vs/workbench/services/editor/common/editorOpenWith.ts +++ b/src/vs/workbench/services/editor/common/editorOpenWith.ts @@ -62,13 +62,13 @@ export async function openEditorWith( // Prompt const resourceExt = extname(resource); - const items: (IQuickPickItem & { handler: IOpenEditorOverrideHandler })[] = allEditorOverrides.map((override) => { + const items: (IQuickPickItem & { handler: IOpenEditorOverrideHandler })[] = allEditorOverrides.map(([handler, entry]) => { return { - handler: override[0], - id: override[1].id, - label: override[1].label, - description: override[1].active ? nls.localize('promptOpenWith.currentlyActive', 'Currently Active') : undefined, - detail: override[1].detail, + handler: handler, + id: entry.id, + label: entry.label, + description: entry.active ? nls.localize('promptOpenWith.currentlyActive', 'Currently Active') : undefined, + detail: entry.detail, buttons: resourceExt ? [{ iconClass: 'codicon-settings-gear', tooltip: nls.localize('promptOpenWith.setDefaultTooltip', "Set as default editor for '{0}' files", resourceExt) -- GitLab