File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1338,13 +1338,16 @@ namespace ts.Completions {
1338
1338
case SyntaxKind . PropertyAccessExpression :
1339
1339
propertyAccessToConvert = parent as PropertyAccessExpression ;
1340
1340
node = propertyAccessToConvert . expression ;
1341
- if ( ( isCallExpression ( node ) || isFunctionLike ( node ) ) &&
1342
- node . end === contextToken . pos &&
1343
- node . getChildCount ( sourceFile ) &&
1344
- last ( node . getChildren ( sourceFile ) ) . kind !== SyntaxKind . CloseParenToken ) {
1341
+ const leftMostAccessExpression = getLeftmostAccessExpression ( parent as Expression ) ;
1342
+ if ( leftMostAccessExpression . pos === leftMostAccessExpression . end ||
1343
+ ( ( isCallExpression ( node ) || isFunctionLike ( node ) ) &&
1344
+ node . end === contextToken . pos &&
1345
+ node . getChildCount ( sourceFile ) &&
1346
+ last ( node . getChildren ( sourceFile ) ) . kind !== SyntaxKind . CloseParenToken ) ) {
1345
1347
// This is likely dot from incorrectly parsed expression and user is starting to write spread
1346
1348
// eg: Math.min(./**/)
1347
1349
// const x = function (./**/) {}
1350
+ // ({./**/})
1348
1351
return undefined ;
1349
1352
}
1350
1353
break ;
You can’t perform that action at this time.
0 commit comments