Skip to content

Commit 57806fb

Browse files
James PogranTylerLeonhardt
James Pogran
authored andcommitted
Provide Run Selection button in Editor Title Menu (#2224)
* 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.
1 parent 412b60a commit 57806fb

File tree

5 files changed

+42
-1
lines changed

5 files changed

+42
-1
lines changed

package.json

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,23 @@
161161
},
162162
"category": "PowerShell"
163163
},
164+
{
165+
"command": "workbench.action.debug.start",
166+
"title": "Run",
167+
"category": "PowerShell",
168+
"icon": {
169+
"light": "resources/light/run.svg",
170+
"dark": "resources/dark/run.svg"
171+
}
172+
},
164173
{
165174
"command": "PowerShell.RunSelection",
166175
"title": "Run Selection",
167-
"category": "PowerShell"
176+
"category": "PowerShell",
177+
"icon": {
178+
"light": "resources/light/play.svg",
179+
"dark": "resources/dark/play.svg"
180+
}
168181
},
169182
{
170183
"command": "PowerShell.RestartSession",
@@ -269,6 +282,18 @@
269282
"group": "2_powershell"
270283
}
271284
],
285+
"editor/title": [
286+
{
287+
"when": "resourceLangId == powershell",
288+
"command": "workbench.action.debug.start",
289+
"group": "navigation@100"
290+
},
291+
{
292+
"when": "resourceLangId == powershell",
293+
"command": "PowerShell.RunSelection",
294+
"group": "navigation@101"
295+
}
296+
],
272297
"editor/title/context": [
273298
{
274299
"when": "resourceFilename =~ /\\.tests\\.ps1$/i",

resources/dark/play.svg

Lines changed: 5 additions & 0 deletions
Loading

resources/dark/run.svg

Lines changed: 3 additions & 0 deletions
Loading

resources/light/play.svg

Lines changed: 5 additions & 0 deletions
Loading

resources/light/run.svg

Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)