Skip to content

2.17.7 #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@
"*.gafq": "lua",
"functional": "cpp"
},
"leetcode-problem-rating.filePath": {
"default": {
"folder": "",
"filename": "${id}.${kebab-case-name}_${yyyymmdd}.${ext}"
}
},
}
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## version 2.17.7

- filepath 格式可以保存在工作区,避免每次新环境还要配文件名

## version 2.17.6

- 最新的题通过后没有百分比运行信息
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "vscode-leetcode-problem-rating",
"displayName": "LeetCode",
"description": "%main.description%",
"version": "2.17.6",
"version": "2.17.7",
"author": "ccagml",
"publisher": "ccagml",
"license": "MIT",
Expand Down Expand Up @@ -767,7 +767,6 @@
},
"leetcode-problem-rating.filePath": {
"type": "object",
"scope": "machine",
"description": "%main.contributes.configuration.properties.leetcode-problem-rating.filePath.description%",
"properties": {
"default": {
Expand Down
12 changes: 6 additions & 6 deletions src/rpc/factory/api/testApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { reply } from "../../utils/ReplyUtils";

import { sessionUtils } from "../../utils/sessionUtils";
import { ApiBase } from "../apiBase";
import { commUtils } from "../../utils/commUtils";
// import { commUtils } from "../../utils/commUtils";
import { chainMgr } from "../../actionChain/chainManager";

class TestApi extends ApiBase {
Expand Down Expand Up @@ -188,12 +188,12 @@ class TestApi extends ApiBase {
sessionUtils.argv = argv;
if (!argv.i) return that.runTest(argv);

commUtils.readStdin(function (e, data) {
if (e) return reply.info(e);
// commUtils.readStdin(function (e, data) {
// if (e) return reply.info(e);

argv.testcase = data;
return that.runTest(argv);
});
// argv.testcase = data;
// return that.runTest(argv);
// });
}
}

Expand Down
46 changes: 23 additions & 23 deletions src/rpc/utils/commUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Copyright (c) 2022 ccagml . All rights reserved.
*/

import { storageUtils } from "./storageUtils";
// import { storageUtils } from "./storageUtils";

class CommUtils {
KEYS;
Expand Down Expand Up @@ -36,30 +36,30 @@ class CommUtils {
}
}

readStdin(cb) {
const stdin = process.stdin;
let bufs: Array<any> = [];
// readStdin(cb) {
// const stdin = process.stdin;
// let bufs: Array<any> = [];

console.log(
"NOTE: to finish the input, press " + (storageUtils.isWindows() ? "<Ctrl-D> and <Return>" : "<Ctrl-D>")
);
// console.log(
// "NOTE: to finish the input, press " + (storageUtils.isWindows() ? "<Ctrl-D> and <Return>" : "<Ctrl-D>")
// );

stdin.on("readable", function () {
const data = stdin.read();
if (data) {
// windows doesn't treat ctrl-D as EOF
if (storageUtils.isWindows() && data.toString() === "\x04\r\n") {
stdin.emit("end");
} else {
bufs.push(data);
}
}
});
stdin.on("end", function () {
cb(null, Buffer.concat(bufs).toString());
});
stdin.on("error", cb);
}
// stdin.on("readable", function () {
// const data = stdin.read();
// if (data) {
// // windows doesn't treat ctrl-D as EOF
// if (storageUtils.isWindows() && data.toString() === "\x04\r\n") {
// stdin.emit("end");
// } else {
// bufs.push(data);
// }
// }
// });
// stdin.on("end", function () {
// cb(null, Buffer.concat(bufs).toString());
// });
// stdin.on("error", cb);
// }

getSetCookieValue(resp: any, key: any) {
const cookies = resp.headers["set-cookie"];
Expand Down