From d2c3d034263f10b9b6ed450c9b8c19233f26c46e Mon Sep 17 00:00:00 2001 From: "@mazikiou" <mazikiou@takima.fr> Date: Thu, 16 Jun 2022 14:56:52 +0200 Subject: [PATCH] feat: hide explorer when not in container --- deadlock-plugins/deadlock-extension/package.json | 6 +++--- deadlock-plugins/deadlock-extension/src/extension.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deadlock-plugins/deadlock-extension/package.json b/deadlock-plugins/deadlock-extension/package.json index 55c12b9f..1f5fe4fe 100644 --- a/deadlock-plugins/deadlock-extension/package.json +++ b/deadlock-plugins/deadlock-extension/package.json @@ -55,8 +55,8 @@ { "id": "deadlockPanel", "name": "Explorer", - "icon": "media/dep.svg", - "contextualTitle": "Deadlock" + "contextualTitle": "Deadlock", + "when": "deadlock.inContainer" }, { "id": "help", @@ -68,7 +68,7 @@ "name": "Commands", "icon": "media/dep.svg", "contextualTitle": "Deadlock", - "when": "deadlock.showCommands" + "when": "deadlock.inContainer" } ] }, diff --git a/deadlock-plugins/deadlock-extension/src/extension.ts b/deadlock-plugins/deadlock-extension/src/extension.ts index e9f35346..3f52e208 100644 --- a/deadlock-plugins/deadlock-extension/src/extension.ts +++ b/deadlock-plugins/deadlock-extension/src/extension.ts @@ -18,10 +18,10 @@ export async function activate(context: ExtensionContext) { const deadlockPanelProvider = new DepNodeProvider(); window.registerTreeDataProvider('deadlockPanel', deadlockPanelProvider); if (isDocker()) { - commands.executeCommand('setContext', 'deadlock.showCommands', true); + commands.executeCommand('setContext', 'deadlock.inContainer', true); window.registerTreeDataProvider('commandTree', new CommandTreeProvider(context)); } else { - commands.executeCommand('setContext', 'deadlock.showCommands', false); + commands.executeCommand('setContext', 'deadlock.inContainer', false); } try { await userConfig.init(); -- GitLab