| 150153 | } |
| 150154 | codefix.getSupportedErrorCodes = getSupportedErrorCodes; |
| 150155 | function removeFixIdIfFixAllUnavailable(registration, diagnostics) { |
| 150156 | var errorCodes = registration.errorCodes; |
| 150157 | var maybeFixableDiagnostics = 0; |
| 150158 | for (var _i = 0, diagnostics_1 = diagnostics; _i < diagnostics_1.length; _i++) { |
| 150159 | var diag = diagnostics_1[_i]; |
| 150160 | if (ts.contains(errorCodes, diag.code)) |
| 150161 | maybeFixableDiagnostics++; |
| 150162 | if (maybeFixableDiagnostics > 1) |
| 150163 | break; |
| 150164 | } |
| 150165 | var fixAllUnavailable = maybeFixableDiagnostics < 2; |
| 150166 | return function (_a) { |
| 150167 | var fixId = _a.fixId, fixAllDescription = _a.fixAllDescription, action = __rest(_a, ["fixId", "fixAllDescription"]); |
| 150168 | return fixAllUnavailable ? action : __assign(__assign({}, action), { fixId: fixId, fixAllDescription: fixAllDescription }); |
| 150169 | }; |
| 150170 | } |
| 150171 | function getFixes(context) { |
| 150172 | var diagnostics = getDiagnostics(context); |
| 150173 | var registrations = errorCodeToFixes.get(String(context.errorCode)); |