Skip to content

Commit 051c09d

Browse files
authored
Merge pull request #310 from ccagml/main
多个用例部分正确部分错误的上色问题
2 parents 7282c7c + 5e2799e commit 051c09d

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"outFiles": [
6969
"${workspaceRoot}/out/src/**/*.js"
7070
],
71-
"trace": true,
71+
"trace": false,
7272
"preLaunchTask": "window_npm"
7373
},
7474
{

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# version 3.1.20
2+
3+
- 多个用例部分正确部分错误的上色问题
4+
15
# version 3.1.19
26

37
- 美区会获取不了题目

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-leetcode-problem-rating",
33
"displayName": "LeetCode",
44
"description": "%main.description%",
5-
"version": "3.1.19",
5+
"version": "3.1.20",
66
"author": "ccagml",
77
"publisher": "ccagml",
88
"license": "MIT",

src/commitResult/CommitResultModule.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,9 @@ class SubmissionService extends BaseWebViewService {
196196
let output_str = temp[output_key] || [];
197197
let expected_str = temp[expected_key] || [];
198198
let min_len = Math.min(output_str.length, expected_str.length);
199+
let compare_result = temp.system_message.compare_result || ""
199200
for (let index = 0; index < min_len; index++) {
200-
if (output_str[index] != expected_str[index]) {
201+
if (compare_result[index] != '1' && output_str[index] != expected_str[index]) {
201202
let temp_result = this.add_color_str(output_str[index], expected_str[index]);
202203
output_str[index] = temp_result[0] || "";
203204
expected_str[index] = temp_result[1] || "";

src/rpc/actionChain/chainNode/leetcode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ server to get the problem's description, test cases, and other information. */
217217
testcase: util.inspect(result.input || result.last_testcase || ""),
218218
passed: result.total_correct || 0,
219219
total: result.total_testcases || 0,
220+
compare_result: result.compare_result || ""
220221
};
221222

222223
x.error = underscore

src/rpc/factory/api/testApi.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ class TestApi extends ApiBase {
162162

163163
if (results[0].state === "Accepted") {
164164
results[0].state = "Finished";
165+
log_obj.system_message.compare_result = results[0].compare_result;
166+
}
167+
if (results[0].ok) {
165168
log_obj.system_message.accepted = true;
166169
}
167170
that.printResult(results[0], null, "state", log_obj);

0 commit comments

Comments
 (0)