From 83e001256bb66aad5baaff302c6026fab33087b0 Mon Sep 17 00:00:00 2001 From: corbob Date: Fri, 4 Jan 2019 21:17:49 -0800 Subject: [PATCH] Add Configuration to suppress initial refresh of Command Explorer --- package.json | 5 +++++ src/features/GetCommands.ts | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index cf8dfc092b..bd62299bab 100644 --- a/package.json +++ b/package.json @@ -482,6 +482,11 @@ "default":true, "description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar." }, + "powershell.sideBar.CommandExplorerInitialRefresh": { + "type":"boolean", + "default":true, + "description": "Toggle the initial refresh of the command explorer." + }, "powershell.powerShellExePath": { "type": "string", "default": "", diff --git a/src/features/GetCommands.ts b/src/features/GetCommands.ts index 0821a65a2d..9134a5185a 100644 --- a/src/features/GetCommands.ts +++ b/src/features/GetCommands.ts @@ -42,7 +42,10 @@ export class GetCommandsFeature implements IFeature { public setLanguageClient(languageclient: LanguageClient) { this.languageClient = languageclient; - vscode.commands.executeCommand("PowerShell.RefreshCommandsExplorer"); + const SideBarConfiguration = vscode.workspace.getConfiguration("powershell.sideBar"); + if (SideBarConfiguration.CommandExplorerInitialRefresh) { + vscode.commands.executeCommand("PowerShell.RefreshCommandsExplorer"); + } } private CommandExplorerRefresh() {