From a58ef69706b0cf1ffb4bb350a6d76385b70925d8 Mon Sep 17 00:00:00 2001 From: ccagml Date: Mon, 27 Feb 2023 14:05:42 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=20=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E5=8F=B0=E8=AF=BB=E5=8F=96=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rpc/factory/api/testApi.ts | 10 ++++---- src/rpc/utils/commUtils.ts | 46 +++++++++++++++++----------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/rpc/factory/api/testApi.ts b/src/rpc/factory/api/testApi.ts index 0704633..1393db9 100644 --- a/src/rpc/factory/api/testApi.ts +++ b/src/rpc/factory/api/testApi.ts @@ -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); + // }); } } diff --git a/src/rpc/utils/commUtils.ts b/src/rpc/utils/commUtils.ts index ed9d509..4c2fd2e 100644 --- a/src/rpc/utils/commUtils.ts +++ b/src/rpc/utils/commUtils.ts @@ -7,7 +7,7 @@ * Copyright (c) 2022 ccagml . All rights reserved. */ -import { storageUtils } from "./storageUtils"; +// import { storageUtils } from "./storageUtils"; class CommUtils { KEYS; @@ -36,30 +36,30 @@ class CommUtils { } } - readStdin(cb) { - const stdin = process.stdin; - let bufs: Array = []; + // readStdin(cb) { + // const stdin = process.stdin; + // let bufs: Array = []; - console.log( - "NOTE: to finish the input, press " + (storageUtils.isWindows() ? " and " : "") - ); + // console.log( + // "NOTE: to finish the input, press " + (storageUtils.isWindows() ? " and " : "") + // ); - 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"]; From d341b2f714cc8fae9449d0b1ee5b01267f7d66c7 Mon Sep 17 00:00:00 2001 From: ccagml Date: Tue, 28 Feb 2023 09:29:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?filepath=20=E6=A0=BC=E5=BC=8F=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E4=BF=9D=E5=AD=98=E5=9C=A8=E5=B7=A5=E4=BD=9C=E5=8C=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 6 ++++++ CHANGELOG.md | 4 ++++ package.json | 3 +-- src/rpc/factory/api/testApi.ts | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index fc1c2f7..80c0026 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,4 +13,10 @@ "*.gafq": "lua", "functional": "cpp" }, + "leetcode-problem-rating.filePath": { + "default": { + "folder": "", + "filename": "${id}.${kebab-case-name}_${yyyymmdd}.${ext}" + } + }, } diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b976e..2ad51fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## version 2.17.7 + +- filepath 格式可以保存在工作区,避免每次新环境还要配文件名 + ## version 2.17.6 - 最新的题通过后没有百分比运行信息 diff --git a/package.json b/package.json index a3c021d..781a71c 100644 --- a/package.json +++ b/package.json @@ -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", @@ -767,7 +767,6 @@ }, "leetcode-problem-rating.filePath": { "type": "object", - "scope": "machine", "description": "%main.contributes.configuration.properties.leetcode-problem-rating.filePath.description%", "properties": { "default": { diff --git a/src/rpc/factory/api/testApi.ts b/src/rpc/factory/api/testApi.ts index 1393db9..5a5c3ab 100644 --- a/src/rpc/factory/api/testApi.ts +++ b/src/rpc/factory/api/testApi.ts @@ -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 {