File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -1338,13 +1338,16 @@ namespace ts.Completions {
13381338 case SyntaxKind . PropertyAccessExpression :
13391339 propertyAccessToConvert = parent as PropertyAccessExpression ;
13401340 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 ) ) {
13451347 // This is likely dot from incorrectly parsed expression and user is starting to write spread
13461348 // eg: Math.min(./**/)
13471349 // const x = function (./**/) {}
1350+ // ({./**/})
13481351 return undefined ;
13491352 }
13501353 break ;
You can’t perform that action at this time.
0 commit comments