mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 02:28:34 +01:00
Fix timing issue (fixes #61748)
This commit is contained in:
@@ -28,6 +28,8 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
|
||||
private _sessions = new Map<number, ExtHostQuickInput>();
|
||||
|
||||
private _instances = 0;
|
||||
|
||||
constructor(mainContext: IMainContext, workspace: ExtHostWorkspace, commands: ExtHostCommands) {
|
||||
this._proxy = mainContext.getProxy(MainContext.MainThreadQuickOpen);
|
||||
this._workspace = workspace;
|
||||
@@ -44,7 +46,9 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
|
||||
const itemsPromise = <Promise<Item[]>>Promise.resolve(itemsOrItemsPromise);
|
||||
|
||||
const quickPickWidget = this._proxy.$show({
|
||||
const instance = ++this._instances;
|
||||
|
||||
const quickPickWidget = this._proxy.$show(instance, {
|
||||
placeHolder: options && options.placeHolder,
|
||||
matchOnDescription: options && options.matchOnDescription,
|
||||
matchOnDetail: options && options.matchOnDetail,
|
||||
@@ -99,7 +103,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
}
|
||||
|
||||
// show items
|
||||
this._proxy.$setItems(pickItems);
|
||||
this._proxy.$setItems(instance, pickItems);
|
||||
|
||||
return quickPickWidget.then(handle => {
|
||||
if (typeof handle === 'number') {
|
||||
@@ -115,7 +119,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
this._proxy.$setError(err);
|
||||
this._proxy.$setError(instance, err);
|
||||
|
||||
return Promise.reject(err);
|
||||
});
|
||||
@@ -140,8 +144,6 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
this._proxy.$setError(err);
|
||||
|
||||
return Promise.reject(err);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user