Slightly simplify getCodeActions
This commit is contained in:
parent
8f5a76d48b
commit
ded788e560
|
@ -4,7 +4,7 @@ namespace ts.codefix {
|
|||
const errorCodes = [Diagnostics.Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type.code];
|
||||
registerCodeFix({
|
||||
errorCodes,
|
||||
getCodeActions: context => (codeAction => codeAction ? [ { fixId, ...codeAction } ] : [])(
|
||||
getCodeActions: context => (codeAction => codeAction && [{ fixId, ...codeAction }])(
|
||||
tryGetCodeActionForInstallPackageTypes(context.host, context.sourceFile.fileName, getModuleName(context.sourceFile, context.span.start))),
|
||||
fixIds: [fixId],
|
||||
getAllCodeActions: context => codeFixAll(context, errorCodes, (_, diag, commands) => {
|
||||
|
|
Loading…
Reference in a new issue