@@ -50,6 +50,8 @@ import { timeout } from 'vs/base/common/async';
5050import { IQuickInputService , IQuickPickItem } from 'vs/platform/quickinput/common/quickInput' ;
5151import { CancellationTokenSource , CancellationToken } from 'vs/base/common/cancellation' ;
5252import { IStorageService } from 'vs/platform/storage/common/storage' ;
53+ import { registerSingleton } from 'vs/platform/instantiation/common/extensions' ;
54+ import { ILayoutService } from 'vs/platform/layout/browser/layoutService' ;
5355
5456const HELP_PREFIX = '?' ;
5557
@@ -73,7 +75,6 @@ export class QuickOpenController extends Component implements IQuickOpenService
7375 private lastInputValue : string ;
7476 private lastSubmittedInputValue : string ;
7577 private quickOpenWidget : QuickOpenWidget ;
76- private dimension : Dimension ;
7778 private mapResolvedHandlersToPrefix : { [ prefix : string ] : Promise < QuickOpenHandler > ; } = Object . create ( null ) ;
7879 private mapContextKeyToContext : { [ id : string ] : IContextKey < boolean > ; } = Object . create ( null ) ;
7980 private handlerOnOpenCalled : { [ prefix : string ] : boolean ; } = Object . create ( null ) ;
@@ -94,7 +95,8 @@ export class QuickOpenController extends Component implements IQuickOpenService
9495 @IPartService private readonly partService : IPartService ,
9596 @IEnvironmentService private readonly environmentService : IEnvironmentService ,
9697 @IThemeService themeService : IThemeService ,
97- @IStorageService storageService : IStorageService
98+ @IStorageService storageService : IStorageService ,
99+ @ILayoutService private readonly layoutService : ILayoutService
98100 ) {
99101 super ( QuickOpenController . ID , themeService , storageService ) ;
100102
@@ -109,6 +111,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
109111 this . _register ( this . configurationService . onDidChangeConfiguration ( ( ) => this . updateConfiguration ( ) ) ) ;
110112 this . _register ( this . partService . onTitleBarVisibilityChange ( ( ) => this . positionQuickOpenWidget ( ) ) ) ;
111113 this . _register ( browser . onDidChangeZoomLevel ( ( ) => this . positionQuickOpenWidget ( ) ) ) ;
114+ this . _register ( this . layoutService . onLayout ( dimension => this . layout ( dimension ) ) ) ;
112115 }
113116
114117 private updateConfiguration ( ) : void {
@@ -195,9 +198,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
195198 }
196199
197200 // Layout
198- if ( this . dimension ) {
199- this . quickOpenWidget . layout ( this . dimension ) ;
200- }
201+ this . quickOpenWidget . layout ( this . layoutService . dimension ) ;
201202
202203 // Show quick open with prefix or editor history
203204 if ( ! this . quickOpenWidget . isVisible ( ) || quickNavigateConfiguration ) {
@@ -624,9 +625,8 @@ export class QuickOpenController extends Component implements IQuickOpenService
624625 }
625626
626627 layout ( dimension : Dimension ) : void {
627- this . dimension = dimension ;
628628 if ( this . quickOpenWidget ) {
629- this . quickOpenWidget . layout ( this . dimension ) ;
629+ this . quickOpenWidget . layout ( dimension ) ;
630630 }
631631 }
632632}
@@ -863,3 +863,5 @@ export class RemoveFromEditorHistoryAction extends Action {
863863 } ) ;
864864 }
865865}
866+
867+ registerSingleton ( IQuickOpenService , QuickOpenController , true ) ;
0 commit comments