Skip to content

Commit c9d4a4f

Browse files
committed
fix #3
1 parent 91d27cd commit c9d4a4f

File tree

4 files changed

+28
-2
lines changed

4 files changed

+28
-2
lines changed

Diff for: CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ All notable changes to the "leetcode" extension will be documented in this file.
33

44
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
55

6+
## [0.1.1]
7+
### Fixed
8+
- Fixed a bug in LeetCode Explorer [(#3)](https://github.com/jdneo/vscode-leetcode/issues/3)
9+
610
## [0.1.0]
711
### Added
812
- Sign in/out to LeetCode

Diff for: README.md

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ Solve LeetCode problems in VS Code.
1818
- Search problems by keywords
1919
- Submit solutions to LeetCode
2020

21+
## Commands
22+
This extension provides several commands in the Command Palette (F1 or Ctrl + Shift + P):
23+
- **LeetCode: Sign in** - Sign in to LeetCode
24+
- **LeetCode: Sign out** - Sign out to LeetCode
25+
- **LeetCode: Select session** - Select one session and make it active
26+
- **LeetCode: Create new session** - Create a new session
27+
- **LeetCode: Refresh** - Refresh the LeetCode Explorer
28+
- **LeetCode: Search Problem** - Search for problems by keywords
29+
- **LeetCode: Submit** - Submit the solution to LeetCode
30+
2131
### Sign In and Sign Out
2232
![SignInOut](resources/gif/signinout.gif)
2333

@@ -58,6 +68,16 @@ This extension is based on [@skygragon](https://github.com/skygragon)'s [leetcod
5868
- 根据关键字搜索题目
5969
- 向 LeetCode 提交答案
6070

71+
## 命令
72+
该插件在命令面板(F1 或 Ctrl + Shift + P)中支持下列命令:
73+
- **LeetCode: Sign in** - 登入 LeetCode
74+
- **LeetCode: Sign out** - 登出 LeetCode
75+
- **LeetCode: Select session** - 激活一个已有的答题进度存档
76+
- **LeetCode: Create new session** - 创建一个新的答题进度存档
77+
- **LeetCode: Refresh** - 刷新左侧题目列表视图
78+
- **LeetCode: Search Problem** - 根据关键字搜索题目
79+
- **LeetCode: Submit** - 提交答案到 LeetCode
80+
6181
### 登入及登出
6282
![SignInOut](resources/gif/signinout.gif)
6383

Diff for: src/commands/show.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function showProblem(channel: vscode.OutputChannel, node?: LeetCode
1414
if (!node) {
1515
return;
1616
}
17-
await showProblemInternal(channel, node.id);
17+
await showProblemInternal(channel, node.id.split(".")[1]);
1818
}
1919

2020
export async function searchProblem(channel: vscode.OutputChannel): Promise<void> {

Diff for: src/leetCodeExplorer.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,11 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider<LeetCod
5858
},
5959
};
6060
}
61+
62+
const idPrefix: number = Date.now();
6163
return {
6264
label: element.isProblem ? `[${element.id}] ${element.name}` : element.name,
63-
id: element.id,
65+
id: `${idPrefix}.${element.id}`,
6466
collapsibleState: element.isProblem ? vscode.TreeItemCollapsibleState.None : vscode.TreeItemCollapsibleState.Collapsed,
6567
contextValue: element.isProblem ? "problem" : "difficulty",
6668
iconPath: element.isProblem ?

0 commit comments

Comments
 (0)