File tree 2 files changed +19
-4
lines changed
2 files changed +19
-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 ( 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 ) ) {
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 ;
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