Fixes Aggressive completion makes it difficult to type function types. #2494 + test case

This commit is contained in:
Paul van Brenk
2015-04-30 15:41:14 -07:00
parent fd5a04cb14
commit 63f3bafed6
2 changed files with 15 additions and 1 deletions

View File

@@ -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; // [ |

View File

@@ -0,0 +1,12 @@
/// <reference path='fourslash.ts' />
////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();
});