@@ -194,7 +194,7 @@ public static void RunCodeCode(Question question, Project project) {
194
194
195
195
String body = response .getBody ();
196
196
JSONObject returnObj = JSONObject .parseObject (body );
197
- ProgressManager .getInstance ().run (new RunCodeCheckTask (returnObj , project ));
197
+ ProgressManager .getInstance ().run (new RunCodeCheckTask (returnObj , project , question . getTestCase () ));
198
198
MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("request.pending" ));
199
199
} else {
200
200
LogUtils .LOG .error ("RuncodeCode failure " + response .getBody ());
@@ -366,8 +366,8 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
366
366
}
367
367
}
368
368
} else {
369
- String outputs = StringUtils . join ( jsonObject .getJSONArray ( "code_output" ), " \n \t \t " );
370
- MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("submit.run.failed" , buildErrorMsg (jsonObject ), outputs ));
369
+ String outputs = jsonObject .getString ( "std_output " );
370
+ MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("submit.run.failed" , buildErrorMsg (jsonObject ),jsonObject . getString ( "last_testcase" ), outputs ));
371
371
if (!"ac" .equals (question .getStatus ())) {
372
372
question .setStatus ("notac" );
373
373
ViewManager .updateStatus ();
@@ -408,11 +408,13 @@ private static String buildErrorMsg(JSONObject errorBody) {
408
408
private static class RunCodeCheckTask extends Task .Backgroundable {
409
409
private JSONObject returnObj ;
410
410
private Project project ;
411
+ private String input ;
411
412
412
- public RunCodeCheckTask (JSONObject returnObj , Project project ) {
413
+ public RunCodeCheckTask (JSONObject returnObj , Project project , String input ) {
413
414
super (project ,"leetcode.editor.runCodeCheckTask" ,true );
414
415
this .returnObj = returnObj ;
415
416
this .project = project ;
417
+ this .input = input ;
416
418
}
417
419
418
420
@ Override
@@ -454,7 +456,7 @@ public void run(@NotNull ProgressIndicator progressIndicator) {
454
456
MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("test.success" , input , output , expected , outputs ));
455
457
} else {
456
458
String outputs = StringUtils .join (jsonObject .getJSONArray ("code_output" ), "\n \t \t " );
457
- MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("submit.run.failed" , buildErrorMsg (jsonObject ), outputs ));
459
+ MessageUtils .getInstance (project ).showInfoMsg ("info" , PropertiesUtils .getInfo ("submit.run.failed" , buildErrorMsg (jsonObject ), input , outputs ));
458
460
}
459
461
return ;
460
462
}
0 commit comments