Skip to content

Commit b0cbac3

Browse files
committed
Fixes #143635 by marking audioCues.enabled as deprecated, but also using that value if it is still set.
1 parent 32456dc commit b0cbac3

File tree

2 files changed

+23
-6
lines changed

2 files changed

+23
-6
lines changed

src/vs/workbench/contrib/audioCues/browser/audioCueService.ts

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ export class AudioCueService extends Disposable implements IAudioCueService {
6262
}
6363
}
6464

65+
private readonly obsoleteAudioCuesEnabled = observableFromEvent(
66+
Event.filter(this.configurationService.onDidChangeConfiguration, (e) =>
67+
e.affectsConfiguration('audioCues.enabled')
68+
),
69+
() => this.configurationService.getValue<'on' | 'off' | 'auto'>('audioCues.enabled')
70+
);
71+
6572
private readonly isEnabledCache = new Cache((cue: AudioCue) => {
6673
const settingObservable = observableFromEvent(
6774
Event.filter(this.configurationService.onDidChangeConfiguration, (e) =>
@@ -71,11 +78,21 @@ export class AudioCueService extends Disposable implements IAudioCueService {
7178
);
7279
return new LazyDerived(reader => {
7380
const setting = settingObservable.read(reader);
74-
if (setting === 'auto') {
75-
return this.screenReaderAttached.read(reader);
76-
} else if (setting === 'on') {
81+
if (
82+
setting === 'on' ||
83+
(setting === 'auto' && this.screenReaderAttached.read(reader))
84+
) {
85+
return true;
86+
}
87+
88+
const obsoleteSetting = this.obsoleteAudioCuesEnabled.read(reader);
89+
if (
90+
obsoleteSetting === 'on' ||
91+
(obsoleteSetting === 'auto' && this.screenReaderAttached.read(reader))
92+
) {
7793
return true;
7894
}
95+
7996
return false;
8097
}, 'audio cue enabled');
8198
});

src/vs/workbench/contrib/audioCues/browser/audioCues.contribution.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ const audioCueFeatureBase: IConfigurationPropertySchema = {
3131
],
3232
};
3333

34-
// TODO@hediet: Migrate audioCues.enabled setting!
35-
// audioCues.enabled -> audioCues.{lineHasBreakpoint, lineHasInlineCompletion, ...}
36-
3734
Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration).registerConfiguration({
3835
'properties': {
36+
'audioCues.enabled': {
37+
deprecationMessage: 'Deprecated. Use the specific setting for each audio cue instead (`audioCues.*`).',
38+
},
3939
'audioCues.lineHasBreakpoint': {
4040
'description': localize('audioCues.lineHasBreakpoint', "Plays a sound when the active line has a breakpoint."),
4141
...audioCueFeatureBase,

0 commit comments

Comments
 (0)