fix(50188): omit QF on function arguments (#50189)

This commit is contained in:
Oleksandr T
2022-08-04 17:52:09 -07:00
committed by GitHub
parent 7afd14f263
commit a44354af7c
3 changed files with 15 additions and 1 deletions
@@ -190,7 +190,7 @@ namespace ts.codefix {
return { kind: InfoKind.JsxAttributes, token, attributes, parentDeclaration: token.parent };
}
if (isIdentifier(token) && isCallExpression(parent)) {
if (isIdentifier(token) && isCallExpression(parent) && parent.expression === token) {
return { kind: InfoKind.Function, token, call: parent, sourceFile, modifierFlags: ModifierFlags.None, parentDeclaration: sourceFile };
}
@@ -0,0 +1,6 @@
/// <reference path="fourslash.ts" />
////declare function f(x: number): any;
////f(foo);
verify.not.codeFixAvailable("fixMissingFunctionDeclaration");
@@ -0,0 +1,8 @@
/// <reference path="fourslash.ts" />
////const a = {
//// b: { f(x: number) {} }
////}
////a.b.f(foo);
verify.not.codeFixAvailable("fixMissingFunctionDeclaration");