Fix completions when writing spread expression

Fixes #29234
This commit is contained in:
Sheetal Nandi
2019-03-13 14:25:43 -07:00
parent b762d6205e
commit 12d736f0a4
2 changed files with 20 additions and 0 deletions

View File

@@ -703,6 +703,14 @@ namespace ts.Completions {
case SyntaxKind.PropertyAccessExpression:
propertyAccessToConvert = parent as PropertyAccessExpression;
node = propertyAccessToConvert.expression;
if (node.end === contextToken.pos &&
isCallExpression(node) &&
node.getChildCount(sourceFile) &&
last(node.getChildren(sourceFile)).kind !== SyntaxKind.CloseParenToken) {
// This is likely dot from incorrectly parsed call expression and user is starting to write spread
// eg: Math.min(./**/)
return undefined;
}
break;
case SyntaxKind.QualifiedName:
node = (parent as QualifiedName).left;