diff --git a/packages/plugin-ext/src/common/plugin-api-rpc.ts b/packages/plugin-ext/src/common/plugin-api-rpc.ts index 55d5960bb9657..5ccf3ed3c7c99 100644 --- a/packages/plugin-ext/src/common/plugin-api-rpc.ts +++ b/packages/plugin-ext/src/common/plugin-api-rpc.ts @@ -555,7 +555,7 @@ export interface TransferQuickInputButton extends theia.QuickInputButton { handle?: number; } -export type TransferQuickInput = TransferQuickPick | TransferInputBox; +export type TransferQuickInput = TransferQuickPick | TransferInputBox; export interface BaseTransferQuickInput { [key: string]: any; @@ -566,14 +566,14 @@ export interface BaseTransferQuickInput { visible?: boolean; } -export interface TransferQuickPick extends BaseTransferQuickInput { +export interface TransferQuickPick extends BaseTransferQuickInput { type?: 'quickPick'; value?: string; placeholder?: string; buttons?: TransferQuickInputButton[]; items?: TransferQuickPickItems[]; - activeItems?: ReadonlyArray; - selectedItems?: ReadonlyArray; + activeItems?: ReadonlyArray; + selectedItems?: ReadonlyArray; canSelectMany?: boolean; ignoreFocusOut?: boolean; matchOnDescription?: boolean; @@ -605,7 +605,7 @@ export interface QuickOpenMain { $setItems(instance: number, items: TransferQuickPickItems[]): Promise; $setError(instance: number, error: Error): Promise; $input(options: theia.InputBoxOptions, validateInput: boolean, token: CancellationToken): Promise; - $createOrUpdate(params: TransferQuickInput): Promise; + $createOrUpdate(params: TransferQuickInput): Promise; $dispose(id: number): Promise; $hide(): void; diff --git a/packages/plugin-ext/src/main/browser/quick-open-main.ts b/packages/plugin-ext/src/main/browser/quick-open-main.ts index 5c2fd8d46213f..a31d26c46a0ba 100644 --- a/packages/plugin-ext/src/main/browser/quick-open-main.ts +++ b/packages/plugin-ext/src/main/browser/quick-open-main.ts @@ -194,7 +194,7 @@ export class QuickOpenMainImpl implements QuickOpenMain, Disposable { private sessions = new Map(); - $createOrUpdate(params: TransferQuickInput): Promise { + $createOrUpdate(params: TransferQuickInput): Promise { const sessionId = params.id; let session = this.sessions.get(sessionId); if (!session) { diff --git a/packages/plugin-ext/src/plugin/quick-open.ts b/packages/plugin-ext/src/plugin/quick-open.ts index c4d900f7c167d..172571a9ec495 100644 --- a/packages/plugin-ext/src/plugin/quick-open.ts +++ b/packages/plugin-ext/src/plugin/quick-open.ts @@ -259,7 +259,7 @@ export class QuickInputExt implements QuickInput { private onDidHideEmitter: Emitter; private onDidTriggerButtonEmitter: Emitter; private _updateTimeout: any; - private _pendingUpdate: TransferQuickInput = { id: this._id }; + private _pendingUpdate: TransferQuickInput = { id: this._id }; constructor(readonly quickOpen: QuickOpenExtImpl, readonly quickOpenMain: QuickOpenMain, readonly plugin: Plugin, private _onDidDispose: () => void) { this.title = undefined; @@ -613,9 +613,16 @@ export class QuickPickExt extends QuickInputExt i this._handlesToItems.set(i, item); this._itemsToHandles.set(item, i); }); - items.forEach((item, i) => Object.assign(item, { handle: i })); this.update({ - items + items: items.map((item, i) => ({ + type: item.type, + label: item.label, + description: item.description, + handle: i, + detail: item.detail, + picked: item.picked, + alwaysShow: item.alwaysShow + })) }); }