File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -962,12 +962,13 @@ namespace ts.Completions {
962962 case SyntaxKind . PropertyAccessExpression :
963963 propertyAccessToConvert = parent as PropertyAccessExpression ;
964964 node = propertyAccessToConvert . expression ;
965- if ( node . end === contextToken . pos &&
966- isCallExpression ( node ) &&
965+ if ( ( isCallExpression ( node ) || isFunctionLike ( node ) ) &&
966+ node . end === contextToken . pos &&
967967 node . getChildCount ( sourceFile ) &&
968968 last ( node . getChildren ( sourceFile ) ) . kind !== SyntaxKind . CloseParenToken ) {
969- // This is likely dot from incorrectly parsed call expression and user is starting to write spread
969+ // This is likely dot from incorrectly parsed expression and user is starting to write spread
970970 // eg: Math.min(./**/)
971+ // const x = function (./**/) {}
971972 return undefined ;
972973 }
973974 break ;
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts'/>
2+
3+ ////const t0 = {
4+ //// x: function (./*0*/) {}
5+ //// }
6+ ////const t1 = {
7+ //// x: (./*1*/) => {}
8+ //// }
9+ ////const t2 = {
10+ //// x: function foo(./*2*/) => {}
11+ //// }
12+ ////const t3 = {
13+ //// x(./*3*/) {}
14+ //// }
15+ ////
16+ ////const t4 = function (./*4*/) {}
17+ ////const t5 = (./*5*/) => {}
18+ ////function t6(./*6*/) {}
19+ ////
20+ ////class Foo {
21+ //// m(./*7*/) {}
22+ //// }
23+
24+ for ( const marker of test . markers ( ) ) {
25+ goTo . marker ( marker ) ;
26+ verify . completions ( { exact : undefined } ) ;
27+
28+ edit . insert ( "." ) ;
29+ verify . completions ( { exact : undefined } ) ;
30+
31+ edit . insert ( "." ) ;
32+ verify . completions ( { exact : undefined } ) ;
33+ }
You can’t perform that action at this time.
0 commit comments