@@ -16,6 +16,7 @@ import { AccessibilityHelpNLS } from 'vs/editor/common/standaloneStrings';
1616import { LinkDetector } from 'vs/editor/contrib/links/browser/links' ;
1717import { localize } from 'vs/nls' ;
1818import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
19+ import { IContextKey , IContextKeyService , RawContextKey } from 'vs/platform/contextkey/common/contextkey' ;
1920import { IContextViewDelegate , IContextViewService } from 'vs/platform/contextview/browser/contextView' ;
2021import { IInstantiationService , createDecorator } from 'vs/platform/instantiation/common/instantiation' ;
2122import { IOpenerService } from 'vs/platform/opener/common/opener' ;
@@ -56,20 +57,23 @@ export interface IAccessibleViewOptions {
5657 type : AccessibleViewType ;
5758}
5859
60+ export const accessibilityHelpIsShown = new RawContextKey < boolean > ( 'accessibilityHelpIsShown' , false , true ) ;
5961class AccessibleView extends Disposable {
6062 private _editorWidget : CodeEditorWidget ;
63+ private _accessiblityHelpIsShown : IContextKey < boolean > ;
6164 get editorWidget ( ) { return this . _editorWidget ; }
6265 private _editorContainer : HTMLElement ;
6366 private _keyListener : IDisposable | undefined ;
64-
6567 constructor (
6668 @IOpenerService private readonly _openerService : IOpenerService ,
6769 @IInstantiationService private readonly _instantiationService : IInstantiationService ,
6870 @IConfigurationService private readonly _configurationService : IConfigurationService ,
6971 @IModelService private readonly _modelService : IModelService ,
70- @IContextViewService private readonly _contextViewService : IContextViewService
72+ @IContextViewService private readonly _contextViewService : IContextViewService ,
73+ @IContextKeyService private readonly _contextKeyService : IContextKeyService
7174 ) {
7275 super ( ) ;
76+ this . _accessiblityHelpIsShown = accessibilityHelpIsShown . bindTo ( this . _contextKeyService ) ;
7377 this . _editorContainer = document . createElement ( 'div' ) ;
7478 this . _editorContainer . classList . add ( 'accessible-view' ) ;
7579 const codeEditorWidgetOptions : ICodeEditorWidgetOptions = {
@@ -96,9 +100,17 @@ class AccessibleView extends Disposable {
96100 getAnchor : ( ) => this . _editorContainer ,
97101 render : ( container ) => {
98102 return this . _render ( provider , container ) ;
103+ } ,
104+ onHide : ( ) => {
105+ if ( provider . options . type === AccessibleViewType . HelpMenu ) {
106+ this . _accessiblityHelpIsShown . reset ( ) ;
107+ }
99108 }
100109 } ;
101110 this . _contextViewService . showContextView ( delegate ) ;
111+ if ( provider . options . type === AccessibleViewType . HelpMenu ) {
112+ this . _accessiblityHelpIsShown . set ( true ) ;
113+ }
102114 }
103115
104116 private _render ( provider : IAccessibleContentProvider , container : HTMLElement ) : IDisposable {
0 commit comments