Skip to content

Commit 4c0de39

Browse files
authored
Merge pull request microsoft#187728 from microsoft/merogge/rename-key
improve name for `AccessibleViewProvider` property
2 parents bd8d4d5 + 3dc0d6d commit 4c0de39

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class AccessibilityHelpProvider implements IAccessibleContentProvider {
3333
this._editor.focus();
3434
}
3535
options: IAccessibleViewOptions = { type: AccessibleViewType.HelpMenu, ariaLabel: localize('editor-help', "editor accessibility help"), readMoreUrl: 'https://go.microsoft.com/fwlink/?linkid=851010' };
36-
id: string = 'editor';
36+
verbositySettingKey: string = 'editor';
3737
constructor(
3838
private readonly _editor: ICodeEditor,
3939
@IKeybindingService private readonly _keybindingService: IKeybindingService
@@ -116,7 +116,7 @@ class HoverAccessibleViewContribution extends Disposable {
116116
return false;
117117
}
118118
accessibleViewService.show({
119-
id: 'hover',
119+
verbositySettingKey: 'hover',
120120
provideContent() { return content; },
121121
onClose() {
122122
controller.focus();

src/vs/workbench/contrib/accessibility/browser/accessibleView.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const enum DEFAULT {
3232
}
3333

3434
export interface IAccessibleContentProvider {
35-
id: string;
35+
verbositySettingKey: string;
3636
provideContent(): string;
3737
onClose(): void;
3838
onKeyDown?(e: IKeyboardEvent): void;
@@ -103,7 +103,7 @@ class AccessibleView extends Disposable {
103103
}
104104
}));
105105
this._register(this._configurationService.onDidChangeConfiguration(e => {
106-
if (this._currentProvider && this._accessiblityHelpIsShown.get() && e.affectsConfiguration(`accessibility.verbosity.${this._currentProvider.id}`)) {
106+
if (this._currentProvider && this._accessiblityHelpIsShown.get() && e.affectsConfiguration(`accessibility.verbosity.${this._currentProvider.verbositySettingKey}`)) {
107107
this.show(this._currentProvider);
108108
}
109109
}));
@@ -130,7 +130,7 @@ class AccessibleView extends Disposable {
130130

131131
private _render(provider: IAccessibleContentProvider, container: HTMLElement): IDisposable {
132132
this._currentProvider = provider;
133-
const settingKey = `accessibility.verbosity.${provider.id}`;
133+
const settingKey = `accessibility.verbosity.${provider.verbositySettingKey}`;
134134
const value = this._configurationService.getValue(settingKey);
135135
const readMoreLink = provider.options.readMoreUrl ? localize("openDoc", "\nPress H now to open a browser window with more information related to accessibility.\n") : '';
136136
const disableHelpHint = provider.options.type === AccessibleViewType.HelpMenu && !!value ? localize('disable-help-hint', '\nTo disable the `accessibility.verbosity` hint for this feature, press D now.\n') : '\n';
@@ -142,7 +142,7 @@ class AccessibleView extends Disposable {
142142
? AccessibilityHelpNLS.changeConfigToOnMac
143143
: AccessibilityHelpNLS.changeConfigToOnWinLinux
144144
);
145-
if (accessibilitySupport && provider.id === 'editor') {
145+
if (accessibilitySupport && provider.verbositySettingKey === 'editor') {
146146
message = AccessibilityHelpNLS.auto_on;
147147
message += '\n';
148148
} else if (!accessibilitySupport) {
@@ -153,7 +153,7 @@ class AccessibleView extends Disposable {
153153

154154
const fragment = message + provider.provideContent() + readMoreLink + disableHelpHint + localize('exit-tip', 'Exit this menu via the Escape key.');
155155

156-
this._getTextModel(URI.from({ path: `accessible-view-${provider.id}`, scheme: 'accessible-view', fragment })).then((model) => {
156+
this._getTextModel(URI.from({ path: `accessible-view-${provider.verbositySettingKey}`, scheme: 'accessible-view', fragment })).then((model) => {
157157
if (!model) {
158158
return;
159159
}
@@ -176,7 +176,7 @@ class AccessibleView extends Disposable {
176176
// Delay to allow the context view to hide #186514
177177
setTimeout(() => provider.onClose(), 100);
178178
} else if (e.keyCode === KeyCode.KeyD && this._configurationService.getValue(settingKey)) {
179-
alert(localize('disableAccessibilityHelp', '{0} accessibility verbosity is now disabled', provider.id));
179+
alert(localize('disableAccessibilityHelp', '{0} accessibility verbosity is now disabled', provider.verbositySettingKey));
180180
this._configurationService.updateValue(settingKey, false);
181181
}
182182
e.stopPropagation();

src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export async function runAccessibilityHelpAction(accessor: ServicesAccessor, edi
7272
inputEditor.getSupportedActions();
7373
const helpText = getAccessibilityHelpText(accessor, type);
7474
accessibleViewService.show({
75-
id: type,
75+
verbositySettingKey: type,
7676
provideContent: () => helpText,
7777
onClose: () => {
7878
if (type === 'panelChat' && cachedPosition) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class ChatAccessibleViewContribution extends Disposable {
136136
return false;
137137
}
138138
accessibleViewService.show({
139-
id: 'panelChat',
139+
verbositySettingKey: 'panelChat',
140140
provideContent(): string { return responseContent; },
141141
onClose() {
142142
widget.focus(focusedItem);

src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class DiffEditorHelperContribution extends Disposable implements IDiffEditorCont
6565
const keys = ['audioCues.diffLineDeleted', 'audioCues.diffLineInserted', 'audioCues.diffLineModified'];
6666

6767
accessibleViewService.show({
68-
id: 'diffEditor',
68+
verbositySettingKey: 'diffEditor',
6969
provideContent: () => [
7070
nls.localize('msg1', "You are in a diff editor."),
7171
nls.localize('msg2', "Press {0} or {1} to view the next or previous diff in the diff review mode that is optimized for screen readers.", next, previous),

src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function runAccessibilityHelpAction(accessor: ServicesAccessor, edi
4646
const accessibleViewService = accessor.get(IAccessibleViewService);
4747
const helpText = getAccessibilityHelpText(accessor);
4848
accessibleViewService.show({
49-
id: 'notebook',
49+
verbositySettingKey: 'notebook',
5050
provideContent: () => helpText,
5151
onClose: () => {
5252
editor.focus();

src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibilityHelp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export class TerminalAccessibleContentProvider extends Disposable implements IAc
3434
ariaLabel: localize('terminal-help-label', "terminal accessibility help"),
3535
readMoreUrl: 'https://code.visualstudio.com/docs/editor/accessibility#_terminal-accessibility'
3636
};
37-
id: string = 'terminal';
37+
verbositySettingKey: string = 'terminal';
3838

3939
constructor(
4040
private readonly _instance: Pick<ITerminalInstance, 'shellType' | 'capabilities' | 'onDidRequestFocus' | 'resource' | 'focus'>,

0 commit comments

Comments
 (0)