diff --git a/src/services/services.ts b/src/services/services.ts index 06da4859274..7af601c7e30 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -2986,7 +2986,9 @@ module ts { return containingNodeKind === SyntaxKind.CallExpression // func( | || containingNodeKind === SyntaxKind.Constructor // constructor( | || containingNodeKind === SyntaxKind.NewExpression // new C(a| - || containingNodeKind === SyntaxKind.ParenthesizedExpression; // let x = (a| + || containingNodeKind === SyntaxKind.ParenthesizedExpression // let x = (a| + || containingNodeKind === SyntaxKind.ParenthesizedType // function F(pred: (a| + || containingNodeKind === SyntaxKind.Parameter; // function F(pred: a| case SyntaxKind.OpenBracketToken: return containingNodeKind === SyntaxKind.ArrayLiteralExpression; // [ | diff --git a/tests/cases/fourslash/completionListNewIdentifierFunctionDeclaration.ts b/tests/cases/fourslash/completionListNewIdentifierFunctionDeclaration.ts new file mode 100644 index 00000000000..3180f8fd820 --- /dev/null +++ b/tests/cases/fourslash/completionListNewIdentifierFunctionDeclaration.ts @@ -0,0 +1,12 @@ +/// + +////function F(pref: (a/*1*/ +//// +////function F(pref: a/*2*/ +//// + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.not.completionListIsEmpty(); + verify.completionListAllowsNewIdentifier(); +});