mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-18 05:43:11 -05:00
Make getSupportedCodeFixes plugin test such that we dont need to update its baseline for every new error (#53070)
This commit is contained in:
@@ -49,6 +49,7 @@ function createCodeFixActionWorker(fixName: string, description: string, changes
|
||||
/** @internal */
|
||||
export function registerCodeFix(reg: CodeFixRegistration) {
|
||||
for (const error of reg.errorCodes) {
|
||||
errorCodeToFixesArray = undefined;
|
||||
errorCodeToFixes.add(String(error), reg);
|
||||
}
|
||||
if (reg.fixIds) {
|
||||
@@ -59,9 +60,10 @@ export function registerCodeFix(reg: CodeFixRegistration) {
|
||||
}
|
||||
}
|
||||
|
||||
let errorCodeToFixesArray: readonly string[] | undefined;
|
||||
/** @internal */
|
||||
export function getSupportedErrorCodes(): readonly string[] {
|
||||
return arrayFrom(errorCodeToFixes.keys());
|
||||
return errorCodeToFixesArray ??= arrayFrom(errorCodeToFixes.keys());
|
||||
}
|
||||
|
||||
function removeFixIdIfFixAllUnavailable(registration: CodeFixRegistration, diagnostics: Diagnostic[]) {
|
||||
|
||||
Reference in New Issue
Block a user