Function
doOnSettingsChange
(
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 |
| 389 | function 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` |
Tested by
no test coverage detected