@@ -736,7 +736,7 @@ private bool ReplayScenario(string scenario_path, Script scenario, out Result sc
736
736
Exception exc = null ;
737
737
if ( Util . ReadResultFile ( resultFile , out result , out exc ) )
738
738
{ //Here Dispaly a dialog box with the result.
739
- scenarioResult = result ;
739
+ scenarioResult = result ;
740
740
if ( bPromt )
741
741
{
742
742
JObject jobject = JObject . FromObject ( result ) ;
@@ -809,14 +809,31 @@ private void CreateTestFiles(Script scenario, String scenarioFile)
809
809
Result result = null ;
810
810
if ( ReplayScenario ( scenarioFile , scenario , out result , false ) )
811
811
{
812
- JObject jobject = JObject . FromObject ( result ) ;
813
- using (
814
- FileStream stream =
815
- System . IO . File . Create ( Path . Combine ( fi . DirectoryName , basename + Util . RESULT_FILE_EXTENSION ) ) )
812
+ bool bSaved = false ;
813
+ try
816
814
{
817
- string text = jobject . ToString ( ) ;
818
- byte [ ] bytes = Encoding . UTF8 . GetBytes ( text ) ;
819
- stream . Write ( bytes , 0 , bytes . Length ) ;
815
+ string result_dir = null ;
816
+ bool bExist = Util . EnsureResultDirectoryExists ( scenarioFile , out result_dir ) ;
817
+ string resultFile = System . IO . Path . Combine ( result_dir , Util . GetResultFileName ( scenarioFile ) ) ;
818
+ if ( bExist )
819
+ {
820
+ File . Copy ( resultFile , Path . Combine ( fi . DirectoryName , basename + Util . RESULT_FILE_EXTENSION ) ) ;
821
+ bSaved = true ;
822
+ }
823
+ }
824
+ catch ( Exception e )
825
+ {
826
+ Console . WriteLine ( e ) ;
827
+ }
828
+ if ( ! bSaved )
829
+ {
830
+ using (
831
+ FileStream stream =
832
+ System . IO . File . Create ( Path . Combine ( fi . DirectoryName , basename + Util . RESULT_FILE_EXTENSION ) )
833
+ )
834
+ {
835
+ result . Write ( stream ) ;
836
+ }
820
837
}
821
838
}
822
839
}
@@ -1019,10 +1036,15 @@ private void RunScenarioController()
1019
1036
}
1020
1037
}
1021
1038
1039
+ /// <summary>
1040
+ /// Handler when a LSP message is receice, it can be a client or a server message.
1041
+ /// This can be a base point for filtering any message, regardless the target document.
1042
+ /// </summary>
1043
+ /// <param name="sender"></param>
1044
+ /// <param name="e"></param>
1022
1045
private void Consumer_LspMessageHandler ( object sender , Common . Model . Message . LspMessage e )
1023
1046
{
1024
- //RunScenarioController();
1025
- Log . LogWriter . WriteLine ( e . Message ) ;
1047
+ //Log.LogWriter.WriteLine(e.Message);
1026
1048
}
1027
1049
1028
1050
public bool CanExecute ( object parameter )
0 commit comments