@@ -17,7 +17,7 @@ import { GotoDefinitionAtPositionEditorContribution } from 'vs/editor/contrib/go
17
17
import { HoverStartMode , HoverStartSource } from 'vs/editor/contrib/hover/browser/hoverOperation' ;
18
18
import { ContentHoverWidget , ContentHoverController } from 'vs/editor/contrib/hover/browser/contentHover' ;
19
19
import { MarginHoverWidget } from 'vs/editor/contrib/hover/browser/marginHover' ;
20
- import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility' ;
20
+ import { AccessibilitySupport , IAccessibilityService } from 'vs/platform/accessibility/common/accessibility' ;
21
21
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
22
22
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
23
23
import { IOpenerService } from 'vs/platform/opener/common/opener' ;
@@ -31,6 +31,8 @@ import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
31
31
import { ResultKind } from 'vs/platform/keybinding/common/keybindingResolver' ;
32
32
import * as nls from 'vs/nls' ;
33
33
import 'vs/css!./hover' ;
34
+ import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
35
+ import { status } from 'vs/base/browser/ui/aria/aria' ;
34
36
35
37
// sticky hover widget which doesn't disappear on focus out and such
36
38
const _sticky = false
@@ -361,6 +363,9 @@ class ShowOrFocusHoverAction extends EditorAction {
361
363
}
362
364
363
365
public run ( accessor : ServicesAccessor , editor : ICodeEditor , args : any ) : void {
366
+ const configurationService = accessor . get ( IConfigurationService ) ;
367
+ const accessibilityService = accessor . get ( IAccessibilityService ) ;
368
+ const keybindingService = accessor . get ( IKeybindingService ) ;
364
369
if ( ! editor . hasModel ( ) ) {
365
370
return ;
366
371
}
@@ -377,6 +382,11 @@ class ShowOrFocusHoverAction extends EditorAction {
377
382
} else {
378
383
controller . showContentHover ( range , HoverStartMode . Immediate , HoverStartSource . Keyboard , focus ) ;
379
384
}
385
+ if ( configurationService . getValue ( 'accessibility.verbosity.hover' ) && accessibilityService . isScreenReaderOptimized ( ) ) {
386
+ const keybinding = keybindingService . lookupKeybinding ( 'editor.action.accessibleView' ) ?. getAriaLabel ( ) ;
387
+ const hint = keybinding ? nls . localize ( 'chatAccessibleViewHint' , "Inspect this in the accessible view with {0}" , keybinding ) : nls . localize ( 'chatAccessibleViewHintNoKb' , "Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding" ) ;
388
+ status ( hint ) ;
389
+ }
380
390
}
381
391
}
382
392
0 commit comments