diff --git a/src/vs/platform/quickOpen/common/quickOpen.ts b/src/vs/platform/quickOpen/common/quickOpen.ts index 57cc17bc9cd..c6484ef828e 100644 --- a/src/vs/platform/quickOpen/common/quickOpen.ts +++ b/src/vs/platform/quickOpen/common/quickOpen.ts @@ -89,7 +89,7 @@ export interface IPickOptions { /** * an optional flag to make this picker multi-select (honoured by extension API) */ - canSelectMany?: boolean; + canPickMany?: boolean; } export interface IInputOptions { diff --git a/src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts b/src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts index 9ececdacf95..13c729d2384 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadQuickOpen.ts @@ -54,7 +54,7 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape { }; }); - if (options.canSelectMany) { + if (options.canPickMany) { return asWinJsPromise(token => this._quickInputService.pick(this._contents, options, token)).then(items => { if (items) { return items.map(item => item.handle); diff --git a/src/vs/workbench/api/node/extHostQuickOpen.ts b/src/vs/workbench/api/node/extHostQuickOpen.ts index d2f5e8bbaec..1b27e118913 100644 --- a/src/vs/workbench/api/node/extHostQuickOpen.ts +++ b/src/vs/workbench/api/node/extHostQuickOpen.ts @@ -29,7 +29,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { this._commands = commands; } - showQuickPick(itemsOrItemsPromise: QuickPickItem[] | Thenable, options: QuickPickOptions & { canSelectMany: true; }, token?: CancellationToken): Thenable; + showQuickPick(itemsOrItemsPromise: QuickPickItem[] | Thenable, options: QuickPickOptions & { canPickMany: true; }, token?: CancellationToken): Thenable; showQuickPick(itemsOrItemsPromise: string[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; showQuickPick(itemsOrItemsPromise: QuickPickItem[] | Thenable, options?: QuickPickOptions, token?: CancellationToken): Thenable; showQuickPick(itemsOrItemsPromise: Item[] | Thenable, options?: QuickPickOptions, token: CancellationToken = CancellationToken.None): Thenable { @@ -45,7 +45,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape { matchOnDescription: options && options.matchOnDescription, matchOnDetail: options && options.matchOnDetail, ignoreFocusLost: options && options.ignoreFocusOut, - canSelectMany: options && options.canPickMany + canPickMany: options && options.canPickMany }); const promise = TPromise.any([]>[quickPickWidget, itemsPromise]).then(values => { diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.css b/src/vs/workbench/browser/parts/quickinput/quickInput.css index 240530d12b2..7f27588f1ae 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.css +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.css @@ -32,7 +32,7 @@ flex-grow: 1; } -.quick-input-widget[data-type=selectMany] .quick-input-box { +.quick-input-widget[data-type=pickMany] .quick-input-box { margin-left: 5px; } diff --git a/src/vs/workbench/browser/parts/quickinput/quickInput.ts b/src/vs/workbench/browser/parts/quickinput/quickInput.ts index f82473876f9..ba5f2ae0d6b 100644 --- a/src/vs/workbench/browser/parts/quickinput/quickInput.ts +++ b/src/vs/workbench/browser/parts/quickinput/quickInput.ts @@ -37,15 +37,15 @@ import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/edi const $ = dom.$; -type InputParameters = SelectManyParameters | TextInputParameters; +type InputParameters = PickManyParameters | TextInputParameters; export interface BaseInputParameters { - readonly type: 'selectMany' | 'textInput'; + readonly type: 'pickMany' | 'textInput'; readonly ignoreFocusLost?: boolean; } -export interface SelectManyParameters extends BaseInputParameters { - readonly type: 'selectMany'; +export interface PickManyParameters extends BaseInputParameters { + readonly type: 'pickMany'; readonly picks: TPromise; readonly matchOnDescription?: boolean; readonly matchOnDetail?: boolean; @@ -77,7 +77,7 @@ interface InputController { readonly resolve: (ok?: true | Thenable) => void | TPromise; } -class SelectManyController implements InputController { +class PickManyController implements InputController { public showUI = { checkAll: true, inputBox: true, count: true, ok: true, checkboxList: true }; public result: TPromise; public ready: TPromise; @@ -85,7 +85,7 @@ class SelectManyController implements InputController< public progress: (value: T) => void; private closed = false; - constructor(ui: QuickInputUI, parameters: SelectManyParameters) { + constructor(ui: QuickInputUI, parameters: PickManyParameters) { this.result = new TPromise((resolve, reject, progress) => { this.resolve = ok => resolve(ok === true ? ui.checkboxList.getCheckedElements() : ok); this.progress = progress; @@ -315,7 +315,7 @@ export class QuickInputService extends Component implements IQuickInputService { .map(e => e[0]) .filter(e => !!e) .latch() - .on(e => this.controller instanceof SelectManyController && this.controller.progress(e)) // TODO + .on(e => this.controller instanceof PickManyController && this.controller.progress(e)) // TODO ); this.toUnbind.push(dom.addDisposableListener(this.container, 'focusout', (e: FocusEvent) => { @@ -400,7 +400,7 @@ export class QuickInputService extends Component implements IQuickInputService { pick(picks: TPromise, options: IPickOptions = {}, token?: CancellationToken): TPromise { return this.show({ - type: 'selectMany', + type: 'pickMany', picks, placeHolder: options.placeHolder, matchOnDescription: options.matchOnDescription, @@ -422,7 +422,7 @@ export class QuickInputService extends Component implements IQuickInputService { }, token); } - show(parameters: SelectManyParameters, token?: CancellationToken): TPromise; + show(parameters: PickManyParameters, token?: CancellationToken): TPromise; show(parameters: TextInputParameters, token?: CancellationToken): TPromise; show(parameters: InputParameters, token: CancellationToken = CancellationToken.None): TPromise { this.create(); @@ -438,7 +438,7 @@ export class QuickInputService extends Component implements IQuickInputService { this.progressBar.stop(); this.ready = false; - this.controller = parameters.type === 'selectMany' ? new SelectManyController(this.ui, parameters) : new TextInputController(this.ui, parameters); + this.controller = parameters.type === 'pickMany' ? new PickManyController(this.ui, parameters) : new TextInputController(this.ui, parameters); this.ui.checkAll.style.display = this.controller.showUI.checkAll ? null : 'none'; this.filterContainer.style.display = this.controller.showUI.inputBox ? null : 'none'; this.ui.inputBox.showDecoration(Severity.Ignore);