Skip to content

2.3.1 #59

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 3 commits into from
Nov 26, 2022
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## version 2.3.1

- 状态栏增加简单的计时器

## version 2.2.4

- 优化说明简介
Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- 从[zerotrac.github.io](https://zerotrac.github.io/leetcode_problem_rating/data.json)获取数据进行缓存,数据更新时,可以尝试使用 deleteAllCache,重新获取数据
- [新增区块测试用例](#区块测试用例)
- [新增搬砖功能(重复练习?)](#搬砖功能的说明)
- [状态栏增加简易计时器](#状态栏增加简易计时器)

# 关于本项目

Expand Down Expand Up @@ -64,17 +65,22 @@

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

## 状态栏增加简易计时器

- 查看一个题目时会开始计时,提交一个题目通过后会停止计时

<!-- ## TODO 看到一些可能会用得上的功能

- (完成) 在文件里面插入一些测试用例?
- (完成) 不是中文站点,直接隐藏账号密码登录的方式
- 默认的工作目录修改 不再是.leetcode(不改了)
- 想做一个可以根据计算下次回顾本题的功能?(需要在设置的工作目录中存放多个文件?)
- (完成)想做一个可以根据计算下次回顾本题的功能?
- (需要在设置的工作目录中存放多个文件?)
- (完成) Test 按钮应该不在需要 case 和 allcase 只要留下输入的功能
- 备忘录功能(数据直接放设置的工作目录?用 github 同步?)
- 获取提交历史(直接找官方的提交数据)
- 提交答案与期望答案不同的地方?
- 做题目计时
- (完成)做题目计时
- 还没出分前周赛题目显示 未评分(需要官网获取最新几期的题目编号) -->

## 搬砖功能的说明
Expand Down
91 changes: 90 additions & 1 deletion 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": "LeetCode 官方插件增强, 代码开源, 增加 LeetCode 题目难度分, 给个star吧, 球球了",
"version": "2.2.4",
"version": "2.3.1",
"author": "ccagml",
"publisher": "ccagml",
"license": "MIT",
Expand Down Expand Up @@ -182,6 +182,44 @@
"title": "Sort Problems",
"category": "LeetCode",
"icon": "$(sort-precedence)"
},
{
"command": "mywiki.commentcreateNote",
"title": "Create Note",
"enablement": "!commentIsEmpty"
},
{
"command": "mywiki.commentreplyNote",
"title": "Reply",
"enablement": "!commentIsEmpty"
},
{
"command": "mywiki.commenteditNote",
"title": "Edit",
"icon": {
"dark": "resources/edit_inverse.svg",
"light": "resources/edit.svg"
}
},
{
"command": "mywiki.commentdeleteNoteComment",
"title": "Delete",
"icon": {
"dark": "resources/close_inverse.svg",
"light": "resources/close.svg"
}
},
{
"command": "mywiki.commentsaveNote",
"title": "Save"
},
{
"command": "mywiki.commentcancelsaveNote",
"title": "Cancel"
},
{
"command": "mywiki.commentdispose",
"title": "Remove All Notes"
}
],
"viewsContainers": {
Expand All @@ -206,6 +244,57 @@
]
},
"menus": {
"commandPalette": [
{
"command": "mywiki.commentcreateNote",
"when": "false"
},
{
"command": "mywiki.commentreplyNote",
"when": "false"
},
{
"command": "mywiki.commentdeleteNoteComment",
"when": "false"
}
],
"comments/commentThread/title": [],
"comments/commentThread/context": [
{
"command": "mywiki.commentcreateNote",
"group": "inline",
"when": "commentController == comment-sample && commentThreadIsEmpty"
},
{
"command": "mywiki.commentreplyNote",
"group": "inline",
"when": "commentController == comment-sample && !commentThreadIsEmpty"
}
],
"comments/comment/title": [
{
"command": "mywiki.commenteditNote",
"group": "group@1",
"when": "commentController == comment-sample"
},
{
"command": "mywiki.commentdeleteNoteComment",
"group": "group@2",
"when": "commentController == comment-sample && comment == canDelete"
}
],
"comments/comment/context": [
{
"command": "mywiki.commentcancelsaveNote",
"group": "inline@1",
"when": "commentController == comment-sample"
},
{
"command": "mywiki.commentsaveNote",
"group": "inline@2",
"when": "commentController == comment-sample"
}
],
"view/title": [
{
"command": "lcpr.toggleLeetCodeCn",
Expand Down
1 change: 1 addition & 0 deletions resources/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/close_inverse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/edit.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions resources/edit_inverse.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions src/controller/EventController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

import { eventService } from "../service/EventService";
import { statusBarTimeService } from "../service/StatusBarTimeService";
// 事件的控制器
/* The EventController class has a method called addEvent that calls the addEvent method on the
eventService class */
Expand All @@ -22,6 +23,10 @@ class EventContorller {
public addEvent() {
eventService.addEvent();
}

public every_second() {
statusBarTimeService.updateSecond();
}
}

export const eventController: EventContorller = new EventContorller();
6 changes: 6 additions & 0 deletions src/controller/TreeViewController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,12 @@ class TreeViewController implements Disposable {
if (descriptionConfig.showInWebview) {
promises.push(this.showDescriptionView(node));
}
promises.push(
new Promise(async (resolve, _) => {
await eventService.emit("showProblemFinish", node);
resolve(1);
})
);

await Promise.all(promises);
} catch (error) {
Expand Down
4 changes: 3 additions & 1 deletion src/dao/bricksDao.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,14 @@ class BricksDao {
public async addSubmitTimeByQid(qid: string) {
let temp_data = await this.getInfoByQid(qid);
let submit_time = temp_data.submit_time || [];
submit_time.push(getDayNow());
let submit_now = getDayNow();
submit_time.push(submit_now);
temp_data.submit_time = submit_time;
if (!temp_data.type) {
temp_data.type = BricksType.TYPE_2;
}
await this.setInfoByQid(qid, temp_data);
return submit_now;
}
public async setTypeByQid(qid: string, type) {
let temp_data = await this.getInfoByQid(qid);
Expand Down
Loading