File tree 2 files changed +23
-6
lines changed
src/vs/workbench/contrib/audioCues/browser
2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,13 @@ export class AudioCueService extends Disposable implements IAudioCueService {
62
62
}
63
63
}
64
64
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
+
65
72
private readonly isEnabledCache = new Cache ( ( cue : AudioCue ) => {
66
73
const settingObservable = observableFromEvent (
67
74
Event . filter ( this . configurationService . onDidChangeConfiguration , ( e ) =>
@@ -71,11 +78,21 @@ export class AudioCueService extends Disposable implements IAudioCueService {
71
78
) ;
72
79
return new LazyDerived ( reader => {
73
80
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
+ ) {
77
93
return true ;
78
94
}
95
+
79
96
return false ;
80
97
} , 'audio cue enabled' ) ;
81
98
} ) ;
Original file line number Diff line number Diff line change @@ -31,11 +31,11 @@ const audioCueFeatureBase: IConfigurationPropertySchema = {
31
31
] ,
32
32
} ;
33
33
34
- // TODO@hediet : Migrate audioCues.enabled setting!
35
- // audioCues.enabled -> audioCues.{lineHasBreakpoint, lineHasInlineCompletion, ...}
36
-
37
34
Registry . as < IConfigurationRegistry > ( ConfigurationExtensions . Configuration ) . registerConfiguration ( {
38
35
'properties' : {
36
+ 'audioCues.enabled' : {
37
+ deprecationMessage : 'Deprecated. Use the specific setting for each audio cue instead (`audioCues.*`).' ,
38
+ } ,
39
39
'audioCues.lineHasBreakpoint' : {
40
40
'description' : localize ( 'audioCues.lineHasBreakpoint' , "Plays a sound when the active line has a breakpoint." ) ,
41
41
...audioCueFeatureBase ,
You can’t perform that action at this time.
0 commit comments