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 = {
5555 turnArrayIntoObjectEdit : ts . TextChange [ ]
5656 getFixAllEdits : ts . TextChange [ ]
5757 getSignatureInfo : {
58+ // stable
5859 parameters : GetSignatureInfoParameter [ ]
60+ // unstable
61+ hasManySignatures : boolean
5962 }
6063}
6164
Original file line number Diff line number Diff line change @@ -67,7 +67,13 @@ export default (
6767 const typeChecker = languageService . getProgram ( ) ! . getTypeChecker ( ) !
6868 const type = typeChecker . getContextualType ( node as any ) ?? typeChecker . getTypeAtLocation ( node )
6969 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+ }
7177 // Investigate merging signatures
7278 const { parameters } = signatures [ 0 ] !
7379 const printer = ts . createPrinter ( )
@@ -96,7 +102,7 @@ export default (
96102 } )
97103 return {
98104 entries : [ ] ,
99- typescriptEssentialsResponse : { parameters : parsedParams } satisfies RequestResponseTypes [ 'getSignatureInfo' ] ,
105+ typescriptEssentialsResponse : { parameters : parsedParams , hasManySignatures : false } satisfies RequestResponseTypes [ 'getSignatureInfo' ] ,
100106 }
101107 }
102108 if ( specialCommand === 'getSpanOfEnclosingComment' ) {
You can’t perform that action at this time.
0 commit comments