File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -55,7 +55,10 @@ export type RequestResponseTypes = {
55
55
turnArrayIntoObjectEdit : ts . TextChange [ ]
56
56
getFixAllEdits : ts . TextChange [ ]
57
57
getSignatureInfo : {
58
+ // stable
58
59
parameters : GetSignatureInfoParameter [ ]
60
+ // unstable
61
+ hasManySignatures : boolean
59
62
}
60
63
}
61
64
Original file line number Diff line number Diff line change @@ -67,7 +67,13 @@ export default (
67
67
const typeChecker = languageService . getProgram ( ) ! . getTypeChecker ( ) !
68
68
const type = typeChecker . getContextualType ( node as any ) ?? typeChecker . getTypeAtLocation ( node )
69
69
const signatures = typeChecker . getSignaturesOfType ( type , ts . SignatureKind . Call )
70
- if ( signatures . length !== 1 ) return
70
+ if ( signatures . length === 0 ) return
71
+ if ( signatures . length > 1 ) {
72
+ return {
73
+ entries : [ ] ,
74
+ typescriptEssentialsResponse : { parameters : [ ] , hasManySignatures : true } satisfies RequestResponseTypes [ 'getSignatureInfo' ] ,
75
+ }
76
+ }
71
77
// Investigate merging signatures
72
78
const { parameters } = signatures [ 0 ] !
73
79
const printer = ts . createPrinter ( )
@@ -96,7 +102,7 @@ export default (
96
102
} )
97
103
return {
98
104
entries : [ ] ,
99
- typescriptEssentialsResponse : { parameters : parsedParams } satisfies RequestResponseTypes [ 'getSignatureInfo' ] ,
105
+ typescriptEssentialsResponse : { parameters : parsedParams , hasManySignatures : false } satisfies RequestResponseTypes [ 'getSignatureInfo' ] ,
100
106
}
101
107
}
102
108
if ( specialCommand === 'getSpanOfEnclosingComment' ) {
You can’t perform that action at this time.
0 commit comments