onDidSelectItem (#45589)

This commit is contained in:
Christof Marti
2018-03-26 22:23:09 +02:00
parent 1c0aa2e870
commit ecce88d774
4 changed files with 38 additions and 26 deletions

View File

@@ -54,29 +54,29 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
};
});
return asWinJsPromise<number | number[]>(token => {
if (options.canSelectMany) {
return this._quickInputService.pick(this._contents, options, token)
.then(items => {
if (items) {
return items.map(item => item.handle);
}
return undefined;
});
} else {
return this._quickOpenService.pick(this._contents, options, token)
.then(item => {
if (item) {
return item.handle;
}
return undefined;
});
}
}).then(undefined, undefined, progress => {
if (progress) {
this._proxy.$onItemSelected((<MyQuickPickItems>progress).handle);
}
});
if (options.canSelectMany) {
return asWinJsPromise(token => this._quickInputService.pick(this._contents, options, token)).then(items => {
if (items) {
return items.map(item => item.handle);
}
return undefined;
}, undefined, progress => {
if (progress) {
this._proxy.$onItemSelected((<MyQuickPickItems>progress).handle);
}
});
} else {
return asWinJsPromise(token => this._quickOpenService.pick(this._contents, options, token)).then(item => {
if (item) {
return item.handle;
}
return undefined;
}, undefined, progress => {
if (progress) {
this._proxy.$onItemSelected((<MyQuickPickItems>progress).handle);
}
});
}
}
$setItems(items: MyQuickPickItems[]): TPromise<any> {