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

Extract isPreferredFix

上级 ba0f7695
......@@ -269,9 +269,7 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider {
arguments: [tsAction],
title: ''
};
if (tsAction.fixName === 'spelling') {
codeAction.isPreferred = true;
}
codeAction.isPreferred = isPreferredFix(tsAction);
return codeAction;
}
......@@ -305,6 +303,11 @@ class TypeScriptQuickFixProvider implements vscode.CodeActionProvider {
}
}
const preferredFixes = new Set(['spelling']);
function isPreferredFix(tsAction: Proto.CodeFixAction): boolean {
return preferredFixes.has(tsAction.fixName);
}
export function register(
selector: vscode.DocumentSelector,
client: ITypeScriptServiceClient,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册