Skip to content
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
2 changes: 2 additions & 0 deletions src/explorer/LeetCodeTreeDataProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider<LeetCod
return explorerNodeManager.getRootNodes();
} else {
switch (element.id) { // First-level
case Category.All:
return explorerNodeManager.getAllNodes();
case Category.Favorite:
return explorerNodeManager.getFavoriteNodes();
case Category.Difficulty:
Expand Down
8 changes: 8 additions & 0 deletions src/explorer/explorerNodeManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ class ExplorerNodeManager implements Disposable {

public getRootNodes(): LeetCodeNode[] {
return [
new LeetCodeNode(Object.assign({}, defaultProblem, {
id: Category.All,
name: Category.All,
}), false),
new LeetCodeNode(Object.assign({}, defaultProblem, {
id: Category.Difficulty,
name: Category.Difficulty,
Expand All @@ -46,6 +50,10 @@ class ExplorerNodeManager implements Disposable {
];
}

public getAllNodes(): LeetCodeNode[] {
return Array.from(this.explorerNodeMap.values());
}

public getAllDifficultyNodes(): LeetCodeNode[] {
const res: LeetCodeNode[] = [];
res.push(
Expand Down
1 change: 1 addition & 0 deletions src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const defaultProblem: IProblem = {
};

export enum Category {
All = "All",
Difficulty = "Difficulty",
Tag = "Tag",
Company = "Company",
Expand Down