@@ -17,14 +17,14 @@ import { Disposable, DisposableStore, dispose } from '../../../base/common/lifec
1717import Severity from '../../../base/common/severity.js' ;
1818import { isString } from '../../../base/common/types.js' ;
1919import { localize } from '../../../nls.js' ;
20- import { IInputBox , IInputOptions , IKeyMods , IPickOptions , IQuickInput , IQuickInputButton , IQuickNavigateConfiguration , IQuickPick , IQuickPickItem , IQuickWidget , QuickInputHideReason , QuickPickInput , QuickPickFocus } from '../common/quickInput.js' ;
20+ import { IInputBox , IInputOptions , IKeyMods , IPickOptions , IQuickInput , IQuickInputButton , IQuickNavigateConfiguration , IQuickPick , IQuickPickItem , IQuickWidget , QuickInputHideReason , QuickPickInput , QuickPickFocus , QuickInputType } from '../common/quickInput.js' ;
2121import { QuickInputBox } from './quickInputBox.js' ;
2222import { QuickInputUI , Writeable , IQuickInputStyles , IQuickInputOptions , QuickPick , backButton , InputBox , Visibilities , QuickWidget , InQuickInputContextKey , QuickInputTypeContextKey , EndOfQuickInputBoxContextKey , QuickInputAlignmentContextKey } from './quickInput.js' ;
2323import { ILayoutService } from '../../layout/browser/layoutService.js' ;
2424import { mainWindow } from '../../../base/browser/window.js' ;
2525import { IInstantiationService } from '../../instantiation/common/instantiation.js' ;
2626import { QuickInputTree } from './quickInputTree.js' ;
27- import { IContextKeyService } from '../../contextkey/common/contextkey.js' ;
27+ import { IContextKey , IContextKeyService } from '../../contextkey/common/contextkey.js' ;
2828import './quickInputActions.js' ;
2929import { autorun , observableValue } from '../../../base/common/observable.js' ;
3030import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js' ;
@@ -75,18 +75,23 @@ export class QuickInputController extends Disposable {
7575 private viewState : QuickInputViewState | undefined ;
7676 private dndController : QuickInputDragAndDropController | undefined ;
7777
78- private readonly inQuickInputContext = InQuickInputContextKey . bindTo ( this . contextKeyService ) ;
79- private readonly quickInputTypeContext = QuickInputTypeContextKey . bindTo ( this . contextKeyService ) ;
80- private readonly endOfQuickInputBoxContext = EndOfQuickInputBoxContextKey . bindTo ( this . contextKeyService ) ;
78+ private readonly inQuickInputContext : IContextKey < boolean > ;
79+ private readonly quickInputTypeContext : IContextKey < QuickInputType > ;
80+ private readonly endOfQuickInputBoxContext : IContextKey < boolean > ;
8181
8282 constructor (
8383 private options : IQuickInputOptions ,
8484 @ILayoutService private readonly layoutService : ILayoutService ,
8585 @IInstantiationService private readonly instantiationService : IInstantiationService ,
86- @IContextKeyService private readonly contextKeyService : IContextKeyService ,
86+ @IContextKeyService contextKeyService : IContextKeyService ,
8787 @IStorageService private readonly storageService : IStorageService
8888 ) {
8989 super ( ) ;
90+
91+ this . inQuickInputContext = InQuickInputContextKey . bindTo ( contextKeyService ) ;
92+ this . quickInputTypeContext = QuickInputTypeContextKey . bindTo ( contextKeyService ) ;
93+ this . endOfQuickInputBoxContext = EndOfQuickInputBoxContextKey . bindTo ( contextKeyService ) ;
94+
9095 this . idPrefix = options . idPrefix ;
9196 this . _container = options . container ;
9297 this . styles = options . styles ;
@@ -911,18 +916,19 @@ class QuickInputDragAndDropController extends Disposable {
911916 private readonly _controlsOnLeft : boolean ;
912917 private readonly _controlsOnRight : boolean ;
913918
914- private _quickInputAlignmentContext = QuickInputAlignmentContextKey . bindTo ( this . _contextKeyService ) ;
919+ private _quickInputAlignmentContext : IContextKey < 'center' | 'top' | undefined > ;
915920
916921 constructor (
917922 private _container : HTMLElement ,
918923 private readonly _quickInputContainer : HTMLElement ,
919924 private _quickInputDragAreas : { node : HTMLElement ; includeChildren : boolean } [ ] ,
920925 initialViewState : QuickInputViewState | undefined ,
921926 @ILayoutService private readonly _layoutService : ILayoutService ,
922- @IContextKeyService private readonly _contextKeyService : IContextKeyService ,
927+ @IContextKeyService contextKeyService : IContextKeyService ,
923928 @IConfigurationService private readonly configurationService : IConfigurationService
924929 ) {
925930 super ( ) ;
931+ this . _quickInputAlignmentContext = QuickInputAlignmentContextKey . bindTo ( contextKeyService ) ;
926932 const customWindowControls = getWindowControlsStyle ( this . configurationService ) === WindowControlsStyle . CUSTOM ;
927933
928934 // Do not allow the widget to overflow or underflow window controls.
0 commit comments