Skip to content

Commit a23fb1f

Browse files
authored
Merge pull request #59 from ccagml/main
2.3.1
2 parents 8d52cab + a479c1d commit a23fb1f

14 files changed

+434
-7
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## version 2.3.1
2+
3+
- 状态栏增加简单的计时器
4+
15
## version 2.2.4
26

37
- 优化说明简介

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
-[zerotrac.github.io](https://zerotrac.github.io/leetcode_problem_rating/data.json)获取数据进行缓存,数据更新时,可以尝试使用 deleteAllCache,重新获取数据
2424
- [新增区块测试用例](#区块测试用例)
2525
- [新增搬砖功能(重复练习?)](#搬砖功能的说明)
26+
- [状态栏增加简易计时器](#状态栏增加简易计时器)
2627

2728
# 关于本项目
2829

@@ -64,17 +65,22 @@
6465

6566
- 简单的比较这些用例字符串是否相同
6667

68+
## 状态栏增加简易计时器
69+
70+
- 查看一个题目时会开始计时,提交一个题目通过后会停止计时
71+
6772
<!-- ## TODO 看到一些可能会用得上的功能
6873
6974
- (完成) 在文件里面插入一些测试用例?
7075
- (完成) 不是中文站点,直接隐藏账号密码登录的方式
7176
- 默认的工作目录修改 不再是.leetcode(不改了)
72-
- 想做一个可以根据计算下次回顾本题的功能?(需要在设置的工作目录中存放多个文件?)
77+
- (完成)想做一个可以根据计算下次回顾本题的功能?
78+
- (需要在设置的工作目录中存放多个文件?)
7379
- (完成) Test 按钮应该不在需要 case 和 allcase 只要留下输入的功能
7480
- 备忘录功能(数据直接放设置的工作目录?用 github 同步?)
7581
- 获取提交历史(直接找官方的提交数据)
7682
- 提交答案与期望答案不同的地方?
77-
- 做题目计时
83+
- (完成)做题目计时
7884
- 还没出分前周赛题目显示 未评分(需要官网获取最新几期的题目编号) -->
7985

8086
## 搬砖功能的说明

package.json

+90-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-leetcode-problem-rating",
33
"displayName": "LeetCode",
44
"description": "LeetCode 官方插件增强, 代码开源, 增加 LeetCode 题目难度分, 给个star吧, 球球了",
5-
"version": "2.2.4",
5+
"version": "2.3.1",
66
"author": "ccagml",
77
"publisher": "ccagml",
88
"license": "MIT",
@@ -182,6 +182,44 @@
182182
"title": "Sort Problems",
183183
"category": "LeetCode",
184184
"icon": "$(sort-precedence)"
185+
},
186+
{
187+
"command": "mywiki.commentcreateNote",
188+
"title": "Create Note",
189+
"enablement": "!commentIsEmpty"
190+
},
191+
{
192+
"command": "mywiki.commentreplyNote",
193+
"title": "Reply",
194+
"enablement": "!commentIsEmpty"
195+
},
196+
{
197+
"command": "mywiki.commenteditNote",
198+
"title": "Edit",
199+
"icon": {
200+
"dark": "resources/edit_inverse.svg",
201+
"light": "resources/edit.svg"
202+
}
203+
},
204+
{
205+
"command": "mywiki.commentdeleteNoteComment",
206+
"title": "Delete",
207+
"icon": {
208+
"dark": "resources/close_inverse.svg",
209+
"light": "resources/close.svg"
210+
}
211+
},
212+
{
213+
"command": "mywiki.commentsaveNote",
214+
"title": "Save"
215+
},
216+
{
217+
"command": "mywiki.commentcancelsaveNote",
218+
"title": "Cancel"
219+
},
220+
{
221+
"command": "mywiki.commentdispose",
222+
"title": "Remove All Notes"
185223
}
186224
],
187225
"viewsContainers": {
@@ -206,6 +244,57 @@
206244
]
207245
},
208246
"menus": {
247+
"commandPalette": [
248+
{
249+
"command": "mywiki.commentcreateNote",
250+
"when": "false"
251+
},
252+
{
253+
"command": "mywiki.commentreplyNote",
254+
"when": "false"
255+
},
256+
{
257+
"command": "mywiki.commentdeleteNoteComment",
258+
"when": "false"
259+
}
260+
],
261+
"comments/commentThread/title": [],
262+
"comments/commentThread/context": [
263+
{
264+
"command": "mywiki.commentcreateNote",
265+
"group": "inline",
266+
"when": "commentController == comment-sample && commentThreadIsEmpty"
267+
},
268+
{
269+
"command": "mywiki.commentreplyNote",
270+
"group": "inline",
271+
"when": "commentController == comment-sample && !commentThreadIsEmpty"
272+
}
273+
],
274+
"comments/comment/title": [
275+
{
276+
"command": "mywiki.commenteditNote",
277+
"group": "group@1",
278+
"when": "commentController == comment-sample"
279+
},
280+
{
281+
"command": "mywiki.commentdeleteNoteComment",
282+
"group": "group@2",
283+
"when": "commentController == comment-sample && comment == canDelete"
284+
}
285+
],
286+
"comments/comment/context": [
287+
{
288+
"command": "mywiki.commentcancelsaveNote",
289+
"group": "inline@1",
290+
"when": "commentController == comment-sample"
291+
},
292+
{
293+
"command": "mywiki.commentsaveNote",
294+
"group": "inline@2",
295+
"when": "commentController == comment-sample"
296+
}
297+
],
209298
"view/title": [
210299
{
211300
"command": "lcpr.toggleLeetCodeCn",

resources/close.svg

+1
Loading

resources/close_inverse.svg

+1
Loading

resources/edit.svg

+1
Loading

resources/edit_inverse.svg

+1
Loading

src/controller/EventController.ts

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*/
99

1010
import { eventService } from "../service/EventService";
11+
import { statusBarTimeService } from "../service/StatusBarTimeService";
1112
// 事件的控制器
1213
/* The EventController class has a method called addEvent that calls the addEvent method on the
1314
eventService class */
@@ -22,6 +23,10 @@ class EventContorller {
2223
public addEvent() {
2324
eventService.addEvent();
2425
}
26+
27+
public every_second() {
28+
statusBarTimeService.updateSecond();
29+
}
2530
}
2631

2732
export const eventController: EventContorller = new EventContorller();

src/controller/TreeViewController.ts

+6
Original file line numberDiff line numberDiff line change
@@ -769,6 +769,12 @@ class TreeViewController implements Disposable {
769769
if (descriptionConfig.showInWebview) {
770770
promises.push(this.showDescriptionView(node));
771771
}
772+
promises.push(
773+
new Promise(async (resolve, _) => {
774+
await eventService.emit("showProblemFinish", node);
775+
resolve(1);
776+
})
777+
);
772778

773779
await Promise.all(promises);
774780
} catch (error) {

src/dao/bricksDao.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,14 @@ class BricksDao {
143143
public async addSubmitTimeByQid(qid: string) {
144144
let temp_data = await this.getInfoByQid(qid);
145145
let submit_time = temp_data.submit_time || [];
146-
submit_time.push(getDayNow());
146+
let submit_now = getDayNow();
147+
submit_time.push(submit_now);
147148
temp_data.submit_time = submit_time;
148149
if (!temp_data.type) {
149150
temp_data.type = BricksType.TYPE_2;
150151
}
151152
await this.setInfoByQid(qid, temp_data);
153+
return submit_now;
152154
}
153155
public async setTypeByQid(qid: string, type) {
154156
let temp_data = await this.getInfoByQid(qid);

0 commit comments

Comments
 (0)