Skip to content

Commit

Permalink
Add an editor button to switch to the digitaljs side panel
Browse files Browse the repository at this point in the history
This is to replace the auto switching behavior we currently have.
  • Loading branch information
yuyichao committed Feb 3, 2022
1 parent edc3caf commit 0006046
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 13 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@
"icon": "imgs/digitaljs.svg",
"category": "DigitalJS"
},
{
"command": "digitaljs.showPanel",
"title": "Show DigitalJS Panel",
"icon": "imgs/digitaljs.svg",
"category": "DigitalJS"
},
{
"command": "digitaljs.openViewJSON",
"title": "Open as circuit in DigitalJS",
Expand Down Expand Up @@ -164,15 +170,20 @@
"when": "!digitaljs.view_isfocus",
"group": "navigation"
},
{
"command": "digitaljs.showPanel",
"when": "digitaljs.view_isfocus",
"group": "navigation@0"
},
{
"command": "digitaljs.pause",
"when": "digitaljs.view_isfocus && digitaljs.view_hascircuit && digitaljs.view_running",
"group": "navigation"
"group": "navigation@1"
},
{
"command": "digitaljs.start",
"when": "digitaljs.view_isfocus && digitaljs.view_hascircuit && !digitaljs.view_running",
"group": "navigation"
"group": "navigation@1"
}
],
"explorer/context": [
Expand Down
4 changes: 4 additions & 0 deletions src/extension.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ class DigitalJS {
context.subscriptions.push(
vscode.commands.registerCommand('digitaljs.openView',
() => this.#openView()));
context.subscriptions.push(
vscode.commands.registerCommand('digitaljs.showPanel',
() => vscode.commands.executeCommand(
'digitaljs-proj-files.focus')));
context.subscriptions.push(
vscode.commands.registerCommand('digitaljs.openViewJSON',
(item) => this.#openViewJSON(item)));
Expand Down

0 comments on commit 0006046

Please sign in to comment.