Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add 'All' category into the explorer#309

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 1 commit intomasterfromcs/all
May 8, 2019
Merged
Show file tree
Hide file tree
Changes fromall 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 deletionssrc/explorer/LeetCodeTreeDataProvider.ts
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssrc/explorer/explorerNodeManager.ts
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionssrc/shared.ts
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp