diff --git a/src/services/services.ts b/src/services/services.ts index b2596682e50..220383c944e 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -3043,7 +3043,8 @@ module ts { || containingNodeKind === SyntaxKind.Constructor // constructor( a, | public, protected, private keywords are allowed here, so show completion || containingNodeKind === SyntaxKind.NewExpression // new C(a, | || containingNodeKind === SyntaxKind.ArrayLiteralExpression // [a, | - || containingNodeKind === SyntaxKind.BinaryExpression; // let x = (a, | + || containingNodeKind === SyntaxKind.BinaryExpression // let x = (a, | + || containingNodeKind === SyntaxKind.FunctionType; // var x: (s: string, list| case SyntaxKind.OpenParenToken: return containingNodeKind === SyntaxKind.CallExpression // func( | @@ -3205,9 +3206,6 @@ module ts { (previousToken.parent && previousToken.parent.parent && previousToken.parent.parent.kind === SyntaxKind.ArrayBindingPattern); // var [ ...z| - case SyntaxKind.TypeKeyword: // type htm| - return true; - case SyntaxKind.PublicKeyword: case SyntaxKind.PrivateKeyword: case SyntaxKind.ProtectedKeyword: @@ -3224,6 +3222,7 @@ module ts { case SyntaxKind.LetKeyword: case SyntaxKind.ConstKeyword: case SyntaxKind.YieldKeyword: + case SyntaxKind.TypeKeyword: // type htm| return true; } diff --git a/tests/cases/fourslash/completionListNewIdentifierVariableDeclaration.ts b/tests/cases/fourslash/completionListNewIdentifierVariableDeclaration.ts new file mode 100644 index 00000000000..5f55504be8d --- /dev/null +++ b/tests/cases/fourslash/completionListNewIdentifierVariableDeclaration.ts @@ -0,0 +1,11 @@ +/// + +////var x : (/*1*/) => void; + +////var y : (s:string, list/*2*/ + +test.markers().forEach((m) => { + goTo.position(m.position, m.fileName); + verify.not.completionListIsEmpty(); + verify.completionListAllowsNewIdentifier(); +}); \ No newline at end of file