mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-03-17 00:04:13 -05:00
Slightly simplify getCodeActions
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user