Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.ts
5220 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { localize } from '../../../../nls.js';
7
import { ConfigurationScope, Extensions, IConfigurationNode, IConfigurationPropertySchema, IConfigurationRegistry } from '../../../../platform/configuration/common/configurationRegistry.js';
8
import { Registry } from '../../../../platform/registry/common/platform.js';
9
import { RawContextKey } from '../../../../platform/contextkey/common/contextkey.js';
10
import { workbenchConfigurationNodeBase, Extensions as WorkbenchExtensions, IConfigurationMigrationRegistry, ConfigurationKeyValuePairs, ConfigurationMigration } from '../../../common/configuration.js';
11
import { AccessibilitySignal } from '../../../../platform/accessibilitySignal/browser/accessibilitySignalService.js';
12
import { AccessibilityVoiceSettingId, ISpeechService, SPEECH_LANGUAGES } from '../../speech/common/speechService.js';
13
import { Disposable } from '../../../../base/common/lifecycle.js';
14
import { IWorkbenchContribution } from '../../../common/contributions.js';
15
import { Event } from '../../../../base/common/event.js';
16
import { isDefined } from '../../../../base/common/types.js';
17
18
export const accessibilityHelpIsShown = new RawContextKey<boolean>('accessibilityHelpIsShown', false, true);
19
export const accessibleViewIsShown = new RawContextKey<boolean>('accessibleViewIsShown', false, true);
20
export const accessibleViewSupportsNavigation = new RawContextKey<boolean>('accessibleViewSupportsNavigation', false, true);
21
export const accessibleViewVerbosityEnabled = new RawContextKey<boolean>('accessibleViewVerbosityEnabled', false, true);
22
export const accessibleViewGoToSymbolSupported = new RawContextKey<boolean>('accessibleViewGoToSymbolSupported', false, true);
23
export const accessibleViewOnLastLine = new RawContextKey<boolean>('accessibleViewOnLastLine', false, true);
24
export const accessibleViewCurrentProviderId = new RawContextKey<string>('accessibleViewCurrentProviderId', undefined, undefined);
25
export const accessibleViewInCodeBlock = new RawContextKey<boolean>('accessibleViewInCodeBlock', undefined, undefined);
26
export const accessibleViewContainsCodeBlocks = new RawContextKey<boolean>('accessibleViewContainsCodeBlocks', undefined, undefined);
27
export const accessibleViewHasUnassignedKeybindings = new RawContextKey<boolean>('accessibleViewHasUnassignedKeybindings', undefined, undefined);
28
export const accessibleViewHasAssignedKeybindings = new RawContextKey<boolean>('accessibleViewHasAssignedKeybindings', undefined, undefined);
29
30
/**
31
* Miscellaneous settings tagged with accessibility and implemented in the accessibility contrib but
32
* were better to live under workbench for discoverability.
33
*/
34
export const enum AccessibilityWorkbenchSettingId {
35
DimUnfocusedEnabled = 'accessibility.dimUnfocused.enabled',
36
DimUnfocusedOpacity = 'accessibility.dimUnfocused.opacity',
37
HideAccessibleView = 'accessibility.hideAccessibleView',
38
AccessibleViewCloseOnKeyPress = 'accessibility.accessibleView.closeOnKeyPress',
39
VerboseChatProgressUpdates = 'accessibility.verboseChatProgressUpdates'
40
}
41
42
export const enum ViewDimUnfocusedOpacityProperties {
43
Default = 0.75,
44
Minimum = 0.2,
45
Maximum = 1
46
}
47
48
export const enum AccessibilityVerbositySettingId {
49
Terminal = 'accessibility.verbosity.terminal',
50
DiffEditor = 'accessibility.verbosity.diffEditor',
51
MergeEditor = 'accessibility.verbosity.mergeEditor',
52
Chat = 'accessibility.verbosity.panelChat',
53
InlineChat = 'accessibility.verbosity.inlineChat',
54
TerminalInlineChat = 'accessibility.verbosity.terminalChat',
55
TerminalChatOutput = 'accessibility.verbosity.terminalChatOutput',
56
InlineCompletions = 'accessibility.verbosity.inlineCompletions',
57
KeybindingsEditor = 'accessibility.verbosity.keybindingsEditor',
58
Notebook = 'accessibility.verbosity.notebook',
59
Editor = 'accessibility.verbosity.editor',
60
Hover = 'accessibility.verbosity.hover',
61
Notification = 'accessibility.verbosity.notification',
62
EmptyEditorHint = 'accessibility.verbosity.emptyEditorHint',
63
ReplEditor = 'accessibility.verbosity.replEditor',
64
Comments = 'accessibility.verbosity.comments',
65
DiffEditorActive = 'accessibility.verbosity.diffEditorActive',
66
Debug = 'accessibility.verbosity.debug',
67
Walkthrough = 'accessibility.verbosity.walkthrough',
68
SourceControl = 'accessibility.verbosity.sourceControl',
69
Find = 'accessibility.verbosity.find'
70
}
71
72
const baseVerbosityProperty: IConfigurationPropertySchema = {
73
type: 'boolean',
74
default: true,
75
tags: ['accessibility']
76
};
77
78
export const accessibilityConfigurationNodeBase = Object.freeze<IConfigurationNode>({
79
id: 'accessibility',
80
title: localize('accessibilityConfigurationTitle', "Accessibility"),
81
type: 'object'
82
});
83
84
export const soundFeatureBase: IConfigurationPropertySchema = {
85
'type': 'string',
86
'enum': ['auto', 'on', 'off'],
87
'default': 'auto',
88
'enumDescriptions': [
89
localize('sound.enabled.auto', "Enable sound when a screen reader is attached."),
90
localize('sound.enabled.on', "Enable sound."),
91
localize('sound.enabled.off', "Disable sound.")
92
],
93
tags: ['accessibility'],
94
};
95
96
const signalFeatureBase: IConfigurationPropertySchema = {
97
'type': 'object',
98
'tags': ['accessibility'],
99
additionalProperties: false,
100
default: {
101
sound: 'auto',
102
announcement: 'auto'
103
}
104
};
105
106
export const announcementFeatureBase: IConfigurationPropertySchema = {
107
'type': 'string',
108
'enum': ['auto', 'off'],
109
'default': 'auto',
110
'enumDescriptions': [
111
localize('announcement.enabled.auto', "Enable announcement, will only play when in screen reader optimized mode."),
112
localize('announcement.enabled.off', "Disable announcement.")
113
],
114
tags: ['accessibility'],
115
};
116
117
const defaultNoAnnouncement: IConfigurationPropertySchema = {
118
'type': 'object',
119
'tags': ['accessibility'],
120
additionalProperties: false,
121
'default': {
122
'sound': 'auto',
123
}
124
};
125
126
const configuration: IConfigurationNode = {
127
...accessibilityConfigurationNodeBase,
128
scope: ConfigurationScope.RESOURCE,
129
properties: {
130
[AccessibilityVerbositySettingId.Terminal]: {
131
description: localize('verbosity.terminal.description', 'Provide information about how to access the terminal accessibility help menu when the terminal is focused.'),
132
...baseVerbosityProperty
133
},
134
[AccessibilityVerbositySettingId.DiffEditor]: {
135
description: localize('verbosity.diffEditor.description', 'Provide information about how to navigate changes in the diff editor when it is focused.'),
136
...baseVerbosityProperty
137
},
138
[AccessibilityVerbositySettingId.Chat]: {
139
description: localize('verbosity.chat.description', 'Provide information about how to access the chat help menu when the chat input is focused.'),
140
...baseVerbosityProperty
141
},
142
[AccessibilityVerbositySettingId.InlineChat]: {
143
description: localize('verbosity.interactiveEditor.description', 'Provide information about how to access the inline editor chat accessibility help menu and alert with hints that describe how to use the feature when the input is focused.'),
144
...baseVerbosityProperty
145
},
146
[AccessibilityVerbositySettingId.TerminalChatOutput]: {
147
description: localize('verbosity.terminalChatOutput.description', 'Provide information about how to open the chat terminal output in the Accessible View.'),
148
...baseVerbosityProperty
149
},
150
[AccessibilityVerbositySettingId.InlineCompletions]: {
151
description: localize('verbosity.inlineCompletions.description', 'Provide information about how to access the inline completions hover and Accessible View.'),
152
...baseVerbosityProperty
153
},
154
[AccessibilityVerbositySettingId.KeybindingsEditor]: {
155
description: localize('verbosity.keybindingsEditor.description', 'Provide information about how to change a keybinding in the keybindings editor when a row is focused.'),
156
...baseVerbosityProperty
157
},
158
[AccessibilityVerbositySettingId.Notebook]: {
159
description: localize('verbosity.notebook', 'Provide information about how to focus the cell container or inner editor when a notebook cell is focused.'),
160
...baseVerbosityProperty
161
},
162
[AccessibilityVerbositySettingId.Hover]: {
163
description: localize('verbosity.hover', 'Provide information about how to open the hover in an Accessible View.'),
164
...baseVerbosityProperty
165
},
166
[AccessibilityVerbositySettingId.Notification]: {
167
description: localize('verbosity.notification', 'Provide information about how to open the notification in an Accessible View.'),
168
...baseVerbosityProperty
169
},
170
[AccessibilityVerbositySettingId.EmptyEditorHint]: {
171
description: localize('verbosity.emptyEditorHint', 'Provide information about relevant actions in an empty text editor.'),
172
...baseVerbosityProperty
173
},
174
[AccessibilityVerbositySettingId.ReplEditor]: {
175
description: localize('verbosity.replEditor.description', 'Provide information about how to access the REPL editor accessibility help menu when the REPL editor is focused.'),
176
...baseVerbosityProperty
177
},
178
[AccessibilityVerbositySettingId.Comments]: {
179
description: localize('verbosity.comments', 'Provide information about actions that can be taken in the comment widget or in a file which contains comments.'),
180
...baseVerbosityProperty
181
},
182
[AccessibilityVerbositySettingId.DiffEditorActive]: {
183
description: localize('verbosity.diffEditorActive', 'Indicate when a diff editor becomes the active editor.'),
184
...baseVerbosityProperty
185
},
186
[AccessibilityVerbositySettingId.Debug]: {
187
description: localize('verbosity.debug', 'Provide information about how to access the debug console accessibility help dialog when the debug console or run and debug viewlet is focused. Note that a reload of the window is required for this to take effect.'),
188
...baseVerbosityProperty
189
},
190
[AccessibilityVerbositySettingId.Walkthrough]: {
191
description: localize('verbosity.walkthrough', 'Provide information about how to open the walkthrough in an Accessible View.'),
192
...baseVerbosityProperty
193
},
194
[AccessibilityWorkbenchSettingId.AccessibleViewCloseOnKeyPress]: {
195
markdownDescription: localize('terminal.integrated.accessibleView.closeOnKeyPress', "On keypress, close the Accessible View and focus the element from which it was invoked."),
196
type: 'boolean',
197
default: true
198
},
199
[AccessibilityVerbositySettingId.SourceControl]: {
200
description: localize('verbosity.scm', 'Provide information about how to access the source control accessibility help menu when the input is focused.'),
201
...baseVerbosityProperty
202
},
203
[AccessibilityVerbositySettingId.Find]: {
204
description: localize('verbosity.find', 'Provide information about how to access the find accessibility help menu when the find input is focused.'),
205
...baseVerbosityProperty
206
},
207
'accessibility.signalOptions.volume': {
208
'description': localize('accessibility.signalOptions.volume', "The volume of the sounds in percent (0-100)."),
209
'type': 'number',
210
'minimum': 0,
211
'maximum': 100,
212
'default': 70,
213
'tags': ['accessibility']
214
},
215
'accessibility.signalOptions.debouncePositionChanges': {
216
'description': localize('accessibility.signalOptions.debouncePositionChanges', "Whether or not position changes should be debounced"),
217
'type': 'boolean',
218
'default': false,
219
'tags': ['accessibility']
220
},
221
'accessibility.signalOptions.experimental.delays.general': {
222
'type': 'object',
223
'description': 'Delays for all signals besides error and warning at position',
224
'additionalProperties': false,
225
'properties': {
226
'announcement': {
227
'description': localize('accessibility.signalOptions.delays.general.announcement', "The delay in milliseconds before an announcement is made."),
228
'type': 'number',
229
'minimum': 0,
230
'default': 3000
231
},
232
'sound': {
233
'description': localize('accessibility.signalOptions.delays.general.sound', "The delay in milliseconds before a sound is played."),
234
'type': 'number',
235
'minimum': 0,
236
'default': 400
237
}
238
},
239
'tags': ['accessibility']
240
},
241
'accessibility.signalOptions.experimental.delays.warningAtPosition': {
242
'type': 'object',
243
'additionalProperties': false,
244
'properties': {
245
'announcement': {
246
'description': localize('accessibility.signalOptions.delays.warningAtPosition.announcement', "The delay in milliseconds before an announcement is made when there's a warning at the position."),
247
'type': 'number',
248
'minimum': 0,
249
'default': 3000
250
},
251
'sound': {
252
'description': localize('accessibility.signalOptions.delays.warningAtPosition.sound', "The delay in milliseconds before a sound is played when there's a warning at the position."),
253
'type': 'number',
254
'minimum': 0,
255
'default': 1000
256
}
257
},
258
'tags': ['accessibility']
259
},
260
'accessibility.signalOptions.experimental.delays.errorAtPosition': {
261
'type': 'object',
262
'additionalProperties': false,
263
'properties': {
264
'announcement': {
265
'description': localize('accessibility.signalOptions.delays.errorAtPosition.announcement', "The delay in milliseconds before an announcement is made when there's an error at the position."),
266
'type': 'number',
267
'minimum': 0,
268
'default': 3000
269
},
270
'sound': {
271
'description': localize('accessibility.signalOptions.delays.errorAtPosition.sound', "The delay in milliseconds before a sound is played when there's an error at the position."),
272
'type': 'number',
273
'minimum': 0,
274
'default': 1000
275
}
276
},
277
'tags': ['accessibility']
278
},
279
'accessibility.signals.lineHasBreakpoint': {
280
...signalFeatureBase,
281
'description': localize('accessibility.signals.lineHasBreakpoint', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a breakpoint."),
282
'properties': {
283
'sound': {
284
'description': localize('accessibility.signals.lineHasBreakpoint.sound', "Plays a sound when the active line has a breakpoint."),
285
...soundFeatureBase
286
},
287
'announcement': {
288
'description': localize('accessibility.signals.lineHasBreakpoint.announcement', "Announces when the active line has a breakpoint."),
289
...announcementFeatureBase
290
},
291
},
292
},
293
'accessibility.signals.lineHasInlineSuggestion': {
294
...defaultNoAnnouncement,
295
'description': localize('accessibility.signals.lineHasInlineSuggestion', "Plays a sound / audio cue when the active line has an inline suggestion."),
296
'properties': {
297
'sound': {
298
'description': localize('accessibility.signals.lineHasInlineSuggestion.sound', "Plays a sound when the active line has an inline suggestion."),
299
...soundFeatureBase,
300
'default': 'off'
301
}
302
}
303
},
304
'accessibility.signals.nextEditSuggestion': {
305
...signalFeatureBase,
306
'description': localize('accessibility.signals.nextEditSuggestion', "Plays a signal - sound / audio cue and/or announcement (alert) when there is a next edit suggestion."),
307
'properties': {
308
'sound': {
309
'description': localize('accessibility.signals.nextEditSuggestion.sound', "Plays a sound when there is a next edit suggestion."),
310
...soundFeatureBase,
311
},
312
'announcement': {
313
'description': localize('accessibility.signals.nextEditSuggestion.announcement', "Announces when there is a next edit suggestion."),
314
...announcementFeatureBase,
315
},
316
}
317
},
318
'accessibility.signals.lineHasError': {
319
...signalFeatureBase,
320
'description': localize('accessibility.signals.lineHasError', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has an error."),
321
'properties': {
322
'sound': {
323
'description': localize('accessibility.signals.lineHasError.sound', "Plays a sound when the active line has an error."),
324
...soundFeatureBase
325
},
326
'announcement': {
327
'description': localize('accessibility.signals.lineHasError.announcement', "Announces when the active line has an error."),
328
...announcementFeatureBase,
329
default: 'off'
330
},
331
},
332
},
333
'accessibility.signals.lineHasFoldedArea': {
334
...signalFeatureBase,
335
'description': localize('accessibility.signals.lineHasFoldedArea', "Plays a signal - sound (audio cue) and/or announcement (alert) - the active line has a folded area that can be unfolded."),
336
'properties': {
337
'sound': {
338
'description': localize('accessibility.signals.lineHasFoldedArea.sound', "Plays a sound when the active line has a folded area that can be unfolded."),
339
...soundFeatureBase,
340
default: 'off'
341
},
342
'announcement': {
343
'description': localize('accessibility.signals.lineHasFoldedArea.announcement', "Announces when the active line has a folded area that can be unfolded."),
344
...announcementFeatureBase
345
},
346
}
347
},
348
'accessibility.signals.lineHasWarning': {
349
...signalFeatureBase,
350
'description': localize('accessibility.signals.lineHasWarning', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),
351
'properties': {
352
'sound': {
353
'description': localize('accessibility.signals.lineHasWarning.sound', "Plays a sound when the active line has a warning."),
354
...soundFeatureBase
355
},
356
'announcement': {
357
'description': localize('accessibility.signals.lineHasWarning.announcement', "Announces when the active line has a warning."),
358
...announcementFeatureBase,
359
default: 'off'
360
},
361
},
362
},
363
'accessibility.signals.positionHasError': {
364
...signalFeatureBase,
365
'description': localize('accessibility.signals.positionHasError', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),
366
'properties': {
367
'sound': {
368
'description': localize('accessibility.signals.positionHasError.sound', "Plays a sound when the active line has a warning."),
369
...soundFeatureBase
370
},
371
'announcement': {
372
'description': localize('accessibility.signals.positionHasError.announcement', "Announces when the active line has a warning."),
373
...announcementFeatureBase,
374
default: 'on'
375
},
376
},
377
},
378
'accessibility.signals.positionHasWarning': {
379
...signalFeatureBase,
380
'description': localize('accessibility.signals.positionHasWarning', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the active line has a warning."),
381
'properties': {
382
'sound': {
383
'description': localize('accessibility.signals.positionHasWarning.sound', "Plays a sound when the active line has a warning."),
384
...soundFeatureBase
385
},
386
'announcement': {
387
'description': localize('accessibility.signals.positionHasWarning.announcement', "Announces when the active line has a warning."),
388
...announcementFeatureBase,
389
default: 'on'
390
},
391
},
392
},
393
'accessibility.signals.onDebugBreak': {
394
...signalFeatureBase,
395
'description': localize('accessibility.signals.onDebugBreak', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the debugger stopped on a breakpoint."),
396
'properties': {
397
'sound': {
398
'description': localize('accessibility.signals.onDebugBreak.sound', "Plays a sound when the debugger stopped on a breakpoint."),
399
...soundFeatureBase
400
},
401
'announcement': {
402
'description': localize('accessibility.signals.onDebugBreak.announcement', "Announces when the debugger stopped on a breakpoint."),
403
...announcementFeatureBase
404
},
405
}
406
},
407
'accessibility.signals.noInlayHints': {
408
...signalFeatureBase,
409
'description': localize('accessibility.signals.noInlayHints', "Plays a signal - sound (audio cue) and/or announcement (alert) - when trying to read a line with inlay hints that has no inlay hints."),
410
'properties': {
411
'sound': {
412
'description': localize('accessibility.signals.noInlayHints.sound', "Plays a sound when trying to read a line with inlay hints that has no inlay hints."),
413
...soundFeatureBase
414
},
415
'announcement': {
416
'description': localize('accessibility.signals.noInlayHints.announcement', "Announces when trying to read a line with inlay hints that has no inlay hints."),
417
...announcementFeatureBase
418
},
419
}
420
},
421
'accessibility.signals.taskCompleted': {
422
...signalFeatureBase,
423
'description': localize('accessibility.signals.taskCompleted', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a task is completed."),
424
'properties': {
425
'sound': {
426
'description': localize('accessibility.signals.taskCompleted.sound', "Plays a sound when a task is completed."),
427
...soundFeatureBase
428
},
429
'announcement': {
430
'description': localize('accessibility.signals.taskCompleted.announcement', "Announces when a task is completed."),
431
...announcementFeatureBase
432
},
433
}
434
},
435
'accessibility.signals.taskFailed': {
436
...signalFeatureBase,
437
'description': localize('accessibility.signals.taskFailed', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a task fails (non-zero exit code)."),
438
'properties': {
439
'sound': {
440
'description': localize('accessibility.signals.taskFailed.sound', "Plays a sound when a task fails (non-zero exit code)."),
441
...soundFeatureBase
442
},
443
'announcement': {
444
'description': localize('accessibility.signals.taskFailed.announcement', "Announces when a task fails (non-zero exit code)."),
445
...announcementFeatureBase
446
},
447
}
448
},
449
'accessibility.signals.terminalCommandFailed': {
450
...signalFeatureBase,
451
'description': localize('accessibility.signals.terminalCommandFailed', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
452
'properties': {
453
'sound': {
454
'description': localize('accessibility.signals.terminalCommandFailed.sound', "Plays a sound when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
455
...soundFeatureBase
456
},
457
'announcement': {
458
'description': localize('accessibility.signals.terminalCommandFailed.announcement', "Announces when a terminal command fails (non-zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
459
...announcementFeatureBase
460
},
461
}
462
},
463
'accessibility.signals.terminalCommandSucceeded': {
464
...signalFeatureBase,
465
'description': localize('accessibility.signals.terminalCommandSucceeded', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
466
'properties': {
467
'sound': {
468
'description': localize('accessibility.signals.terminalCommandSucceeded.sound', "Plays a sound when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
469
...soundFeatureBase
470
},
471
'announcement': {
472
'description': localize('accessibility.signals.terminalCommandSucceeded.announcement', "Announces when a terminal command succeeds (zero exit code) or when a command with such an exit code is navigated to in the accessible view."),
473
...announcementFeatureBase
474
},
475
}
476
},
477
'accessibility.signals.terminalQuickFix': {
478
...signalFeatureBase,
479
'description': localize('accessibility.signals.terminalQuickFix', "Plays a signal - sound (audio cue) and/or announcement (alert) - when terminal Quick Fixes are available."),
480
'properties': {
481
'sound': {
482
'description': localize('accessibility.signals.terminalQuickFix.sound', "Plays a sound when terminal Quick Fixes are available."),
483
...soundFeatureBase
484
},
485
'announcement': {
486
'description': localize('accessibility.signals.terminalQuickFix.announcement', "Announces when terminal Quick Fixes are available."),
487
...announcementFeatureBase
488
},
489
}
490
},
491
'accessibility.signals.terminalBell': {
492
...signalFeatureBase,
493
'description': localize('accessibility.signals.terminalBell', "Plays a signal - sound (audio cue) and/or announcement (alert) - when the terminal bell is ringing."),
494
'properties': {
495
'sound': {
496
'description': localize('accessibility.signals.terminalBell.sound', "Plays a sound when the terminal bell is ringing."),
497
...soundFeatureBase
498
},
499
'announcement': {
500
'description': localize('accessibility.signals.terminalBell.announcement', "Announces when the terminal bell is ringing."),
501
...announcementFeatureBase
502
},
503
}
504
},
505
'accessibility.signals.diffLineInserted': {
506
...defaultNoAnnouncement,
507
'description': localize('accessibility.signals.diffLineInserted', "Plays a sound / audio cue when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),
508
'properties': {
509
'sound': {
510
'description': localize('accessibility.signals.sound', "Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."),
511
...soundFeatureBase
512
}
513
}
514
},
515
'accessibility.signals.diffLineModified': {
516
...defaultNoAnnouncement,
517
'description': localize('accessibility.signals.diffLineModified', "Plays a sound / audio cue when the focus moves to an modified line in Accessible Diff Viewer mode or to the next/previous change."),
518
'properties': {
519
'sound': {
520
'description': localize('accessibility.signals.diffLineModified.sound', "Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."),
521
...soundFeatureBase
522
}
523
}
524
},
525
'accessibility.signals.diffLineDeleted': {
526
...defaultNoAnnouncement,
527
'description': localize('accessibility.signals.diffLineDeleted', "Plays a sound / audio cue when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),
528
'properties': {
529
'sound': {
530
'description': localize('accessibility.signals.diffLineDeleted.sound', "Plays a sound when the focus moves to an deleted line in Accessible Diff Viewer mode or to the next/previous change."),
531
...soundFeatureBase
532
}
533
}
534
},
535
'accessibility.signals.chatEditModifiedFile': {
536
...defaultNoAnnouncement,
537
'description': localize('accessibility.signals.chatEditModifiedFile', "Plays a sound / audio cue when revealing a file with changes from chat edits"),
538
'properties': {
539
'sound': {
540
'description': localize('accessibility.signals.chatEditModifiedFile.sound', "Plays a sound when revealing a file with changes from chat edits"),
541
...soundFeatureBase
542
}
543
}
544
},
545
'accessibility.signals.notebookCellCompleted': {
546
...signalFeatureBase,
547
'description': localize('accessibility.signals.notebookCellCompleted', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution is successfully completed."),
548
'properties': {
549
'sound': {
550
'description': localize('accessibility.signals.notebookCellCompleted.sound', "Plays a sound when a notebook cell execution is successfully completed."),
551
...soundFeatureBase
552
},
553
'announcement': {
554
'description': localize('accessibility.signals.notebookCellCompleted.announcement', "Announces when a notebook cell execution is successfully completed."),
555
...announcementFeatureBase
556
},
557
}
558
},
559
'accessibility.signals.notebookCellFailed': {
560
...signalFeatureBase,
561
'description': localize('accessibility.signals.notebookCellFailed', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a notebook cell execution fails."),
562
'properties': {
563
'sound': {
564
'description': localize('accessibility.signals.notebookCellFailed.sound', "Plays a sound when a notebook cell execution fails."),
565
...soundFeatureBase
566
},
567
'announcement': {
568
'description': localize('accessibility.signals.notebookCellFailed.announcement', "Announces when a notebook cell execution fails."),
569
...announcementFeatureBase
570
},
571
}
572
},
573
'accessibility.signals.progress': {
574
...signalFeatureBase,
575
'description': localize('accessibility.signals.progress', "Plays a signal - sound (audio cue) and/or announcement (alert) - on loop while progress is occurring."),
576
'default': {
577
'sound': 'auto',
578
'announcement': 'off'
579
},
580
'properties': {
581
'sound': {
582
'description': localize('accessibility.signals.progress.sound', "Plays a sound on loop while progress is occurring."),
583
...soundFeatureBase
584
},
585
'announcement': {
586
'description': localize('accessibility.signals.progress.announcement', "Alerts on loop while progress is occurring."),
587
...announcementFeatureBase
588
},
589
},
590
},
591
'accessibility.signals.chatRequestSent': {
592
...signalFeatureBase,
593
'description': localize('accessibility.signals.chatRequestSent', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a chat request is made."),
594
'properties': {
595
'sound': {
596
'description': localize('accessibility.signals.chatRequestSent.sound', "Plays a sound when a chat request is made."),
597
...soundFeatureBase
598
},
599
'announcement': {
600
'description': localize('accessibility.signals.chatRequestSent.announcement', "Announces when a chat request is made."),
601
...announcementFeatureBase
602
},
603
}
604
},
605
'accessibility.signals.chatResponseReceived': {
606
...defaultNoAnnouncement,
607
'description': localize('accessibility.signals.chatResponseReceived', "Plays a sound / audio cue when the response has been received."),
608
'properties': {
609
'sound': {
610
'description': localize('accessibility.signals.chatResponseReceived.sound', "Plays a sound on when the response has been received."),
611
...soundFeatureBase
612
},
613
}
614
},
615
'accessibility.signals.codeActionTriggered': {
616
...defaultNoAnnouncement,
617
'description': localize('accessibility.signals.codeActionTriggered', "Plays a sound / audio cue - when a code action has been triggered."),
618
'properties': {
619
'sound': {
620
'description': localize('accessibility.signals.codeActionTriggered.sound', "Plays a sound when a code action has been triggered."),
621
...soundFeatureBase
622
}
623
}
624
},
625
'accessibility.signals.codeActionApplied': {
626
...defaultNoAnnouncement,
627
'description': localize('accessibility.signals.codeActionApplied', "Plays a sound / audio cue when the code action has been applied."),
628
'properties': {
629
'sound': {
630
'description': localize('accessibility.signals.codeActionApplied.sound', "Plays a sound when the code action has been applied."),
631
...soundFeatureBase
632
},
633
}
634
},
635
'accessibility.signals.voiceRecordingStarted': {
636
...defaultNoAnnouncement,
637
'description': localize('accessibility.signals.voiceRecordingStarted', "Plays a sound / audio cue when the voice recording has started."),
638
'properties': {
639
'sound': {
640
'description': localize('accessibility.signals.voiceRecordingStarted.sound', "Plays a sound when the voice recording has started."),
641
...soundFeatureBase,
642
},
643
},
644
'default': {
645
'sound': 'on'
646
}
647
},
648
'accessibility.signals.voiceRecordingStopped': {
649
...defaultNoAnnouncement,
650
'description': localize('accessibility.signals.voiceRecordingStopped', "Plays a sound / audio cue when the voice recording has stopped."),
651
'properties': {
652
'sound': {
653
'description': localize('accessibility.signals.voiceRecordingStopped.sound', "Plays a sound when the voice recording has stopped."),
654
...soundFeatureBase,
655
default: 'off'
656
},
657
}
658
},
659
'accessibility.signals.clear': {
660
...signalFeatureBase,
661
'description': localize('accessibility.signals.clear', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a feature is cleared (for example, the terminal, Debug Console, or Output channel)."),
662
'properties': {
663
'sound': {
664
'description': localize('accessibility.signals.clear.sound', "Plays a sound when a feature is cleared."),
665
...soundFeatureBase
666
},
667
'announcement': {
668
'description': localize('accessibility.signals.clear.announcement', "Announces when a feature is cleared."),
669
...announcementFeatureBase
670
},
671
},
672
},
673
'accessibility.signals.editsUndone': {
674
...signalFeatureBase,
675
'description': localize('accessibility.signals.editsUndone', "Plays a signal - sound (audio cue) and/or announcement (alert) - when edits have been undone."),
676
'properties': {
677
'sound': {
678
'description': localize('accessibility.signals.editsUndone.sound', "Plays a sound when edits have been undone."),
679
...soundFeatureBase
680
},
681
'announcement': {
682
'description': localize('accessibility.signals.editsUndone.announcement', "Announces when edits have been undone."),
683
...announcementFeatureBase
684
},
685
},
686
},
687
'accessibility.signals.editsKept': {
688
...signalFeatureBase,
689
'description': localize('accessibility.signals.editsKept', "Plays a signal - sound (audio cue) and/or announcement (alert) - when edits are kept."),
690
'properties': {
691
'sound': {
692
'description': localize('accessibility.signals.editsKept.sound', "Plays a sound when edits are kept."),
693
...soundFeatureBase
694
},
695
'announcement': {
696
'description': localize('accessibility.signals.editsKept.announcement', "Announces when edits are kept."),
697
...announcementFeatureBase
698
},
699
},
700
},
701
'accessibility.signals.save': {
702
'type': 'object',
703
'tags': ['accessibility'],
704
additionalProperties: false,
705
'markdownDescription': localize('accessibility.signals.save', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a file is saved."),
706
'properties': {
707
'sound': {
708
'description': localize('accessibility.signals.save.sound', "Plays a sound when a file is saved."),
709
'type': 'string',
710
'enum': ['userGesture', 'always', 'never'],
711
'default': 'never',
712
'enumDescriptions': [
713
localize('accessibility.signals.save.sound.userGesture', "Plays the sound when a user explicitly saves a file."),
714
localize('accessibility.signals.save.sound.always', "Plays the sound whenever a file is saved, including auto save."),
715
localize('accessibility.signals.save.sound.never', "Never plays the sound.")
716
],
717
},
718
'announcement': {
719
'description': localize('accessibility.signals.save.announcement', "Announces when a file is saved."),
720
'type': 'string',
721
'enum': ['userGesture', 'always', 'never'],
722
'default': 'never',
723
'enumDescriptions': [
724
localize('accessibility.signals.save.announcement.userGesture', "Announces when a user explicitly saves a file."),
725
localize('accessibility.signals.save.announcement.always', "Announces whenever a file is saved, including auto save."),
726
localize('accessibility.signals.save.announcement.never', "Never plays the announcement.")
727
],
728
},
729
},
730
default: {
731
'sound': 'never',
732
'announcement': 'never'
733
}
734
},
735
'accessibility.signals.format': {
736
'type': 'object',
737
'tags': ['accessibility'],
738
additionalProperties: false,
739
'markdownDescription': localize('accessibility.signals.format', "Plays a signal - sound (audio cue) and/or announcement (alert) - when a file or notebook is formatted."),
740
'properties': {
741
'sound': {
742
'description': localize('accessibility.signals.format.sound', "Plays a sound when a file or notebook is formatted."),
743
'type': 'string',
744
'enum': ['userGesture', 'always', 'never'],
745
'default': 'never',
746
'enumDescriptions': [
747
localize('accessibility.signals.format.userGesture', "Plays the sound when a user explicitly formats a file."),
748
localize('accessibility.signals.format.always', "Plays the sound whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),
749
localize('accessibility.signals.format.never', "Never plays the sound.")
750
],
751
},
752
'announcement': {
753
'description': localize('accessibility.signals.format.announcement', "Announces when a file or notebook is formatted."),
754
'type': 'string',
755
'enum': ['userGesture', 'always', 'never'],
756
'default': 'never',
757
'enumDescriptions': [
758
localize('accessibility.signals.format.announcement.userGesture', "Announces when a user explicitly formats a file."),
759
localize('accessibility.signals.format.announcement.always', "Announces whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."),
760
localize('accessibility.signals.format.announcement.never', "Never announces.")
761
],
762
},
763
},
764
default: {
765
'sound': 'never',
766
'announcement': 'never'
767
}
768
},
769
'accessibility.signals.chatUserActionRequired': {
770
...signalFeatureBase,
771
'markdownDescription': localize('accessibility.signals.chatUserActionRequired', "Plays a signal - sound (audio cue) and/or announcement (alert) - when user action is required in the chat."),
772
'properties': {
773
'sound': {
774
'description': localize('accessibility.signals.chatUserActionRequired.sound', "Plays a sound when user action is required in the chat."),
775
'type': 'string',
776
'enum': ['auto', 'on', 'off'],
777
'enumDescriptions': [
778
localize('sound.enabled.autoWindow', "Enable sound when a screen reader is attached."),
779
localize('sound.enabled.on', "Enable sound."),
780
localize('sound.enabled.off', "Disable sound.")
781
],
782
},
783
'announcement': {
784
'description': localize('accessibility.signals.chatUserActionRequired.announcement', "Announces when a user action is required in the chat - including information about the action and how to take it."),
785
...announcementFeatureBase
786
},
787
},
788
default: {
789
'sound': 'auto',
790
'announcement': 'auto'
791
},
792
tags: ['accessibility']
793
},
794
'accessibility.underlineLinks': {
795
'type': 'boolean',
796
'description': localize('accessibility.underlineLinks', "Controls whether links should be underlined in the workbench."),
797
'default': false,
798
},
799
'accessibility.debugWatchVariableAnnouncements': {
800
'type': 'boolean',
801
'description': localize('accessibility.debugWatchVariableAnnouncements', "Controls whether variable changes should be announced in the debug watch view."),
802
'default': true,
803
},
804
'accessibility.replEditor.readLastExecutionOutput': {
805
'type': 'boolean',
806
'description': localize('accessibility.replEditor.readLastExecutedOutput', "Controls whether the output from an execution in the native REPL will be announced."),
807
'default': true,
808
},
809
'accessibility.replEditor.autoFocusReplExecution': {
810
type: 'string',
811
enum: ['none', 'input', 'lastExecution'],
812
default: 'input',
813
description: localize('replEditor.autoFocusAppendedCell', "Control whether focus should automatically be sent to the REPL when code is executed."),
814
},
815
'accessibility.windowTitleOptimized': {
816
'type': 'boolean',
817
'default': true,
818
'markdownDescription': localize('accessibility.windowTitleOptimized', "Controls whether the {0} should be optimized for screen readers when in screen reader mode. When enabled, the window title will have {1} appended to the end.", '`#window.title#`', '`activeEditorState`')
819
},
820
'accessibility.openChatEditedFiles': {
821
'type': 'boolean',
822
'default': false,
823
'markdownDescription': localize('accessibility.openChatEditedFiles', "Controls whether files should be opened when the chat agent has applied edits to them.")
824
},
825
'accessibility.verboseChatProgressUpdates': {
826
'type': 'boolean',
827
'default': true,
828
'markdownDescription': localize('accessibility.verboseChatProgressUpdates', "Controls whether verbose progress announcements should be made when a chat request is in progress, including information like searched text for <search term> with X results, created file <file_name>, or read file <file path>.")
829
}
830
}
831
};
832
833
export function registerAccessibilityConfiguration() {
834
const registry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
835
registry.registerConfiguration(configuration);
836
837
registry.registerConfiguration({
838
...workbenchConfigurationNodeBase,
839
properties: {
840
[AccessibilityWorkbenchSettingId.DimUnfocusedEnabled]: {
841
description: localize('dimUnfocusedEnabled', 'Whether to dim unfocused editors and terminals, which makes it more clear where typed input will go to. This works with the majority of editors with the notable exceptions of those that utilize iframes like notebooks and extension webview editors.'),
842
type: 'boolean',
843
default: false,
844
tags: ['accessibility'],
845
scope: ConfigurationScope.APPLICATION,
846
},
847
[AccessibilityWorkbenchSettingId.DimUnfocusedOpacity]: {
848
markdownDescription: localize('dimUnfocusedOpacity', 'The opacity fraction (0.2 to 1.0) to use for unfocused editors and terminals. This will only take effect when {0} is enabled.', `\`#${AccessibilityWorkbenchSettingId.DimUnfocusedEnabled}#\``),
849
type: 'number',
850
minimum: ViewDimUnfocusedOpacityProperties.Minimum,
851
maximum: ViewDimUnfocusedOpacityProperties.Maximum,
852
default: ViewDimUnfocusedOpacityProperties.Default,
853
tags: ['accessibility'],
854
scope: ConfigurationScope.APPLICATION,
855
},
856
[AccessibilityWorkbenchSettingId.HideAccessibleView]: {
857
description: localize('accessibility.hideAccessibleView', "Controls whether the Accessible View is hidden."),
858
type: 'boolean',
859
default: false,
860
tags: ['accessibility']
861
},
862
[AccessibilityWorkbenchSettingId.VerboseChatProgressUpdates]: {
863
'type': 'boolean',
864
'default': true,
865
'markdownDescription': localize('accessibility.verboseChatProgressUpdates', "Controls whether verbose progress announcements should be made when a chat request is in progress, including information like searched text for <search term> with X results, created file <file_name>, or read file <file path>.")
866
}
867
}
868
});
869
}
870
871
export { AccessibilityVoiceSettingId };
872
873
export const SpeechTimeoutDefault = 0;
874
875
export class DynamicSpeechAccessibilityConfiguration extends Disposable implements IWorkbenchContribution {
876
877
static readonly ID = 'workbench.contrib.dynamicSpeechAccessibilityConfiguration';
878
879
constructor(
880
@ISpeechService private readonly speechService: ISpeechService
881
) {
882
super();
883
884
this._register(Event.runAndSubscribe(speechService.onDidChangeHasSpeechProvider, () => this.updateConfiguration()));
885
}
886
887
private updateConfiguration(): void {
888
if (!this.speechService.hasSpeechProvider) {
889
return; // these settings require a speech provider
890
}
891
892
const languages = this.getLanguages();
893
const languagesSorted = Object.keys(languages).sort((langA, langB) => {
894
return languages[langA].name.localeCompare(languages[langB].name);
895
});
896
897
const registry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);
898
registry.registerConfiguration({
899
...accessibilityConfigurationNodeBase,
900
properties: {
901
[AccessibilityVoiceSettingId.SpeechTimeout]: {
902
'markdownDescription': localize('voice.speechTimeout', "The duration in milliseconds that voice speech recognition remains active after you stop speaking. For example in a chat session, the transcribed text is submitted automatically after the timeout is met. Set to `0` to disable this feature."),
903
'type': 'number',
904
'default': SpeechTimeoutDefault,
905
'minimum': 0,
906
'tags': ['accessibility']
907
},
908
[AccessibilityVoiceSettingId.IgnoreCodeBlocks]: {
909
'markdownDescription': localize('voice.ignoreCodeBlocks', "Whether to ignore code snippets in text-to-speech synthesis."),
910
'type': 'boolean',
911
'default': false,
912
'tags': ['accessibility']
913
},
914
[AccessibilityVoiceSettingId.SpeechLanguage]: {
915
'markdownDescription': localize('voice.speechLanguage', "The language that text-to-speech and speech-to-text should use. Select `auto` to use the configured display language if possible. Note that not all display languages maybe supported by speech recognition and synthesizers."),
916
'type': 'string',
917
'enum': languagesSorted,
918
'default': 'auto',
919
'tags': ['accessibility'],
920
'enumDescriptions': languagesSorted.map(key => languages[key].name),
921
'enumItemLabels': languagesSorted.map(key => languages[key].name)
922
},
923
[AccessibilityVoiceSettingId.AutoSynthesize]: {
924
'type': 'string',
925
'enum': ['on', 'off'],
926
'enumDescriptions': [
927
localize('accessibility.voice.autoSynthesize.on', "Enable the feature. When a screen reader is enabled, note that this will disable aria updates."),
928
localize('accessibility.voice.autoSynthesize.off', "Disable the feature."),
929
],
930
'markdownDescription': localize('autoSynthesize', "Whether a textual response should automatically be read out aloud when speech was used as input. For example in a chat session, a response is automatically synthesized when voice was used as chat request."),
931
'default': 'off',
932
'tags': ['accessibility']
933
}
934
}
935
});
936
}
937
938
private getLanguages(): { [locale: string]: { name: string } } {
939
return {
940
['auto']: {
941
name: localize('speechLanguage.auto', "Auto (Use Display Language)")
942
},
943
...SPEECH_LANGUAGES
944
};
945
}
946
}
947
948
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
949
.registerConfigurationMigrations([{
950
key: 'audioCues.volume',
951
migrateFn: (value, accessor) => {
952
return [
953
['accessibility.signalOptions.volume', { value }],
954
['audioCues.volume', { value: undefined }]
955
];
956
}
957
}]);
958
959
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
960
.registerConfigurationMigrations([{
961
key: 'audioCues.debouncePositionChanges',
962
migrateFn: (value) => {
963
return [
964
['accessibility.signalOptions.debouncePositionChanges', { value }],
965
['audioCues.debouncePositionChanges', { value: undefined }]
966
];
967
}
968
}]);
969
970
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
971
.registerConfigurationMigrations([{
972
key: 'accessibility.signalOptions',
973
migrateFn: (value, accessor) => {
974
const delayGeneral = getDelaysFromConfig(accessor, 'general');
975
const delayError = getDelaysFromConfig(accessor, 'errorAtPosition');
976
const delayWarning = getDelaysFromConfig(accessor, 'warningAtPosition');
977
const volume = getVolumeFromConfig(accessor);
978
const debouncePositionChanges = getDebouncePositionChangesFromConfig(accessor);
979
const result: [key: string, { value: any }][] = [];
980
if (!!volume) {
981
result.push(['accessibility.signalOptions.volume', { value: volume }]);
982
}
983
if (!!delayGeneral) {
984
result.push(['accessibility.signalOptions.experimental.delays.general', { value: delayGeneral }]);
985
}
986
if (!!delayError) {
987
result.push(['accessibility.signalOptions.experimental.delays.errorAtPosition', { value: delayError }]);
988
}
989
if (!!delayWarning) {
990
result.push(['accessibility.signalOptions.experimental.delays.warningAtPosition', { value: delayWarning }]);
991
}
992
if (!!debouncePositionChanges) {
993
result.push(['accessibility.signalOptions.debouncePositionChanges', { value: debouncePositionChanges }]);
994
}
995
result.push(['accessibility.signalOptions', { value: undefined }]);
996
return result;
997
}
998
}]);
999
1000
1001
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1002
.registerConfigurationMigrations([{
1003
key: 'accessibility.signals.sounds.volume',
1004
migrateFn: (value) => {
1005
return [
1006
['accessibility.signalOptions.volume', { value }],
1007
['accessibility.signals.sounds.volume', { value: undefined }]
1008
];
1009
}
1010
}]);
1011
1012
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1013
.registerConfigurationMigrations([{
1014
key: 'accessibility.signals.debouncePositionChanges',
1015
migrateFn: (value) => {
1016
return [
1017
['accessibility.signalOptions.debouncePositionChanges', { value }],
1018
['accessibility.signals.debouncePositionChanges', { value: undefined }]
1019
];
1020
}
1021
}]);
1022
1023
function getDelaysFromConfig(accessor: (key: string) => any, type: 'general' | 'errorAtPosition' | 'warningAtPosition'): { announcement: number; sound: number } | undefined {
1024
return accessor(`accessibility.signalOptions.experimental.delays.${type}`) || accessor('accessibility.signalOptions')?.['experimental.delays']?.[`${type}`] || accessor('accessibility.signalOptions')?.['delays']?.[`${type}`];
1025
}
1026
1027
function getVolumeFromConfig(accessor: (key: string) => any): string | undefined {
1028
return accessor('accessibility.signalOptions.volume') || accessor('accessibility.signalOptions')?.volume || accessor('accessibility.signals.sounds.volume') || accessor('audioCues.volume');
1029
}
1030
1031
function getDebouncePositionChangesFromConfig(accessor: (key: string) => any): number | undefined {
1032
return accessor('accessibility.signalOptions.debouncePositionChanges') || accessor('accessibility.signalOptions')?.debouncePositionChanges || accessor('accessibility.signals.debouncePositionChanges') || accessor('audioCues.debouncePositionChanges');
1033
}
1034
1035
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1036
.registerConfigurationMigrations([{
1037
key: AccessibilityVoiceSettingId.AutoSynthesize,
1038
migrateFn: (value: boolean) => {
1039
let newValue: string | undefined;
1040
if (value === true) {
1041
newValue = 'on';
1042
} else if (value === false) {
1043
newValue = 'off';
1044
} else {
1045
return [];
1046
}
1047
return [
1048
[AccessibilityVoiceSettingId.AutoSynthesize, { value: newValue }],
1049
];
1050
}
1051
}]);
1052
1053
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1054
.registerConfigurationMigrations([{
1055
key: 'accessibility.signals.chatResponsePending',
1056
migrateFn: (value, accessor) => {
1057
return [
1058
['accessibility.signals.progress', { value }],
1059
['accessibility.signals.chatResponsePending', { value: undefined }],
1060
];
1061
}
1062
}]);
1063
1064
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1065
.registerConfigurationMigrations(AccessibilitySignal.allAccessibilitySignals.map<ConfigurationMigration | undefined>(item => item.legacySoundSettingsKey ? ({
1066
key: item.legacySoundSettingsKey,
1067
migrateFn: (sound, accessor) => {
1068
const configurationKeyValuePairs: ConfigurationKeyValuePairs = [];
1069
const legacyAnnouncementSettingsKey = item.legacyAnnouncementSettingsKey;
1070
let announcement: string | undefined;
1071
if (legacyAnnouncementSettingsKey) {
1072
announcement = accessor(legacyAnnouncementSettingsKey) ?? undefined;
1073
if (announcement !== undefined && typeof announcement !== 'string') {
1074
announcement = announcement ? 'auto' : 'off';
1075
}
1076
}
1077
configurationKeyValuePairs.push([`${item.legacySoundSettingsKey}`, { value: undefined }]);
1078
configurationKeyValuePairs.push([`${item.settingsKey}`, { value: announcement !== undefined ? { announcement, sound } : { sound } }]);
1079
return configurationKeyValuePairs;
1080
}
1081
}) : undefined).filter(isDefined));
1082
1083
Registry.as<IConfigurationMigrationRegistry>(WorkbenchExtensions.ConfigurationMigration)
1084
.registerConfigurationMigrations(AccessibilitySignal.allAccessibilitySignals.filter(i => !!i.legacyAnnouncementSettingsKey && !!i.legacySoundSettingsKey).map(item => ({
1085
key: item.legacyAnnouncementSettingsKey!,
1086
migrateFn: (announcement, accessor) => {
1087
const configurationKeyValuePairs: ConfigurationKeyValuePairs = [];
1088
const sound = accessor(item.settingsKey)?.sound || accessor(item.legacySoundSettingsKey!);
1089
if (announcement !== undefined && typeof announcement !== 'string') {
1090
announcement = announcement ? 'auto' : 'off';
1091
}
1092
configurationKeyValuePairs.push([`${item.settingsKey}`, { value: announcement !== undefined ? { announcement, sound } : { sound } }]);
1093
configurationKeyValuePairs.push([`${item.legacyAnnouncementSettingsKey}`, { value: undefined }]);
1094
configurationKeyValuePairs.push([`${item.legacySoundSettingsKey}`, { value: undefined }]);
1095
return configurationKeyValuePairs;
1096
}
1097
})));
1098
1099