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

Commit dbeddab

Browse files
Add Click the tree explorer should open the topic (#132)
1 parent ccb62f5 commit dbeddab

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

‎src/explorer/LeetCodeNode.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) jdneo. All rights reserved.
22
// Licensed under the MIT license.
33

4+
import { Command } from "vscode";
45
import { IProblem, ProblemState } from "../shared";
56

67
export class LeetCodeNode {
@@ -48,4 +49,12 @@ export class LeetCodeNode {
4849
public get parentName(): string {
4950
return this.parentNodeName;
5051
}
52+
53+
public get selectedCommand(): Command {
54+
return {
55+
title: "Open Problem",
56+
command: "leetcode.showProblem",
57+
arguments: [this],
58+
};
59+
}
5160
}

‎src/explorer/LeetCodeTreeDataProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider<LeetCod
5252
collapsibleState: element.isProblem ? vscode.TreeItemCollapsibleState.None : vscode.TreeItemCollapsibleState.Collapsed,
5353
contextValue: element.isProblem ? "problem" : element.id.toLowerCase(),
5454
iconPath: this.parseIconPathFromProblemState(element),
55+
command: element.isProblem ? element.selectedCommand : undefined,
5556
};
5657
}
5758

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /