@codingame/monaco-vscode-accessibility-service-override 5.3.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accessibility.js +2 -2
- package/assets/success.mp3 +0 -0
- package/package.json +2 -2
- package/vscode/src/vs/platform/accessibilitySignal/browser/media/all.mp3.js +1 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js +17 -20
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityStatus.js +5 -3
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +864 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewContributions.js +39 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewKeybindingResolver.js +35 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/extensionAccesibilityHelp.contribution.js +66 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution.js +4 -3
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/editorTextPropertySignalsContribution.js +5 -20
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js +3 -2
- package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/saveAccessibilitySignal.js +2 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +9 -6
- package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.js +2 -1
- package/vscode/src/vs/workbench/contrib/accessibility/browser/audioCueConfiguration.js +0 -231
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
2
|
+
import { accessibleViewIsShown } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
3
|
+
import { AccessibilityHelpAction, AccessibleViewAction } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibleViewActions';
|
|
4
|
+
import { AccessibleViewType } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
5
|
+
import { IAccessibleViewService } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView.service';
|
|
6
|
+
import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
|
|
7
|
+
|
|
8
|
+
class AccesibleViewHelpContribution extends Disposable {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this._register(AccessibilityHelpAction.addImplementation(115, 'accessible-view-help', accessor => {
|
|
12
|
+
accessor.get(IAccessibleViewService).showAccessibleViewHelp();
|
|
13
|
+
return true;
|
|
14
|
+
}, accessibleViewIsShown));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
class AccesibleViewContributions extends Disposable {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
AccessibleViewRegistry.getImplementations().forEach(impl => {
|
|
21
|
+
const implementation = (accessor) => {
|
|
22
|
+
const provider = impl.getProvider(accessor);
|
|
23
|
+
if (provider) {
|
|
24
|
+
accessor.get(IAccessibleViewService).show(provider);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
if (impl.type === AccessibleViewType.View) {
|
|
30
|
+
this._register(AccessibleViewAction.addImplementation(impl.priority, impl.name, implementation, impl.when));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
this._register(AccessibilityHelpAction.addImplementation(impl.priority, impl.name, implementation, impl.when));
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { AccesibleViewContributions, AccesibleViewHelpContribution };
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewKeybindingResolver.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { MarkdownString } from 'vscode/vscode/vs/base/common/htmlContent';
|
|
2
|
+
import { AccessibilityCommandId } from 'vscode/vscode/vs/workbench/contrib/accessibility/common/accessibilityCommands';
|
|
3
|
+
|
|
4
|
+
function resolveContentAndKeybindingItems(keybindingService, value) {
|
|
5
|
+
if (!value) {
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const configureKeybindingItems = [];
|
|
9
|
+
const matches = value.matchAll(/\<keybinding:(?<commandId>.*)\>/gm);
|
|
10
|
+
for (const match of [...matches]) {
|
|
11
|
+
const commandId = match?.groups?.commandId;
|
|
12
|
+
let kbLabel;
|
|
13
|
+
if (match?.length && commandId) {
|
|
14
|
+
const keybinding = keybindingService.lookupKeybinding(commandId)?.getAriaLabel();
|
|
15
|
+
if (!keybinding) {
|
|
16
|
+
const configureKb = keybindingService.lookupKeybinding(AccessibilityCommandId.AccessibilityHelpConfigureKeybindings)?.getAriaLabel();
|
|
17
|
+
const keybindingToConfigureQuickPick = configureKb ? '(' + configureKb + ')' : 'by assigning a keybinding to the command Accessibility Help Configure Keybindings.';
|
|
18
|
+
kbLabel = `, configure a keybinding ` + keybindingToConfigureQuickPick;
|
|
19
|
+
configureKeybindingItems.push({
|
|
20
|
+
label: commandId,
|
|
21
|
+
id: commandId
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
kbLabel = ' (' + keybinding + ')';
|
|
26
|
+
}
|
|
27
|
+
value = value.replace(match[0], kbLabel);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const content = ( new MarkdownString(value));
|
|
31
|
+
content.isTrusted = true;
|
|
32
|
+
return { content, configureKeybindingItems: configureKeybindingItems.length ? configureKeybindingItems : undefined };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export { resolveContentAndKeybindingItems };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
+
import { Disposable, DisposableMap, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { AccessibleViewType, ExtensionContentProvider } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleView';
|
|
4
|
+
import { AccessibleViewRegistry } from 'vscode/vscode/vs/platform/accessibility/browser/accessibleViewRegistry';
|
|
5
|
+
import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
6
|
+
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
7
|
+
import { FocusedViewContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
8
|
+
import { Extensions } from 'vscode/vscode/vs/workbench/common/views';
|
|
9
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
10
|
+
|
|
11
|
+
let ExtensionAccessibilityHelpDialogContribution = class ExtensionAccessibilityHelpDialogContribution extends Disposable {
|
|
12
|
+
static { this.ID = 'extensionAccessibilityHelpDialogContribution'; }
|
|
13
|
+
constructor(keybindingService) {
|
|
14
|
+
super();
|
|
15
|
+
this._viewHelpDialogMap = this._register(( new DisposableMap()));
|
|
16
|
+
this._register(( Registry.as(Extensions.ViewsRegistry)).onViewsRegistered(e => {
|
|
17
|
+
for (const view of e) {
|
|
18
|
+
for (const viewDescriptor of view.views) {
|
|
19
|
+
if (viewDescriptor.accessibilityHelpContent) {
|
|
20
|
+
this._viewHelpDialogMap.set(viewDescriptor.id, registerAccessibilityHelpAction(keybindingService, viewDescriptor));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}));
|
|
25
|
+
this._register(( Registry.as(Extensions.ViewsRegistry)).onViewsDeregistered(e => {
|
|
26
|
+
for (const viewDescriptor of e.views) {
|
|
27
|
+
if (viewDescriptor.accessibilityHelpContent) {
|
|
28
|
+
this._viewHelpDialogMap.get(viewDescriptor.id)?.dispose();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
ExtensionAccessibilityHelpDialogContribution = ( __decorate([
|
|
35
|
+
( __param(0, IKeybindingService))
|
|
36
|
+
], ExtensionAccessibilityHelpDialogContribution));
|
|
37
|
+
function registerAccessibilityHelpAction(keybindingService, viewDescriptor) {
|
|
38
|
+
const disposableStore = ( new DisposableStore());
|
|
39
|
+
const content = viewDescriptor.accessibilityHelpContent?.value;
|
|
40
|
+
if (!content) {
|
|
41
|
+
throw ( new Error('No content provided for the accessibility help dialog'));
|
|
42
|
+
}
|
|
43
|
+
disposableStore.add(AccessibleViewRegistry.register({
|
|
44
|
+
priority: 95,
|
|
45
|
+
name: viewDescriptor.id,
|
|
46
|
+
type: AccessibleViewType.Help,
|
|
47
|
+
when: ( FocusedViewContext.isEqualTo(viewDescriptor.id)),
|
|
48
|
+
getProvider: (accessor) => {
|
|
49
|
+
const viewsService = accessor.get(IViewsService);
|
|
50
|
+
return ( new ExtensionContentProvider(
|
|
51
|
+
viewDescriptor.id,
|
|
52
|
+
{ type: AccessibleViewType.Help },
|
|
53
|
+
() => content,
|
|
54
|
+
() => viewsService.openView(viewDescriptor.id, true)
|
|
55
|
+
));
|
|
56
|
+
},
|
|
57
|
+
dispose: () => { },
|
|
58
|
+
}));
|
|
59
|
+
disposableStore.add(keybindingService.onDidUpdateKeybindings(() => {
|
|
60
|
+
disposableStore.clear();
|
|
61
|
+
disposableStore.add(registerAccessibilityHelpAction(keybindingService, viewDescriptor));
|
|
62
|
+
}));
|
|
63
|
+
return disposableStore;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export { ExtensionAccessibilityHelpDialogContribution };
|
package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js
CHANGED
|
@@ -4,6 +4,7 @@ import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
|
4
4
|
import { Disposable, toDisposable, DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { clamp } from 'vscode/vscode/vs/base/common/numbers';
|
|
6
6
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { AccessibilityWorkbenchSettingId, ViewDimUnfocusedOpacityProperties } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
7
8
|
|
|
8
9
|
let UnfocusedViewDimmingContribution = class UnfocusedViewDimmingContribution extends Disposable {
|
|
9
10
|
constructor(configurationService) {
|
|
@@ -11,13 +12,13 @@ let UnfocusedViewDimmingContribution = class UnfocusedViewDimmingContribution ex
|
|
|
11
12
|
this._styleElementDisposables = undefined;
|
|
12
13
|
this._register(toDisposable(() => this._removeStyleElement()));
|
|
13
14
|
this._register(Event.runAndSubscribe(configurationService.onDidChangeConfiguration, e => {
|
|
14
|
-
if (e && !e.affectsConfiguration(
|
|
15
|
+
if (e && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.DimUnfocusedEnabled) && !e.affectsConfiguration(AccessibilityWorkbenchSettingId.DimUnfocusedOpacity)) {
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
18
|
let cssTextContent = '';
|
|
18
|
-
const enabled = ensureBoolean(configurationService.getValue(
|
|
19
|
+
const enabled = ensureBoolean(configurationService.getValue(AccessibilityWorkbenchSettingId.DimUnfocusedEnabled), false);
|
|
19
20
|
if (enabled) {
|
|
20
|
-
const opacity = clamp(ensureNumber(configurationService.getValue(
|
|
21
|
+
const opacity = clamp(ensureNumber(configurationService.getValue(AccessibilityWorkbenchSettingId.DimUnfocusedOpacity), ViewDimUnfocusedOpacityProperties.Default), ViewDimUnfocusedOpacityProperties.Minimum, ViewDimUnfocusedOpacityProperties.Maximum);
|
|
21
22
|
if (opacity !== 1) {
|
|
22
23
|
const rules = ( new Set());
|
|
23
24
|
const filterRule = `filter: opacity(${opacity});`;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
2
2
|
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
3
3
|
import { registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
-
import
|
|
4
|
+
import 'vscode/vscode/vs/platform/instantiation/common/extensions';
|
|
5
|
+
import { registerWorkbenchContribution2, WorkbenchPhase } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
5
6
|
import { AccessibilitySignalLineDebuggerContribution } from './accessibilitySignalDebuggerContribution.js';
|
|
6
7
|
import { ShowSignalSoundHelp, ShowAccessibilityAnnouncementHelp } from './commands.js';
|
|
7
8
|
import { EditorTextPropertySignalsContribution } from './editorTextPropertySignalsContribution.js';
|
|
8
9
|
import { wrapInReloadableClass } from './reloadableWorkbenchContribution.js';
|
|
9
10
|
|
|
10
|
-
registerWorkbenchContribution2('EditorTextPropertySignalsContribution', wrapInReloadableClass(() => EditorTextPropertySignalsContribution),
|
|
11
|
-
registerWorkbenchContribution2('AccessibilitySignalLineDebuggerContribution', AccessibilitySignalLineDebuggerContribution,
|
|
11
|
+
registerWorkbenchContribution2('EditorTextPropertySignalsContribution', wrapInReloadableClass(() => EditorTextPropertySignalsContribution), WorkbenchPhase.AfterRestored);
|
|
12
|
+
registerWorkbenchContribution2('AccessibilitySignalLineDebuggerContribution', AccessibilitySignalLineDebuggerContribution, WorkbenchPhase.AfterRestored);
|
|
12
13
|
registerAction2(ShowSignalSoundHelp);
|
|
13
14
|
registerAction2(ShowAccessibilityAnnouncementHelp);
|
|
@@ -8,6 +8,7 @@ import { observableFromValueWithChangeEvent, observableFromEvent, wasEventTrigge
|
|
|
8
8
|
import 'vscode/vscode/vs/base/common/cancellation';
|
|
9
9
|
import { isDefined } from 'vscode/vscode/vs/base/common/types';
|
|
10
10
|
import { isDiffEditor, isCodeEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
11
|
+
import { CursorChangeReason } from 'vscode/vscode/vs/editor/common/cursorEvents';
|
|
11
12
|
import { FoldingController } from 'vscode/vscode/vs/editor/contrib/folding/browser/folding';
|
|
12
13
|
import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
13
14
|
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
@@ -63,8 +64,8 @@ let EditorTextPropertySignalsContribution = class EditorTextPropertySignalsContr
|
|
|
63
64
|
store.add(editor.onDidChangeCursorPosition(args => {
|
|
64
65
|
timeouts.clear();
|
|
65
66
|
if (args &&
|
|
66
|
-
args.reason !==
|
|
67
|
-
args.reason !==
|
|
67
|
+
args.reason !== CursorChangeReason.Explicit &&
|
|
68
|
+
args.reason !== CursorChangeReason.NotSet) {
|
|
68
69
|
ignoredLineSignalsForCurrentLine.clear();
|
|
69
70
|
return;
|
|
70
71
|
}
|
|
@@ -76,8 +77,8 @@ let EditorTextPropertySignalsContribution = class EditorTextPropertySignalsContr
|
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
78
79
|
for (const modality of ['sound', 'announcement']) {
|
|
79
|
-
if (this._accessibilitySignalService.getEnabledState(signal, false, modality)) {
|
|
80
|
-
const delay = this.
|
|
80
|
+
if (this._accessibilitySignalService.getEnabledState(signal, false, modality).value) {
|
|
81
|
+
const delay = this._accessibilitySignalService.getDelayMs(signal, modality) + (didType.get() ? 1000 : 0);
|
|
81
82
|
timeouts.add(disposableTimeout(() => {
|
|
82
83
|
if (source.isPresent(position, mode, undefined)) {
|
|
83
84
|
if (!(mode === 'line') || !( ignoredLineSignalsForCurrentLine.has(property))) {
|
|
@@ -125,22 +126,6 @@ let EditorTextPropertySignalsContribution = class EditorTextPropertySignalsContr
|
|
|
125
126
|
}
|
|
126
127
|
}));
|
|
127
128
|
}
|
|
128
|
-
_getDelay(signal, modality) {
|
|
129
|
-
if (signal === AccessibilitySignal.errorAtPosition || signal === AccessibilitySignal.warningAtPosition) {
|
|
130
|
-
if (modality === 'sound') {
|
|
131
|
-
return 100;
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
return 1000;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
if (modality === 'sound') {
|
|
138
|
-
return 400;
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
return 3000;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
129
|
};
|
|
145
130
|
EditorTextPropertySignalsContribution = ( __decorate([
|
|
146
131
|
( __param(0, IEditorService)),
|
package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement.js
CHANGED
|
@@ -6,6 +6,7 @@ import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/c
|
|
|
6
6
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
7
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
8
8
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
9
|
+
import { AccessibilityVerbositySettingId } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
9
10
|
|
|
10
11
|
const _moduleId = "vs/workbench/contrib/accessibilitySignals/browser/openDiffEditorAnnouncement";
|
|
11
12
|
let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncementContribution extends Disposable {
|
|
@@ -17,13 +18,13 @@ let DiffEditorActiveAnnouncementContribution = class DiffEditorActiveAnnouncemen
|
|
|
17
18
|
this._configurationService = _configurationService;
|
|
18
19
|
this._register(Event.runAndSubscribe(_accessibilityService.onDidChangeScreenReaderOptimized, () => this._updateListener()));
|
|
19
20
|
this._register(_configurationService.onDidChangeConfiguration(e => {
|
|
20
|
-
if (e.affectsConfiguration(
|
|
21
|
+
if (e.affectsConfiguration(AccessibilityVerbositySettingId.DiffEditorActive)) {
|
|
21
22
|
this._updateListener();
|
|
22
23
|
}
|
|
23
24
|
}));
|
|
24
25
|
}
|
|
25
26
|
_updateListener() {
|
|
26
|
-
const announcementEnabled = this._configurationService.getValue(
|
|
27
|
+
const announcementEnabled = this._configurationService.getValue(AccessibilityVerbositySettingId.DiffEditorActive);
|
|
27
28
|
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
28
29
|
if (!announcementEnabled || !screenReaderOptimized) {
|
|
29
30
|
this._onDidActiveEditorChangeListener?.dispose();
|
package/vscode/src/vs/workbench/contrib/accessibilitySignals/browser/saveAccessibilitySignal.js
CHANGED
|
@@ -2,6 +2,7 @@ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { AccessibilitySignal } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
|
|
4
4
|
import { IAccessibilitySignalService } from 'vscode/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
|
|
5
|
+
import { SaveReason } from 'vscode/vscode/vs/workbench/common/editor';
|
|
5
6
|
import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
|
|
6
7
|
|
|
7
8
|
let SaveAccessibilitySignalContribution = class SaveAccessibilitySignalContribution extends Disposable {
|
|
@@ -10,7 +11,7 @@ let SaveAccessibilitySignalContribution = class SaveAccessibilitySignalContribut
|
|
|
10
11
|
super();
|
|
11
12
|
this._accessibilitySignalService = _accessibilitySignalService;
|
|
12
13
|
this._workingCopyService = _workingCopyService;
|
|
13
|
-
this._register(this._workingCopyService.onDidSave(e => this._accessibilitySignalService.playSignal(AccessibilitySignal.save, { userGesture: e.reason ===
|
|
14
|
+
this._register(this._workingCopyService.onDidSave(e => this._accessibilitySignalService.playSignal(AccessibilitySignal.save, { userGesture: e.reason === SaveReason.EXPLICIT })));
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
SaveAccessibilitySignalContribution = ( __decorate([
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import './accessibility.css.js';
|
|
2
2
|
import { localize2WithPath } from 'vscode/vscode/vs/nls';
|
|
3
|
+
import { ConfigurationTarget } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
3
4
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
4
5
|
import { IAccessibilityService } from 'vscode/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
5
6
|
import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
6
7
|
import { accessibilityHelpIsShown } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
8
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
9
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
7
10
|
import { alert } from 'vscode/vscode/vs/base/browser/ui/aria/aria';
|
|
8
11
|
import { AccessibilityHelpNLS } from 'vscode/vscode/vs/editor/common/standaloneStrings';
|
|
9
12
|
|
|
@@ -22,14 +25,14 @@ class ToggleScreenReaderMode extends Action2 {
|
|
|
22
25
|
},
|
|
23
26
|
f1: true,
|
|
24
27
|
keybinding: [{
|
|
25
|
-
primary:
|
|
26
|
-
weight:
|
|
28
|
+
primary: KeyMod.CtrlCmd | KeyCode.KeyE,
|
|
29
|
+
weight: KeybindingWeight.WorkbenchContrib + 10,
|
|
27
30
|
when: accessibilityHelpIsShown
|
|
28
31
|
},
|
|
29
32
|
{
|
|
30
|
-
primary:
|
|
31
|
-
linux: { primary:
|
|
32
|
-
weight:
|
|
33
|
+
primary: KeyMod.Alt | KeyCode.F1 | KeyMod.Shift,
|
|
34
|
+
linux: { primary: KeyMod.Alt | KeyCode.F4 | KeyMod.Shift },
|
|
35
|
+
weight: KeybindingWeight.WorkbenchContrib + 10,
|
|
33
36
|
}]
|
|
34
37
|
});
|
|
35
38
|
}
|
|
@@ -37,7 +40,7 @@ class ToggleScreenReaderMode extends Action2 {
|
|
|
37
40
|
const accessibiiltyService = accessor.get(IAccessibilityService);
|
|
38
41
|
const configurationService = accessor.get(IConfigurationService);
|
|
39
42
|
const isScreenReaderOptimized = accessibiiltyService.isScreenReaderOptimized();
|
|
40
|
-
configurationService.updateValue('editor.accessibilitySupport', isScreenReaderOptimized ? 'off' : 'on',
|
|
43
|
+
configurationService.updateValue('editor.accessibilitySupport', isScreenReaderOptimized ? 'off' : 'on', ConfigurationTarget.USER);
|
|
41
44
|
alert(isScreenReaderOptimized ? AccessibilityHelpNLS.screenReaderModeDisabled : AccessibilityHelpNLS.screenReaderModeEnabled);
|
|
42
45
|
}
|
|
43
46
|
}
|
package/vscode/src/vs/workbench/services/accessibility/common/accessibleViewInformationService.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
4
|
+
import { StorageScope } from 'vscode/vscode/vs/platform/storage/common/storage';
|
|
4
5
|
import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
|
|
5
6
|
|
|
6
7
|
let AccessibleViewInformationService = class AccessibleViewInformationService extends Disposable {
|
|
@@ -9,7 +10,7 @@ let AccessibleViewInformationService = class AccessibleViewInformationService ex
|
|
|
9
10
|
this._storageService = _storageService;
|
|
10
11
|
}
|
|
11
12
|
hasShownAccessibleView(viewId) {
|
|
12
|
-
return this._storageService.getBoolean(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${viewId}`,
|
|
13
|
+
return this._storageService.getBoolean(`${ACCESSIBLE_VIEW_SHOWN_STORAGE_PREFIX}${viewId}`, StorageScope.APPLICATION, false) === true;
|
|
13
14
|
}
|
|
14
15
|
};
|
|
15
16
|
AccessibleViewInformationService = ( __decorate([
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
2
|
-
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
3
|
-
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
4
|
-
|
|
5
|
-
const _moduleId = "vs/workbench/contrib/accessibility/browser/audioCueConfiguration";
|
|
6
|
-
const audioCueFeatureBase = {
|
|
7
|
-
'type': 'string',
|
|
8
|
-
'enum': ['auto', 'on', 'off'],
|
|
9
|
-
'default': 'auto',
|
|
10
|
-
'enumDescriptions': [
|
|
11
|
-
( localizeWithPath(_moduleId, 0, "Enable audio cue when a screen reader is attached.")),
|
|
12
|
-
( localizeWithPath(_moduleId, 1, "Enable audio cue.")),
|
|
13
|
-
( localizeWithPath(_moduleId, 2, "Disable audio cue."))
|
|
14
|
-
],
|
|
15
|
-
tags: ['accessibility'],
|
|
16
|
-
};
|
|
17
|
-
const markdownDeprecationMessage = ( localizeWithPath(
|
|
18
|
-
_moduleId,
|
|
19
|
-
3,
|
|
20
|
-
"This setting is deprecated. Use `signals` settings instead."
|
|
21
|
-
));
|
|
22
|
-
const soundDeprecatedFeatureBase = {
|
|
23
|
-
...audioCueFeatureBase,
|
|
24
|
-
markdownDeprecationMessage
|
|
25
|
-
};
|
|
26
|
-
function registerAudioCueConfiguration() {
|
|
27
|
-
( (Registry.as(Extensions.Configuration))).registerConfiguration({
|
|
28
|
-
scope: 4 ,
|
|
29
|
-
'properties': {
|
|
30
|
-
'audioCues.enabled': {
|
|
31
|
-
markdownDeprecationMessage: 'Deprecated. Use the specific setting for each audio cue instead (`audioCues.*`).',
|
|
32
|
-
tags: ['accessibility']
|
|
33
|
-
},
|
|
34
|
-
'audioCues.volume': {
|
|
35
|
-
markdownDeprecationMessage: 'Deprecated. Use `accessibility.signals.sounds.volume` instead.',
|
|
36
|
-
tags: ['accessibility']
|
|
37
|
-
},
|
|
38
|
-
'audioCues.debouncePositionChanges': {
|
|
39
|
-
'description': ( localizeWithPath(_moduleId, 4, "Whether or not position changes should be debounced")),
|
|
40
|
-
'type': 'boolean',
|
|
41
|
-
'default': false,
|
|
42
|
-
tags: ['accessibility'],
|
|
43
|
-
'markdownDeprecationMessage': ( localizeWithPath(
|
|
44
|
-
_moduleId,
|
|
45
|
-
5,
|
|
46
|
-
'This setting is deprecated, instead use the `signals.debouncePositionChanges` setting.'
|
|
47
|
-
))
|
|
48
|
-
},
|
|
49
|
-
'audioCues.lineHasBreakpoint': {
|
|
50
|
-
'description': ( localizeWithPath(_moduleId, 6, "Plays a sound when the active line has a breakpoint.")),
|
|
51
|
-
...soundDeprecatedFeatureBase
|
|
52
|
-
},
|
|
53
|
-
'audioCues.lineHasInlineSuggestion': {
|
|
54
|
-
'description': ( localizeWithPath(
|
|
55
|
-
_moduleId,
|
|
56
|
-
7,
|
|
57
|
-
"Plays a sound when the active line has an inline suggestion."
|
|
58
|
-
)),
|
|
59
|
-
...soundDeprecatedFeatureBase
|
|
60
|
-
},
|
|
61
|
-
'audioCues.lineHasError': {
|
|
62
|
-
'description': ( localizeWithPath(_moduleId, 8, "Plays a sound when the active line has an error.")),
|
|
63
|
-
...soundDeprecatedFeatureBase,
|
|
64
|
-
},
|
|
65
|
-
'audioCues.lineHasFoldedArea': {
|
|
66
|
-
'description': ( localizeWithPath(
|
|
67
|
-
_moduleId,
|
|
68
|
-
9,
|
|
69
|
-
"Plays a sound when the active line has a folded area that can be unfolded."
|
|
70
|
-
)),
|
|
71
|
-
...soundDeprecatedFeatureBase,
|
|
72
|
-
},
|
|
73
|
-
'audioCues.lineHasWarning': {
|
|
74
|
-
'description': ( localizeWithPath(_moduleId, 10, "Plays a sound when the active line has a warning.")),
|
|
75
|
-
...soundDeprecatedFeatureBase,
|
|
76
|
-
default: 'off',
|
|
77
|
-
},
|
|
78
|
-
'audioCues.onDebugBreak': {
|
|
79
|
-
'description': ( localizeWithPath(_moduleId, 11, "Plays a sound when the debugger stopped on a breakpoint.")),
|
|
80
|
-
...soundDeprecatedFeatureBase,
|
|
81
|
-
},
|
|
82
|
-
'audioCues.noInlayHints': {
|
|
83
|
-
'description': ( localizeWithPath(
|
|
84
|
-
_moduleId,
|
|
85
|
-
12,
|
|
86
|
-
"Plays a sound when trying to read a line with inlay hints that has no inlay hints."
|
|
87
|
-
)),
|
|
88
|
-
...soundDeprecatedFeatureBase,
|
|
89
|
-
},
|
|
90
|
-
'audioCues.taskCompleted': {
|
|
91
|
-
'description': ( localizeWithPath(_moduleId, 13, "Plays a sound when a task is completed.")),
|
|
92
|
-
...soundDeprecatedFeatureBase,
|
|
93
|
-
},
|
|
94
|
-
'audioCues.taskFailed': {
|
|
95
|
-
'description': ( localizeWithPath(_moduleId, 14, "Plays a sound when a task fails (non-zero exit code).")),
|
|
96
|
-
...soundDeprecatedFeatureBase,
|
|
97
|
-
},
|
|
98
|
-
'audioCues.terminalCommandFailed': {
|
|
99
|
-
'description': ( localizeWithPath(
|
|
100
|
-
_moduleId,
|
|
101
|
-
15,
|
|
102
|
-
"Plays a sound when a terminal command fails (non-zero exit code)."
|
|
103
|
-
)),
|
|
104
|
-
...soundDeprecatedFeatureBase,
|
|
105
|
-
},
|
|
106
|
-
'audioCues.terminalQuickFix': {
|
|
107
|
-
'description': ( localizeWithPath(_moduleId, 16, "Plays a sound when terminal Quick Fixes are available.")),
|
|
108
|
-
...soundDeprecatedFeatureBase,
|
|
109
|
-
},
|
|
110
|
-
'audioCues.terminalBell': {
|
|
111
|
-
'description': ( localizeWithPath(_moduleId, 17, "Plays a sound when the terminal bell is ringing.")),
|
|
112
|
-
...soundDeprecatedFeatureBase,
|
|
113
|
-
default: 'on'
|
|
114
|
-
},
|
|
115
|
-
'audioCues.diffLineInserted': {
|
|
116
|
-
'description': ( localizeWithPath(
|
|
117
|
-
_moduleId,
|
|
118
|
-
18,
|
|
119
|
-
"Plays a sound when the focus moves to an inserted line in Accessible Diff Viewer mode or to the next/previous change."
|
|
120
|
-
)),
|
|
121
|
-
...soundDeprecatedFeatureBase,
|
|
122
|
-
},
|
|
123
|
-
'audioCues.diffLineDeleted': {
|
|
124
|
-
'description': ( localizeWithPath(
|
|
125
|
-
_moduleId,
|
|
126
|
-
19,
|
|
127
|
-
"Plays a sound when the focus moves to a deleted line in Accessible Diff Viewer mode or to the next/previous change."
|
|
128
|
-
)),
|
|
129
|
-
...soundDeprecatedFeatureBase,
|
|
130
|
-
},
|
|
131
|
-
'audioCues.diffLineModified': {
|
|
132
|
-
'description': ( localizeWithPath(
|
|
133
|
-
_moduleId,
|
|
134
|
-
20,
|
|
135
|
-
"Plays a sound when the focus moves to a modified line in Accessible Diff Viewer mode or to the next/previous change."
|
|
136
|
-
)),
|
|
137
|
-
...soundDeprecatedFeatureBase,
|
|
138
|
-
},
|
|
139
|
-
'audioCues.notebookCellCompleted': {
|
|
140
|
-
'description': ( localizeWithPath(
|
|
141
|
-
_moduleId,
|
|
142
|
-
21,
|
|
143
|
-
"Plays a sound when a notebook cell execution is successfully completed."
|
|
144
|
-
)),
|
|
145
|
-
...soundDeprecatedFeatureBase,
|
|
146
|
-
},
|
|
147
|
-
'audioCues.notebookCellFailed': {
|
|
148
|
-
'description': ( localizeWithPath(_moduleId, 22, "Plays a sound when a notebook cell execution fails.")),
|
|
149
|
-
...soundDeprecatedFeatureBase,
|
|
150
|
-
},
|
|
151
|
-
'audioCues.chatRequestSent': {
|
|
152
|
-
'description': ( localizeWithPath(_moduleId, 23, "Plays a sound when a chat request is made.")),
|
|
153
|
-
...soundDeprecatedFeatureBase,
|
|
154
|
-
default: 'off'
|
|
155
|
-
},
|
|
156
|
-
'audioCues.chatResponsePending': {
|
|
157
|
-
'description': ( localizeWithPath(_moduleId, 24, "Plays a sound on loop while the response is pending.")),
|
|
158
|
-
...soundDeprecatedFeatureBase,
|
|
159
|
-
default: 'auto'
|
|
160
|
-
},
|
|
161
|
-
'audioCues.chatResponseReceived': {
|
|
162
|
-
'description': ( localizeWithPath(
|
|
163
|
-
_moduleId,
|
|
164
|
-
25,
|
|
165
|
-
"Plays a sound on loop while the response has been received."
|
|
166
|
-
)),
|
|
167
|
-
...soundDeprecatedFeatureBase,
|
|
168
|
-
default: 'off'
|
|
169
|
-
},
|
|
170
|
-
'audioCues.clear': {
|
|
171
|
-
'description': ( localizeWithPath(
|
|
172
|
-
_moduleId,
|
|
173
|
-
26,
|
|
174
|
-
"Plays a sound when a feature is cleared (for example, the terminal, Debug Console, or Output channel). When this is disabled, an ARIA alert will announce 'Cleared'."
|
|
175
|
-
)),
|
|
176
|
-
...soundDeprecatedFeatureBase,
|
|
177
|
-
default: 'off'
|
|
178
|
-
},
|
|
179
|
-
'audioCues.save': {
|
|
180
|
-
'markdownDescription': ( localizeWithPath(
|
|
181
|
-
_moduleId,
|
|
182
|
-
27,
|
|
183
|
-
"Plays a sound when a file is saved. Also see {0}",
|
|
184
|
-
'`#accessibility.alert.save#`'
|
|
185
|
-
)),
|
|
186
|
-
'type': 'string',
|
|
187
|
-
'enum': ['userGesture', 'always', 'never'],
|
|
188
|
-
'default': 'never',
|
|
189
|
-
'enumDescriptions': [
|
|
190
|
-
( localizeWithPath(_moduleId, 28, "Plays the audio cue when a user explicitly saves a file.")),
|
|
191
|
-
( localizeWithPath(
|
|
192
|
-
_moduleId,
|
|
193
|
-
29,
|
|
194
|
-
"Plays the audio cue whenever a file is saved, including auto save."
|
|
195
|
-
)),
|
|
196
|
-
( localizeWithPath(_moduleId, 30, "Never plays the audio cue."))
|
|
197
|
-
],
|
|
198
|
-
tags: ['accessibility'],
|
|
199
|
-
markdownDeprecationMessage
|
|
200
|
-
},
|
|
201
|
-
'audioCues.format': {
|
|
202
|
-
'markdownDescription': ( localizeWithPath(
|
|
203
|
-
_moduleId,
|
|
204
|
-
31,
|
|
205
|
-
"Plays a sound when a file or notebook is formatted. Also see {0}",
|
|
206
|
-
'`#accessibility.alert.format#`'
|
|
207
|
-
)),
|
|
208
|
-
'type': 'string',
|
|
209
|
-
'enum': ['userGesture', 'always', 'never'],
|
|
210
|
-
'default': 'never',
|
|
211
|
-
'enumDescriptions': [
|
|
212
|
-
( localizeWithPath(
|
|
213
|
-
_moduleId,
|
|
214
|
-
32,
|
|
215
|
-
"Plays the audio cue when a user explicitly formats a file."
|
|
216
|
-
)),
|
|
217
|
-
( localizeWithPath(
|
|
218
|
-
_moduleId,
|
|
219
|
-
33,
|
|
220
|
-
"Plays the audio cue whenever a file is formatted, including if it is set to format on save, type, or, paste, or run of a cell."
|
|
221
|
-
)),
|
|
222
|
-
( localizeWithPath(_moduleId, 34, "Never plays the audio cue."))
|
|
223
|
-
],
|
|
224
|
-
tags: ['accessibility'],
|
|
225
|
-
markdownDeprecationMessage
|
|
226
|
-
},
|
|
227
|
-
},
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export { audioCueFeatureBase, registerAudioCueConfiguration };
|