@@ -261,7 +261,7 @@ module ts.SignatureHelp {
261
261
display += "?" ;
262
262
}
263
263
display += ": " + typeInfoResolver . typeToString ( typeInfoResolver . getTypeOfSymbol ( p ) , argumentListOrTypeArgumentList ) ;
264
- return new SignatureHelpParameter ( p . name , "" , display , isOptional ) ;
264
+ return { name : p . name , documentation : "" , display : display , isOptiona : isOptional } ;
265
265
} ) ;
266
266
var callTargetNode = ( < CallExpression > argumentListOrTypeArgumentList . parent ) . func ;
267
267
var callTargetSymbol = typeInfoResolver . getSymbolInfo ( callTargetNode ) ;
@@ -273,7 +273,14 @@ module ts.SignatureHelp {
273
273
}
274
274
prefix += "(" ;
275
275
var suffix = "): " + typeInfoResolver . typeToString ( candidateSignature . getReturnType ( ) , argumentListOrTypeArgumentList ) ;
276
- return new SignatureHelpItem ( candidateSignature . hasRestParameter , prefix , suffix , ", " , parameterHelpItems , "" ) ;
276
+ return {
277
+ isVariadic : candidateSignature . hasRestParameter ,
278
+ prefix : prefix ,
279
+ suffix : suffix ,
280
+ separator : ", " ,
281
+ parameters : parameterHelpItems ,
282
+ documentation : ""
283
+ } ;
277
284
} ) ;
278
285
var selectedItemIndex = candidates . indexOf ( bestSignature ) ;
279
286
if ( selectedItemIndex < 0 ) {
@@ -291,7 +298,11 @@ module ts.SignatureHelp {
291
298
var applicableSpanStart = argumentListOrTypeArgumentList . getFullStart ( ) ;
292
299
var applicableSpanEnd = skipTrivia ( sourceFile . text , argumentListOrTypeArgumentList . end , /*stopAfterLineBreak*/ false ) ;
293
300
var applicableSpan = new TypeScript . TextSpan ( applicableSpanStart , applicableSpanEnd - applicableSpanStart ) ;
294
- return new SignatureHelpItems ( items , applicableSpan , selectedItemIndex ) ;
301
+ return {
302
+ items : items ,
303
+ applicableSpan : applicableSpan ,
304
+ selectedItemIndex : selectedItemIndex
305
+ } ;
295
306
}
296
307
}
297
308
@@ -327,7 +338,7 @@ module ts.SignatureHelp {
327
338
var numberOfCommas = countWhere ( argumentListOrTypeArgumentList . getChildren ( ) , arg => arg . kind === SyntaxKind . CommaToken ) ;
328
339
var argumentCount = numberOfCommas + 1 ;
329
340
if ( argumentCount <= 1 ) {
330
- return new SignatureHelpState ( /* argumentIndex*/ 0 , argumentCount ) ;
341
+ return { argumentIndex : 0 , argumentCount : argumentCount } ;
331
342
}
332
343
333
344
var indexOfNodeContainingPosition = findListItemIndexContainingPosition ( argumentListOrTypeArgumentList , position ) ;
@@ -338,12 +349,12 @@ module ts.SignatureHelp {
338
349
// Alternatively, we could be in range of one of the arguments, in which case we need to divide
339
350
// by 2 to exclude commas. Use bit shifting in order to take the floor of the division.
340
351
var argumentIndex = indexOfNodeContainingPosition < 0 ? argumentCount - 1 : indexOfNodeContainingPosition >> 1 ;
341
- return new SignatureHelpState ( argumentIndex , argumentCount ) ;
342
- }
343
-
344
- function getChildListThatStartsWithOpenerToken ( parent : Node , openerToken : Node , sourceFile : SourceFile ) : Node {
352
+ return { argumentIndex : argumentIndex , argumentCount : argumentCount } ;
353
+ }
354
+
355
+ function getChildListThatStartsWithOpenerToken ( parent : Node , openerToken : Node , sourceFile : SourceFile ) : Node {
345
356
var children = parent . getChildren ( sourceFile ) ;
346
357
var indexOfOpenerToken = children . indexOf ( openerToken ) ;
347
- return children [ indexOfOpenerToken + 1 ] ;
358
+ return children [ indexOfOpenerToken + 1 ] ;
348
359
}
349
360
}
0 commit comments