Skip to content

Commit 3589f92

Browse files
corbobTylerLeonhardt
authored andcommitted
Add an Exclusion filter to the Command Explorer. (#1686)
* Work with comma separated exclude filter * Add a filter... * Adjust filter. Remove case sensetivity. * Change Exclude Fitler to array.
1 parent 08f0bc5 commit 3589f92

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,11 @@
503503
"default": true,
504504
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
505505
},
506+
"powershell.sideBar.CommandExplorerExcludeFilter": {
507+
"type":"array",
508+
"default":"",
509+
"description": "Specify array of Modules to exclude from Command Explorer listing."
510+
},
506511
"powershell.powerShellExePath": {
507512
"type": "string",
508513
"default": "",

src/features/GetCommands.ts

+3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ export class GetCommandsFeature implements IFeature {
6464
return;
6565
}
6666
this.languageClient.sendRequest(GetCommandRequestType, "").then((result) => {
67+
const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar");
68+
const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter) => filter.toLowerCase());
69+
result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1));
6770
this.commandsExplorerProvider.powerShellCommands = result.map(toCommand);
6871
this.commandsExplorerProvider.refresh();
6972
});

0 commit comments

Comments
 (0)