File tree 2 files changed +10
-0
lines changed
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1
1
// Copyright (c) jdneo. All rights reserved.
2
2
// Licensed under the MIT license.
3
3
4
+ import { Command } from "vscode" ;
4
5
import { IProblem , ProblemState } from "../shared" ;
5
6
6
7
export class LeetCodeNode {
@@ -48,4 +49,12 @@ export class LeetCodeNode {
48
49
public get parentName ( ) : string {
49
50
return this . parentNodeName ;
50
51
}
52
+
53
+ public get selectedCommand ( ) : Command {
54
+ return {
55
+ title : "Open Problem" ,
56
+ command : "leetcode.showProblem" ,
57
+ arguments : [ this ] ,
58
+ } ;
59
+ }
51
60
}
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export class LeetCodeTreeDataProvider implements vscode.TreeDataProvider<LeetCod
52
52
collapsibleState : element . isProblem ? vscode . TreeItemCollapsibleState . None : vscode . TreeItemCollapsibleState . Collapsed ,
53
53
contextValue : element . isProblem ? "problem" : element . id . toLowerCase ( ) ,
54
54
iconPath : this . parseIconPathFromProblemState ( element ) ,
55
+ command : element . isProblem ? element . selectedCommand : undefined ,
55
56
} ;
56
57
}
57
58
You can’t perform that action at this time.
0 commit comments