File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-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 ( propertyAccessToConvert ) ;
1342+ if ( nodeIsMissing ( leftmostAccessExpression ) ||
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 ;
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts" />
2+
3+ // Regresion test for GH#45436
4+
5+ // @allowNonTsExtensions : true
6+ // @Filename : file.js
7+ //// const abc = {};
8+ //// ({./*1*/});
9+
10+ goTo . marker ( '1' ) ;
11+ edit . insert ( '.' ) ;
12+ verify . completions ( { exact : undefined } ) ;
You can’t perform that action at this time.
0 commit comments