Skip to content

Commit

Permalink
Mark preferred code actions with a star in the code action list
Browse files Browse the repository at this point in the history
microsoft#66702

Experimentally mark preferred code actions with a star while we come up with better UX for this
  • Loading branch information
mjbvz committed Jan 21, 2019
1 parent e42d49b commit e2fed92
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vs/editor/contrib/codeAction/codeActionWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
});
}

Expand Down

0 comments on commit e2fed92

Please sign in to comment.