Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c6f8237

Browse files
committed
1.0.10 更新了过滤题目,只显示算法题,而数据库,shell什么的都不显示了。
1 parent e0caea5 commit c6f8237

6 files changed

+56
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ All notable changes to the "leetcode" extension will be documented in this file.
1111
更新了 imports.py
1212
# 1.0.9
1313
更新了 imports.py 修改二叉树元素为0时,不生成结点的问题。
14+
# 1.0.10
15+
更新了过滤题目,只显示算法题,而数据库,shell什么的都不显示了。

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "python-leetcode",
33
"displayName": "PythonLeetcode",
44
"description": "Solve LeetCode problems in VS Code",
5-
"version": "1.0.9",
5+
"version": "1.0.10",
66
"author": "KuiyuanFu",
77
"publisher": "KuiyuanFu",
88
"license": "MIT",

src/explorer/LeetCodeTreeDataProvider.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider<LeetCod
7272
return explorerNodeManager.getAllNodes();
7373
case Category.Favorite:
7474
return explorerNodeManager.getFavoriteNodes();
75+
// // FuCategory
76+
// case Category.Category:
77+
// return explorerNodeManager.getAllCategoryNodes();
7578
case Category.Difficulty:
7679
return explorerNodeManager.getAllDifficultyNodes();
7780
case Category.Tag:

src/explorer/explorerNodeManager.ts

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,16 @@ class ExplorerNodeManager implements Disposable {
3636
id: Category.All,
3737
name: Category.All,
3838
}), false),
39+
// // FuCategory
40+
// new LeetCodeNode(Object.assign({}, defaultProblem, {
41+
// id: Category.Category,
42+
// name: Category.Category,
43+
// }), false),
3944
new LeetCodeNode(Object.assign({}, defaultProblem, {
4045
id: Category.Difficulty,
4146
name: Category.Difficulty,
4247
}), false),
48+
4349
new LeetCodeNode(Object.assign({}, defaultProblem, {
4450
id: Category.Tag,
4551
name: Category.Tag,
@@ -58,7 +64,30 @@ class ExplorerNodeManager implements Disposable {
5864
public getAllNodes(): LeetCodeNode[] {
5965
return Array.from(this.explorerNodeMap.values());
6066
}
61-
67+
// // FuCategory
68+
// public getAllCategoryNodes(): LeetCodeNode[] {
69+
// const res: LeetCodeNode[] = [];
70+
// res.push(
71+
// new LeetCodeNode(Object.assign({}, defaultProblem, {
72+
// id: `${Category.Category}.Algorithms`,
73+
// name: "Algorithms",
74+
// }), false),
75+
// new LeetCodeNode(Object.assign({}, defaultProblem, {
76+
// id: `${Category.Category}.Others`,
77+
// name: "Others",
78+
// }), false),
79+
// // new LeetCodeNode(Object.assign({}, defaultProblem, {
80+
// // id: `${Category.Category}.Medium`,
81+
// // name: "Medium",
82+
// // }), false),
83+
// // new LeetCodeNode(Object.assign({}, defaultProblem, {
84+
// // id: `${Category.Category}.Hard`,
85+
// // name: "Hard",
86+
// // }), false),
87+
// );
88+
// this.sortSubCategoryNodes(res, Category.Category);
89+
// return res;
90+
// }
6291
public getAllDifficultyNodes(): LeetCodeNode[] {
6392
const res: LeetCodeNode[] = [];
6493
res.push(
@@ -161,6 +190,22 @@ class ExplorerNodeManager implements Disposable {
161190

162191
private sortSubCategoryNodes(subCategoryNodes: LeetCodeNode[], category: Category): void {
163192
switch (category) {
193+
// // FuCategory
194+
// case Category.Category:
195+
// subCategoryNodes.sort((a: LeetCodeNode, b: LeetCodeNode): number => {
196+
// function getValue(input: LeetCodeNode): number {
197+
// switch (input.name.toLowerCase()) {
198+
// case "algorithms":
199+
// return 1;
200+
// case "others":
201+
// return 2;
202+
// default:
203+
// return Number.MAX_SAFE_INTEGER;
204+
// }
205+
// }
206+
// return getValue(a) - getValue(b);
207+
// });
208+
// break;
164209
case Category.Difficulty:
165210
subCategoryNodes.sort((a: LeetCodeNode, b: LeetCodeNode): number => {
166211
function getValue(input: LeetCodeNode): number {

src/leetCodeExecutor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class LeetCodeExecutor implements Disposable {
9090

9191
public async listProblems(showLocked: boolean): Promise<string> {
9292
return await this.executeCommandEx(this.nodeExecutable, showLocked ?
93-
[await this.getLeetCodeBinaryPath(), "list"] :
94-
[await this.getLeetCodeBinaryPath(), "list", "-q", "L"],
93+
[await this.getLeetCodeBinaryPath(), "list" ,'-t','algorithms'] :
94+
[await this.getLeetCodeBinaryPath(), "list",'-t','algorithms', "-q", "L"],
9595
);
9696
}
9797
// FuTodo 文件内容函数

src/shared.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ export const defaultProblem: IProblem = {
9696

9797
export enum Category {
9898
All = "All",
99+
// // FuCategory
100+
// Category = "Category",
99101
Difficulty = "Difficulty",
100102
Tag = "Tag",
101103
Company = "Company",

0 commit comments

Comments
 (0)