@@ -94,7 +94,11 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<IPickerQuic
94
94
picker . customButton = true ;
95
95
picker . customLabel = '$(link-external)' ;
96
96
picker . onDidCustom ( ( ) => {
97
- this . moveToSearchViewlet ( undefined ) ;
97
+ if ( this . searchModel . searchResult . count ( ) > 0 ) {
98
+ this . moveToSearchViewlet ( undefined ) ;
99
+ } else {
100
+ this . _viewsService . openView ( VIEW_ID , true ) ;
101
+ }
98
102
picker . hide ( ) ;
99
103
} ) ;
100
104
disposables . add ( super . provide ( picker , token , runOptions ) ) ;
@@ -279,21 +283,23 @@ export class TextSearchQuickAccess extends PickerQuickAccessProvider<IPickerQuic
279
283
280
284
protected _getPicks ( contentPattern : string , disposables : DisposableStore , token : CancellationToken ) : Picks < IQuickPickItem > | Promise < Picks < IQuickPickItem > | FastAndSlowPicks < IQuickPickItem > > | FastAndSlowPicks < IQuickPickItem > | null {
281
285
282
- const conditionalTokenCts = disposables . add ( new CancellationTokenSource ( ) ) ;
283
-
284
286
const searchModelAtTimeOfSearch = this . searchModel ;
287
+ if ( contentPattern === '' ) {
288
+
289
+ this . searchModel . searchResult . clear ( ) ;
290
+ return [ {
291
+ label : localize ( 'enterSearchTerm' , "Enter a term to search for across your files." )
292
+ } ] ;
293
+ }
294
+
295
+ const conditionalTokenCts = disposables . add ( new CancellationTokenSource ( ) ) ;
285
296
286
297
disposables . add ( token . onCancellationRequested ( ( ) => {
287
298
if ( searchModelAtTimeOfSearch . location === SearchModelLocation . QUICK_ACCESS ) {
288
299
// if the search model has not been imported to the panel, you can cancel
289
300
conditionalTokenCts . cancel ( ) ;
290
301
}
291
302
} ) ) ;
292
-
293
- if ( contentPattern === '' ) {
294
- this . searchModel . searchResult . clear ( ) ;
295
- return [ ] ;
296
- }
297
303
const allMatches = this . doSearch ( contentPattern , conditionalTokenCts . token ) ;
298
304
299
305
if ( ! allMatches ) {
0 commit comments