提交 c2f5440e 编写于 作者: M Matt Bierner

Use code action class for TS quick fix provider

上级 7bcaaeaf
......@@ -93,16 +93,15 @@ export default class TypeScriptQuickFixProvider implements vscode.CodeActionProv
.filter(code => supportedActions[code]));
}
private getCommandForAction(action: Proto.CodeAction): vscode.CodeAction {
return {
title: action.description,
edit: getEditForCodeAction(this.client, action),
command: action.commands ? {
private getCommandForAction(tsAction: Proto.CodeAction): vscode.CodeAction {
const codeAction = new vscode.CodeAction(tsAction.description, getEditForCodeAction(this.client, tsAction));
if (tsAction.commands) {
codeAction.command = {
command: ApplyCodeActionCommand.ID,
arguments: [action],
title: action.description
} : undefined,
diagnostics: []
};
arguments: [tsAction],
title: tsAction.description
};
}
return codeAction;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册