File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ namespace ts.codefix {
138
138
// If there is more than one overload but no implementation signature
139
139
// (eg: an abstract method or interface declaration), there is a 1-1
140
140
// correspondence of declarations and signatures.
141
- const signatures = checker . getSignaturesOfType ( type , SignatureKind . Call ) ;
141
+ const signatures = type . isUnion ( ) ? flatMap ( type . types , t => t . getCallSignatures ( ) ) : type . getCallSignatures ( ) ;
142
142
if ( ! some ( signatures ) ) {
143
143
break ;
144
144
}
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @Filename : a.ts
4
+ // @strictNullChecks : true
5
+ // @newline : LF
6
+
7
+ ////interface IFoo {
8
+ //// foo?(arg: string): number;
9
+ //// }
10
+ ////class Foo implements IFoo {
11
+ //// /**/
12
+ //// }
13
+
14
+ verify . completions ( {
15
+ marker : "" ,
16
+ isNewIdentifierLocation : true ,
17
+ preferences : {
18
+ includeCompletionsWithInsertText : true ,
19
+ includeCompletionsWithSnippetText : false ,
20
+ includeCompletionsWithClassMemberSnippets : true ,
21
+ } ,
22
+ includes : [
23
+ {
24
+ name : "foo" ,
25
+ sortText : completion . SortText . ClassMemberSnippets ,
26
+ insertText : "foo(arg: string): number {\n}"
27
+ } ,
28
+ ] ,
29
+ } ) ;
You can’t perform that action at this time.
0 commit comments