Skip to content

Commit cc24c5a

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 ef8c85a commit cc24c5a

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
@@ -502,6 +502,11 @@
502502
"default": true,
503503
"description": "Specifies the visibility of the Command Explorer in the PowerShell Side Bar."
504504
},
505+
"powershell.sideBar.CommandExplorerExcludeFilter": {
506+
"type":"array",
507+
"default":"",
508+
"description": "Specify array of Modules to exclude from Command Explorer listing."
509+
},
505510
"powershell.powerShellExePath": {
506511
"type": "string",
507512
"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)