Skip to content

Commit 1cafa17

Browse files
committed
Add CommandExplorerExcludeFilter to Settings class
1 parent 845b30c commit 1cafa17

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/features/GetCommands.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { RequestType0 } from "vscode-languageclient";
66
import { LanguageClient } from "vscode-languageclient/node";
77
import { Logger } from "../logging";
88
import { LanguageClientConsumer } from "../languageClientConsumer";
9+
import { getSettings } from "../settings";
910

1011
interface ICommand {
1112
name: string;
@@ -68,8 +69,8 @@ export class GetCommandsFeature extends LanguageClientConsumer {
6869
return;
6970
}
7071
await this.languageClient.sendRequest(GetCommandRequestType).then((result) => {
71-
const SidebarConfig = vscode.workspace.getConfiguration("powershell.sideBar");
72-
const excludeFilter = (SidebarConfig.CommandExplorerExcludeFilter).map((filter: string) => filter.toLowerCase());
72+
const exclusions = getSettings().sideBar.CommandExplorerExcludeFilter;
73+
const excludeFilter = exclusions.map((filter: string) => filter.toLowerCase());
7374
result = result.filter((command) => (excludeFilter.indexOf(command.moduleName.toLowerCase()) === -1));
7475
this.commandsExplorerProvider.powerShellCommands = result.map(toCommand);
7576
this.commandsExplorerProvider.refresh();

src/settings.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class DebuggingSettings extends PartialSettings {
102102
}
103103

104104
class DeveloperSettings extends PartialSettings {
105-
featureFlags = [];
105+
featureFlags: string[] = [];
106106
// From `<root>/out/main.js` we go to the directory before <root> and
107107
// then into the other repo.
108108
bundledModulesPath = "../../PowerShellEditorServices/module";
@@ -130,8 +130,8 @@ class IntegratedConsoleSettings extends PartialSettings {
130130
}
131131

132132
class SideBarSettings extends PartialSettings {
133-
// TODO: add CommandExplorerExcludeFilter
134133
CommandExplorerVisibility = true;
134+
CommandExplorerExcludeFilter: string[] = [];
135135
}
136136

137137
class PesterSettings extends PartialSettings {

0 commit comments

Comments
 (0)