@@ -406,7 +406,7 @@ private static string GetEnumHelpPage()
406406 private static string GetMethodList ( )
407407 {
408408 var methods = MethodIndex . GetMethods ( ) ;
409- var maxMethodLen = methods . Max ( m => m . Name . Length ) + 7 ;
409+ const string retsPrefix = " [rets]" ;
410410
411411 Dictionary < string , List < Method > > methodsByCategory = new ( ) ;
412412 foreach ( var method in methods )
@@ -427,6 +427,10 @@ private static string GetMethodList()
427427
428428 foreach ( var kvp in methodsByCategory . Reverse ( ) )
429429 {
430+ var descDistance = kvp . Value
431+ . Select ( m => m . Name . Length + ( m is ReturningMethod ? retsPrefix . Length : 0 ) )
432+ . Max ( ) + 1 ;
433+
430434 sb . AppendLine ( ) ;
431435 sb . AppendLine ( $ "--- { kvp . Key } methods ---") ;
432436 foreach ( var method in kvp . Value )
@@ -437,18 +441,11 @@ private static string GetMethodList()
437441 name += " [rets]" ;
438442 }
439443
440- if ( maxMethodLen - name . Length > 0 )
441- {
442- var desc = method . Description ?? $ "Extracts information from { ( ( IReferenceResolvingMethod ) method ) . ReferenceType . Name } objects.";
443-
444- var descFormatted = desc
445- . Insert ( 0 , new string ( ' ' , maxMethodLen - name . Length ) ) ;
446- sb . AppendLine ( $ "> { name } { descFormatted } ") ;
447- }
448- else
449- {
450- sb . AppendLine ( $ "> { name } { method . Description } ") ;
451- }
444+ var descDistanceString = new string ( ' ' , descDistance - name . Length ) ;
445+ var desc = method . Description
446+ ?? $ "Extracts information from { ( ( IReferenceResolvingMethod ) method ) . ReferenceType . Name } objects.";
447+
448+ sb . AppendLine ( $ "> { name } { descDistanceString } ~ { desc } ") ;
452449 }
453450 }
454451
0 commit comments