mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Create the action only if the text change creation is successful. …
Make change for the infer type from usage could return undefined even if type is present if the type cannot be named Fixes #22184
This commit is contained in:
@@ -186,7 +186,8 @@ namespace ts.codefix {
|
||||
}
|
||||
|
||||
function makeFix(declaration: Declaration, start: number, type: Type | undefined, program: Program): Fix | undefined {
|
||||
return type && { declaration, textChanges: [makeChange(declaration, start, type, program)] };
|
||||
const change = makeChange(declaration, start, type, program);
|
||||
return change && { declaration, textChanges: [change] };
|
||||
}
|
||||
|
||||
function makeChange(declaration: Declaration, start: number, type: Type | undefined, program: Program): TextChange | undefined {
|
||||
|
||||
@@ -13,4 +13,4 @@
|
||||
////}
|
||||
|
||||
goTo.file("/b.ts");
|
||||
verify.codeFixAvailable();
|
||||
verify.not.codeFixAvailable();
|
||||
Reference in New Issue
Block a user