Skip to content

Commit

Permalink
add command to treeview list
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Nov 15, 2024
1 parent 76c8666 commit 8941145
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/treeview_commands.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,31 @@ let terminal_item =
Vscode.TreeItem.set_command item command;
item

let items = [ select_sandbox_item; terminal_item ]

let construct_item =
let icon =
`LightDark
Vscode.TreeItem.LightDarkIcon.
{ light = `String (Path.asset "collection-light.svg" |> Path.to_string)
; dark = `String (Path.asset "collection-dark.svg" |> Path.to_string)
}
in
let label =
`TreeItemLabel
(Vscode.TreeItemLabel.create ~label:"Construct" ())
in
let item = Vscode.TreeItem.make_label ~label () in
let command =
Vscode.Command.create
~title:"Construct"
~command:"ocaml.construct"
()
in
Vscode.TreeItem.set_iconPath item icon;
Vscode.TreeItem.set_command item command;
item

let items = [ select_sandbox_item; terminal_item; construct_item ]

let getTreeItem ~element = `Value element

Expand Down

0 comments on commit 8941145

Please sign in to comment.