File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -67,6 +67,10 @@ export class PluginHostQuickOpen {
6767 return items [ handle ] ;
6868 }
6969 } ) ;
70+ } , ( err ) => {
71+ this . _proxy . _setError ( err ) ;
72+
73+ return TPromise . wrapError ( err ) ;
7074 } ) ;
7175 }
7276
@@ -80,6 +84,7 @@ export class MainThreadQuickOpen {
8084
8185 private _quickOpenService : IQuickOpenService ;
8286 private _doSetItems : ( items : MyQuickPickItems [ ] ) => any ;
87+ private _doSetError : ( error : Error ) => any ;
8388 private _contents : TPromise < MyQuickPickItems [ ] > ;
8489 private _token = 0 ;
8590
@@ -97,6 +102,12 @@ export class MainThreadQuickOpen {
97102 c ( items ) ;
98103 }
99104 } ;
105+
106+ this . _doSetError = ( error ) => {
107+ if ( myToken === this . _token ) {
108+ e ( error ) ;
109+ }
110+ } ;
100111 } ) ;
101112
102113 return this . _quickOpenService . pick ( this . _contents , options ) . then ( item => {
@@ -113,6 +124,13 @@ export class MainThreadQuickOpen {
113124 }
114125 }
115126
127+ _setError ( error : Error ) : Thenable < any > {
128+ if ( this . _doSetError ) {
129+ this . _doSetError ( error ) ;
130+ return ;
131+ }
132+ }
133+
116134 _input ( options ?: InputBoxOptions ) : Thenable < string > {
117135 return this . _quickOpenService . input ( options ) ;
118136 }
Original file line number Diff line number Diff line change @@ -209,7 +209,11 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
209209 onOk : ( ) => { /* ignore, handle later */ } ,
210210 onCancel : ( ) => { /* ignore, handle later */ } ,
211211 onType : ( value : string ) => { /* ignore, handle later */ } ,
212- onShow : ( ) => this . emitQuickOpenVisibilityChange ( true )
212+ onShow : ( ) => this . emitQuickOpenVisibilityChange ( true ) ,
213+ onHide : ( ) => {
214+ this . restoreFocus ( ) ; // focus back to editor or viewlet
215+ this . emitQuickOpenVisibilityChange ( false ) ; // event
216+ }
213217 } , {
214218 inputPlaceHolder : options . placeHolder || ''
215219 } ,
You can’t perform that action at this time.
0 commit comments