File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 11// Copyright (c) jdneo. All rights reserved.
22// Licensed under the MIT license.
33
4+ import { Command } from "vscode" ;
45import { IProblem , ProblemState } from "../shared" ;
56
67export 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}
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments