Skip to content

Commit a44354a

Browse files
authored
fix(50188): omit QF on function arguments (microsoft#50189)
1 parent 7afd14f commit a44354a

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/services/codefixes/fixAddMissingMember.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ namespace ts.codefix {
190190
return { kind: InfoKind.JsxAttributes, token, attributes, parentDeclaration: token.parent };
191191
}
192192

193-
if (isIdentifier(token) && isCallExpression(parent)) {
193+
if (isIdentifier(token) && isCallExpression(parent) && parent.expression === token) {
194194
return { kind: InfoKind.Function, token, call: parent, sourceFile, modifierFlags: ModifierFlags.None, parentDeclaration: sourceFile };
195195
}
196196

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////declare function f(x: number): any;
4+
////f(foo);
5+
6+
verify.not.codeFixAvailable("fixMissingFunctionDeclaration");
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
////const a = {
4+
//// b: { f(x: number) {} }
5+
////}
6+
////a.b.f(foo);
7+
8+
verify.not.codeFixAvailable("fixMissingFunctionDeclaration");

0 commit comments

Comments
 (0)