Skip to content

Commit

Permalink
Use QuickInput (#29096)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Aug 10, 2018
1 parent cd1f0f2 commit 8daf1f2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/vs/workbench/browser/parts/quickopen/quickOpenController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import { IEditorService, ACTIVE_GROUP, SIDE_GROUP } from 'vs/workbench/services/
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay';
import { isThenable, timeout } from 'vs/base/common/async';
import { IQuickInputService, IQuickPickItem } from 'vs/platform/quickinput/common/quickInput';

const HELP_PREFIX = '?';

Expand Down Expand Up @@ -1251,15 +1252,17 @@ export class RemoveFromEditorHistoryAction extends Action {
constructor(
id: string,
label: string,
@IQuickOpenService private quickOpenService: IQuickOpenService,
@IQuickInputService private quickInputService: IQuickInputService,
@IModelService private modelService: IModelService,
@IModeService private modeService: IModeService,
@IInstantiationService private instantiationService: IInstantiationService,
@IHistoryService private historyService: IHistoryService
) {
super(id, label);
}

run(): TPromise<any> {
interface IHistoryPickEntry extends IFilePickOpenEntry {
interface IHistoryPickEntry extends IQuickPickItem {
input: IEditorInput | IResourceInput;
}

Expand All @@ -1269,13 +1272,13 @@ export class RemoveFromEditorHistoryAction extends Action {

return <IHistoryPickEntry>{
input: h,
resource: entry.getResource(),
iconClasses: getIconClasses(this.modelService, this.modeService, entry.getResource()),
label: entry.getLabel(),
description: entry.getDescription()
};
});

return this.quickOpenService.pick(picks, { placeHolder: nls.localize('pickHistory', "Select an editor entry to remove from history"), autoFocus: { autoFocusFirstEntry: true }, matchOnDescription: true }).then(pick => {
return this.quickInputService.pick(picks, { placeHolder: nls.localize('pickHistory', "Select an editor entry to remove from history"), matchOnDescription: true }).then(pick => {
if (pick) {
this.historyService.remove(pick.input);
}
Expand Down

0 comments on commit 8daf1f2

Please sign in to comment.