From e2fed923623d3c53c5acfb5bc0636d1441fbd740 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 17 Jan 2019 18:21:16 -0800 Subject: [PATCH] Mark preferred code actions with a star in the code action list #66702 Experimentally mark preferred code actions with a star while we come up with better UX for this --- src/vs/editor/contrib/codeAction/codeActionWidget.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/contrib/codeAction/codeActionWidget.ts b/src/vs/editor/contrib/codeAction/codeActionWidget.ts index 1338dc3d729..7b4b5fb5acb 100644 --- a/src/vs/editor/contrib/codeAction/codeActionWidget.ts +++ b/src/vs/editor/contrib/codeAction/codeActionWidget.ts @@ -51,8 +51,12 @@ export class CodeActionContextMenu { } private codeActionToAction(action: CodeAction): Action { - return new Action(action.command ? action.command.id : action.title, action.title, undefined, true, () => { - return always(this._onApplyCodeAction(action), () => this._onDidExecuteCodeAction.fire(undefined)); + const id = action.command ? action.command.id : action.title; + const title = action.isPreferred ? `${action.title} ★` : action.title; + return new Action(id, title, undefined, true, () => { + return always( + this._onApplyCodeAction(action), + () => this._onDidExecuteCodeAction.fire(undefined)); }); } -- GitLab