@@ -95,17 +95,24 @@ public ActionResult EndpointJsonFile(string name)
9595 return Content ( System . IO . File . ReadAllText ( System . IO . Path . Combine ( endpoint . Directory , "endpoint.json" ) ) ) ;
9696 }
9797
98- public ActionResult ViewRequestCreatorFile ( string name , int requestCreatorId )
98+ public ActionResult ViewResponseCreatorFile ( string name , int responseCreatorId )
9999 {
100100 var endpoint = _endpointCollection . Get ( name ) ;
101- var requestCreator = endpoint . Responses . ElementAt ( requestCreatorId ) . Item2 ;
102- if ( requestCreator is FileDynamicResponseCreator fileDynamicResponseCreator )
101+ var responseCreator = endpoint . Responses . ElementAt ( responseCreatorId ) . Item2 ;
102+ if ( responseCreator is FileDynamicResponseCreator fileDynamicResponseCreator )
103103 {
104- return Content ( fileDynamicResponseCreator . GetSourceCodeWithIncludesExecuted ( ) , "text/plain" ) ;
104+ var sourceCode = fileDynamicResponseCreator . GetSourceCodeWithIncludesExecuted ( ) ;
105+ var lines = sourceCode . Split ( '\n ' ) ;
106+ var sourceWithLineNumber =
107+ from
108+ i in Enumerable . Range ( 0 , lines . Length )
109+ select
110+ $ "{ i + 1 } : { lines [ i ] } ";
111+ return Content ( string . Join ( "\n " , sourceWithLineNumber ) , "text/plain" ) ;
105112 }
106- else if ( requestCreator is IResponseCreatorWithFilename requestCreatorWithFilename )
113+ else if ( responseCreator is IResponseCreatorWithFilename responseCreatorWithFilename )
107114 {
108- return File ( System . IO . File . OpenRead ( requestCreatorWithFilename . Filename ) , "text/plain" ) ;
115+ return File ( System . IO . File . OpenRead ( responseCreatorWithFilename . Filename ) , "text/plain" ) ;
109116 }
110117 else
111118 {
0 commit comments