File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -3754,6 +3754,12 @@ namespace ts.Completions {
3754
3754
// Object literal is assignment pattern: ({ | } = x)
3755
3755
return typeChecker . getTypeAtLocation ( node . parent ) ;
3756
3756
}
3757
+ if ( isParenthesizedExpression ( node . parent ) ) {
3758
+ const parent = walkUpParenthesizedExpressions ( node . parent ) ;
3759
+ if ( isExpression ( parent ) ) {
3760
+ return typeChecker . getContextualType ( parent ) ;
3761
+ }
3762
+ }
3757
3763
return undefined ;
3758
3764
}
3759
3765
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts'/>
2
+
3
+ ////type Foo = { foo: boolean };
4
+ ////function f<T>(shape: Foo): any;
5
+ ////function f<T>(shape: () => Foo): any;
6
+ ////function f(arg: any) {
7
+ //// return arg;
8
+ //// }
9
+ ////
10
+ ////f({ /*1*/ });
11
+ ////f(() => ({ /*2*/ }));
12
+ ////f(() => (({ /*3*/ })));
13
+
14
+ verify . completions ( {
15
+ marker : [ "1" , "2" , "3" ] ,
16
+ exact : [ "foo" ]
17
+ } ) ;
You can’t perform that action at this time.
0 commit comments