mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
fix(38840): omit completions for a spread like argument in a function definition (#38897)
This commit is contained in:
@@ -962,12 +962,13 @@ namespace ts.Completions {
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
propertyAccessToConvert = parent as PropertyAccessExpression;
|
||||
node = propertyAccessToConvert.expression;
|
||||
if (node.end === contextToken.pos &&
|
||||
isCallExpression(node) &&
|
||||
if ((isCallExpression(node) || isFunctionLike(node)) &&
|
||||
node.end === contextToken.pos &&
|
||||
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
|
||||
// This is likely dot from incorrectly parsed expression and user is starting to write spread
|
||||
// eg: Math.min(./**/)
|
||||
// const x = function (./**/) {}
|
||||
return undefined;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user