上级 70f303ae
......@@ -2856,7 +2856,7 @@ declare module 'vscode' {
text: string;
detail: string;
command: Command | undefined;
// accessibilityInformation?: AccessibilityInformation; TODO@API
accessibilityInformation?: AccessibilityInformation;
dispose(): void;
}
......
......@@ -105,7 +105,8 @@ export class ExtHostLanguages implements ExtHostLanguagesShape {
label: data.text,
detail: data.detail,
severity: data.severity === LanguageStatusSeverity.Error ? Severity.Error : data.severity === LanguageStatusSeverity.Warning ? Severity.Warning : Severity.Info,
command: data.command && this._commands.toInternal(data.command, commandDisposables)
command: data.command && this._commands.toInternal(data.command, commandDisposables),
accessibilityInfo: data.accessibilityInformation
});
}, 0);
};
......@@ -154,6 +155,13 @@ export class ExtHostLanguages implements ExtHostLanguagesShape {
data.severity = value;
updateAsync();
},
get accessibilityInformation() {
return data.accessibilityInformation;
},
set accessibilityInformation(value) {
data.accessibilityInformation = value;
updateAsync();
},
get command() {
return data.command;
},
......
......@@ -270,7 +270,8 @@ class EditorStatusContribution implements IWorkbenchContribution {
return {
name: item.name,
text: item.label,
ariaLabel: item.label,
ariaLabel: item.accessibilityInfo?.label ?? item.label,
role: item.accessibilityInfo?.role,
tooltip: new MarkdownString(item.detail, true),
command: item.command
};
......
......@@ -11,6 +11,7 @@ import { ITextModel } from 'vs/editor/common/model';
import { Command } from 'vs/editor/common/modes';
import { LanguageFeatureRegistry } from 'vs/editor/common/modes/languageFeatureRegistry';
import { LanguageSelector } from 'vs/editor/common/modes/languageSelector';
import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility';
import { registerSingleton } from 'vs/platform/instantiation/common/extensions';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
......@@ -25,6 +26,7 @@ export interface ILanguageStatus {
readonly detail: string;
readonly source: string;
readonly command: Command | undefined;
readonly accessibilityInfo: IAccessibilityInformation | undefined;
}
export interface ILanguageStatusProvider {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册