File tree 2 files changed +37
-3
lines changed 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -962,12 +962,13 @@ namespace ts.Completions {
962
962
case SyntaxKind . PropertyAccessExpression :
963
963
propertyAccessToConvert = parent as PropertyAccessExpression ;
964
964
node = propertyAccessToConvert . expression ;
965
- if ( node . end === contextToken . pos &&
966
- isCallExpression ( node ) &&
965
+ if ( ( isCallExpression ( node ) || isFunctionLike ( node ) ) &&
966
+ node . end === contextToken . pos &&
967
967
node . getChildCount ( sourceFile ) &&
968
968
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
970
970
// eg: Math.min(./**/)
971
+ // const x = function (./**/) {}
971
972
return undefined ;
972
973
}
973
974
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