@@ -565,7 +565,16 @@ private static IEnumerable<Action> GetRuntimeDefinedActions(CompilationUnitSynta
565565
566566 var declaringSyntax = targetSymbol . DeclaringSyntaxReferences . FirstOrDefault ( ) ? . GetSyntax ( ) ;
567567
568- TryGetDocumentation ( targetSymbol , logger , out XElement ? documentationXML , out string ? summary ) ;
568+ string ? ReturnDescription = null ;
569+ if ( TryGetDocumentation ( targetSymbol , logger , out XElement ? documentationXML , out string ? summary ) )
570+ {
571+ var returnNode = documentationXML ? . Element ( "returns" ) ;
572+ if ( returnNode != null )
573+ {
574+ ReturnDescription = string . Join ( "" , returnNode . DescendantNodes ( ) . OfType < XText > ( ) . Select ( n => n . ToString ( ) ) ) . Trim ( ) ;
575+ logger ? . WriteLine ( $ "\t Found a return: { ReturnDescription } ") ;
576+ }
577+ }
569578
570579 yield return new Action ( name , methodCall . Type , targetSymbol )
571580 {
@@ -577,6 +586,7 @@ private static IEnumerable<Action> GetRuntimeDefinedActions(CompilationUnitSynta
577586 Parameters = GetParams ( targetSymbol , documentationXML , logger ) ,
578587 SourceFileName = root . SyntaxTree . FilePath ,
579588 DeclarationType = DeclarationType . DirectRegistration ,
589+ ReturnDescription = ReturnDescription ,
580590 } ;
581591 }
582592 }
@@ -647,6 +657,7 @@ private static bool TryGetDocumentation(IMethodSymbol targetSymbol, ILogger? log
647657
648658 // 3. This is not doc XML and just happens to be a comment above a command/function
649659 summary = documentationComments ;
660+ documentationXML = null ;
650661 logger ? . WriteLine ( "Unable to determine XML, returning the comment as is" ) ;
651662 return true ;
652663 }
@@ -741,7 +752,16 @@ private static IEnumerable<Action> GetAttributeActions(CompilationUnitSyntax roo
741752 continue ;
742753 }
743754
744- TryGetDocumentation ( methodSymbol , logger , out XElement ? documentationXML , out string ? summary ) ;
755+ string ? ReturnDescription = null ;
756+ if ( TryGetDocumentation ( methodSymbol , logger , out XElement ? documentationXML , out string ? summary ) )
757+ {
758+ var returnNode = documentationXML ? . Element ( "returns" ) ;
759+ if ( returnNode != null )
760+ {
761+ ReturnDescription = string . Join ( "" , returnNode . DescendantNodes ( ) . OfType < XText > ( ) . Select ( n => n . ToString ( ) ) ) . Trim ( ) ;
762+ logger . WriteLine ( $ "\t Found a return: { ReturnDescription } ") ;
763+ }
764+ }
745765
746766 var containerName = container ? . ToDisplayString ( SymbolDisplayFormat . FullyQualifiedFormat ) ?? "<unknown>" ;
747767
@@ -761,6 +781,7 @@ private static IEnumerable<Action> GetAttributeActions(CompilationUnitSyntax roo
761781 Description = summary ,
762782 SourceFileName = root . SyntaxTree . FilePath ,
763783 DeclarationType = DeclarationType . Attribute ,
784+ ReturnDescription = ReturnDescription ,
764785 } ;
765786 }
766787 }
0 commit comments