diff --git a/package.json b/package.json index 0238d325b9..527c57cb1b 100644 --- a/package.json +++ b/package.json @@ -185,7 +185,7 @@ "category": "PowerShell" }, { - "command": "workbench.action.debug.start", + "command": "PowerShell.Debug.Start", "title": "Run", "category": "PowerShell", "icon": { @@ -273,7 +273,7 @@ "category": "PowerShell" }, { - "command": "workbench.action.closePanel", + "command": "PowerShell.ClosePanel", "title": "Close panel", "category": "PowerShell", "icon": { @@ -282,7 +282,7 @@ } }, { - "command": "workbench.action.positionPanelLeft", + "command": "PowerShell.PositionPanelLeft", "title": "Move panel left", "category": "PowerShell", "icon": { @@ -291,7 +291,7 @@ } }, { - "command": "workbench.action.positionPanelBottom", + "command": "PowerShell.PositionPanelBottom", "title": "Move panel to bottom", "category": "PowerShell", "icon": { @@ -355,22 +355,22 @@ "editor/title": [ { "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", - "command": "workbench.action.positionPanelBottom", + "command": "PowerShell.PositionPanelBottom", "group": "navigation@97" }, { "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", - "command": "workbench.action.positionPanelLeft", + "command": "PowerShell.PositionPanelLeft", "group": "navigation@98" }, { "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", - "command": "workbench.action.closePanel", + "command": "PowerShell.ClosePanel", "group": "navigation@99" }, { "when": "editorLangId == powershell && config.powershell.buttons.showRunButtons", - "command": "workbench.action.debug.start", + "command": "PowerShell.Debug.Start", "group": "navigation@100" }, { diff --git a/src/features/ExtensionCommands.ts b/src/features/ExtensionCommands.ts index b614db8f17..0c00e72771 100644 --- a/src/features/ExtensionCommands.ts +++ b/src/features/ExtensionCommands.ts @@ -177,6 +177,11 @@ export class ExtensionCommandsFeature extends LanguageClientConsumer { private command: vscode.Disposable; private command2: vscode.Disposable; + private command3: vscode.Disposable; + private command4: vscode.Disposable; + private command5: vscode.Disposable; + private command6: vscode.Disposable; + // TODO: Make a list of commands instead. private extensionCommands: IExtensionCommand[] = []; constructor(private log: Logger) { @@ -209,6 +214,17 @@ export class ExtensionCommandsFeature extends LanguageClientConsumer { } }); + this.command3 = vscode.commands.registerCommand('PowerShell.ClosePanel', + async () => { await vscode.commands.executeCommand('workbench.action.closePanel'); }), + + this.command4 = vscode.commands.registerCommand('PowerShell.PositionPanelLeft', + async () => { await vscode.commands.executeCommand('workbench.action.positionPanelLeft'); }), + + this.command5 = vscode.commands.registerCommand('PowerShell.PositionPanelBottom', + async () => { await vscode.commands.executeCommand('workbench.action.positionPanelBottom'); }), + + this.command6 = vscode.commands.registerCommand('PowerShell.Debug.Start', + async () => { await vscode.commands.executeCommand('workbench.action.debug.start'); }) } public setLanguageClient(languageclient: LanguageClient) { @@ -281,6 +297,10 @@ export class ExtensionCommandsFeature extends LanguageClientConsumer { public dispose() { this.command.dispose(); this.command2.dispose(); + this.command3.dispose(); + this.command4.dispose(); + this.command5.dispose(); + this.command6.dispose(); } private addExtensionCommand(command: IExtensionCommandAddedNotificationBody) {