Skip to content

Commit adbae13

Browse files
committed
Add fixall command palette entry
Fixes microsoft/vscode-typescript-tslint-plugin#57
1 parent a3e98d6 commit adbae13

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/vs/editor/contrib/codeAction/codeActionCommands.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,29 @@ export class OrganizeImportsAction extends EditorAction {
439439
}
440440
}
441441

442+
export class FixAllAction extends EditorAction {
443+
444+
static readonly Id = 'editor.action.fixAll';
445+
446+
constructor() {
447+
super({
448+
id: FixAllAction.Id,
449+
label: nls.localize('fixAll.label', "Fix All"),
450+
alias: 'Fix All',
451+
precondition: ContextKeyExpr.and(
452+
EditorContextKeys.writable,
453+
contextKeyForSupportedActions(CodeActionKind.SourceFixAll))
454+
});
455+
}
456+
457+
public run(_accessor: ServicesAccessor, editor: ICodeEditor): void {
458+
return showCodeActionsForEditorSelection(editor,
459+
nls.localize('fixAll.noneMessage', "No fix all action available"),
460+
{ kind: CodeActionKind.SourceFixAll, includeSourceActions: true },
461+
CodeActionAutoApply.IfSingle);
462+
}
463+
}
464+
442465
export class AutoFixAction extends EditorAction {
443466

444467
static readonly Id = 'editor.action.autoFix';

0 commit comments

Comments
 (0)