@@ -35,7 +35,7 @@ import {KeyMod} from 'vs/base/common/keyCodes';
3535import { QuickOpenHandler , QuickOpenHandlerDescriptor , IQuickOpenRegistry , Extensions , EditorQuickOpenEntry } from 'vs/workbench/browser/quickopen' ;
3636import errors = require( 'vs/base/common/errors' ) ;
3737import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService' ;
38- import { IPickOpenEntry , IInputOptions , IQuickOpenService , IPickOptions , IShowOptions } from 'vs/workbench/services/quickopen/common/quickOpenService' ;
38+ import { IPickOpenEntry , IFilePickOpenEntry , IInputOptions , IQuickOpenService , IPickOptions , IShowOptions } from 'vs/workbench/services/quickopen/common/quickOpenService' ;
3939import { IConfigurationService } from 'vs/platform/configuration/common/configuration' ;
4040import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
4141import { IMessageService , Severity } from 'vs/platform/message/common/message' ;
@@ -273,7 +273,8 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
273273 this . telemetryService
274274 ) ;
275275
276- this . pickOpenWidget . create ( ) ;
276+ const pickOpenContainer = this . pickOpenWidget . create ( ) ;
277+ DOM . addClass ( pickOpenContainer , 'show-file-icons' ) ;
277278 }
278279
279280 // Update otherwise
@@ -325,9 +326,9 @@ export class QuickOpenController extends WorkbenchComponent implements IQuickOpe
325326
326327 // Model
327328 const model = new QuickOpenModel ( ) ;
328- const entries = picks . map ( e => new PickOpenEntry ( e , ( ) => progress ( e ) ) ) ;
329+ const entries = picks . map ( e => this . instantiationService . createInstance ( PickOpenEntry , e , ( ) => progress ( e ) ) ) ;
329330 if ( picks . length === 0 ) {
330- entries . push ( new PickOpenEntry ( { label : nls . localize ( 'emptyPicks' , "There are no entries to pick from" ) } ) ) ;
331+ entries . push ( this . instantiationService . createInstance ( PickOpenEntry , { label : nls . localize ( 'emptyPicks' , "There are no entries to pick from" ) } , null ) ) ;
331332 }
332333
333334 model . setEntries ( entries ) ;
@@ -941,10 +942,13 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
941942 private hasSeparator : boolean ;
942943 private separatorLabel : string ;
943944 private alwaysShow : boolean ;
945+ private resource : URI ;
946+ private isFolder : boolean ;
944947
945948 constructor (
946949 item : IPickOpenEntry ,
947- private onPreview ?: ( ) => void
950+ private onPreview : ( ) => void ,
951+ @IModeService private modeService : IModeService
948952 ) {
949953 super ( item . label ) ;
950954
@@ -953,6 +957,16 @@ class PickOpenEntry extends PlaceholderQuickOpenEntry {
953957 this . hasSeparator = item . separator && item . separator . border ;
954958 this . separatorLabel = item . separator && item . separator . label ;
955959 this . alwaysShow = item . alwaysShow ;
960+
961+ const fileItem = < IFilePickOpenEntry > item ;
962+ this . resource = fileItem . resource ;
963+ this . isFolder = fileItem . isFolder ;
964+ }
965+
966+ public getLabelOptions ( ) : IIconLabelOptions {
967+ return {
968+ extraClasses : this . resource ? getIconClasses ( this . modeService , this . resource , this . isFolder ) : [ ]
969+ } ;
956970 }
957971
958972 public get shouldRunWithContext ( ) : IEntryRunContext {
@@ -1026,7 +1040,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry {
10261040
10271041 public getLabelOptions ( ) : IIconLabelOptions {
10281042 return {
1029- extraClasses : getIconClasses ( this . modeService , this . resource ) ,
1043+ extraClasses : getIconClasses ( this . modeService , this . resource )
10301044 } ;
10311045 }
10321046
0 commit comments