From 0b34843e3086572065cd08ed8c8bab5b25cee7aa Mon Sep 17 00:00:00 2001 From: James Pogran Date: Thu, 3 Oct 2019 13:03:23 -0400 Subject: [PATCH 1/2] Provide Run Selection button in Editor Title Menu This commit adds a editor title menu button for the `powershell.RunSelection` command in the primary navigation group, and a custom `play` icon based on ones from the https://github.com/microsoft/vscode-icons repo. This shows the button in the visible part of the menu when a PowerShell file is open. --- package.json | 13 ++++++++++++- resources/dark/play.svg | 5 +++++ resources/light/play.svg | 5 +++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 resources/dark/play.svg create mode 100644 resources/light/play.svg diff --git a/package.json b/package.json index fbb93d38d8..c3c41684be 100644 --- a/package.json +++ b/package.json @@ -164,7 +164,11 @@ { "command": "PowerShell.RunSelection", "title": "Run Selection", - "category": "PowerShell" + "category": "PowerShell", + "icon": { + "light": "resources/light/play.svg", + "dark": "resources/dark/play.svg" + } }, { "command": "PowerShell.RestartSession", @@ -260,6 +264,13 @@ "group": "2_powershell" } ], + "editor/title": [ + { + "when": "resourceLangId == powershell", + "command": "PowerShell.RunSelection", + "group": "navigation@100" + } + ], "editor/title/context": [ { "when": "resourceFilename =~ /\\.tests\\.ps1$/i", diff --git a/resources/dark/play.svg b/resources/dark/play.svg new file mode 100644 index 0000000000..464ef5147e --- /dev/null +++ b/resources/dark/play.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/resources/light/play.svg b/resources/light/play.svg new file mode 100644 index 0000000000..6f479653b5 --- /dev/null +++ b/resources/light/play.svg @@ -0,0 +1,5 @@ + + + + + From 59050890c48c18fc5a5465e99e3cbc097010ca8b Mon Sep 17 00:00:00 2001 From: James Pogran Date: Mon, 7 Oct 2019 10:36:29 -0400 Subject: [PATCH 2/2] Provide Run button in Editor Title Menu This commit adds a editor title menu button for the `powershell.Run` command which maps to the builtin VS Code Debug start command. It places it in the primary navigation group, and the uses `run` icon from the https://github.com/microsoft/vscode-icons repo. This shows the button in the visible part of the menu when a PowerShell file is open. --- package.json | 16 +++++++++++++++- resources/dark/run.svg | 3 +++ resources/light/run.svg | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 resources/dark/run.svg create mode 100644 resources/light/run.svg diff --git a/package.json b/package.json index c3c41684be..8524e19808 100644 --- a/package.json +++ b/package.json @@ -161,6 +161,15 @@ }, "category": "PowerShell" }, + { + "command": "workbench.action.debug.start", + "title": "Run", + "category": "PowerShell", + "icon": { + "light": "resources/light/run.svg", + "dark": "resources/dark/run.svg" + } + }, { "command": "PowerShell.RunSelection", "title": "Run Selection", @@ -267,8 +276,13 @@ "editor/title": [ { "when": "resourceLangId == powershell", - "command": "PowerShell.RunSelection", + "command": "workbench.action.debug.start", "group": "navigation@100" + }, + { + "when": "resourceLangId == powershell", + "command": "PowerShell.RunSelection", + "group": "navigation@101" } ], "editor/title/context": [ diff --git a/resources/dark/run.svg b/resources/dark/run.svg new file mode 100644 index 0000000000..8b0a58eca9 --- /dev/null +++ b/resources/dark/run.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/light/run.svg b/resources/light/run.svg new file mode 100644 index 0000000000..2563bfa114 --- /dev/null +++ b/resources/light/run.svg @@ -0,0 +1,3 @@ + + +