MCPcopy
hub / github.com/PowerShell/vscode-powershell / doOnSettingsChange

Function doOnSettingsChange

src/settings.ts:389–399  ·  view source on GitHub ↗
(
    section: string,
    setting: string,
    action: (newValue: T | undefined) => void,
    scope?: vscode.ConfigurationScope,
)

Source from the content-addressed store, hash-verified

387// Because we actually do use the constraint in the callback
388// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-parameters
389function doOnSettingsChange<T>(
390 section: string,
391 setting: string,
392 action: (newValue: T | undefined) => void,
393 scope?: vscode.ConfigurationScope,
394): void {
395 const value = vscode.workspace
396 .getConfiguration(section, scope)
397 .get<T>(setting);
398 action(value);
399}
400
401/**
402 * Invokes the specified action when a PowerShell setting changes. Convenience function for `onSettingChange`

Callers 1

onSettingChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected