Revert disposing of emitter change for extHostQuickOpen since it was breaking integration tests
This commit is contained in:
parent
b7f31aa595
commit
bd39f3d7a1
1 changed files with 19 additions and 10 deletions
|
@ -6,7 +6,7 @@
|
|||
import { asPromise } from 'vs/base/common/async';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ExtHostCommands } from 'vs/workbench/api/common/extHostCommands';
|
||||
import { IExtHostWorkspaceProvider } from 'vs/workbench/api/common/extHostWorkspace';
|
||||
import { InputBox, InputBoxOptions, QuickInput, QuickInputButton, QuickPick, QuickPickItem, QuickPickOptions, WorkspaceFolder, WorkspaceFolderPickOptions } from 'vscode';
|
||||
|
@ -229,7 +229,7 @@ export class ExtHostQuickOpen implements ExtHostQuickOpenShape {
|
|||
}
|
||||
}
|
||||
|
||||
class ExtHostQuickInput extends Disposable implements QuickInput {
|
||||
class ExtHostQuickInput implements QuickInput {
|
||||
|
||||
private static _nextId = 1;
|
||||
_id = ExtHostQuickPick._nextId++;
|
||||
|
@ -246,17 +246,22 @@ class ExtHostQuickInput extends Disposable implements QuickInput {
|
|||
private _placeholder: string;
|
||||
private _buttons: QuickInputButton[] = [];
|
||||
private _handlesToButtons = new Map<number, QuickInputButton>();
|
||||
private _onDidAcceptEmitter = this._register(new Emitter<void>());
|
||||
private _onDidChangeValueEmitter = this._register(new Emitter<string>());
|
||||
private _onDidTriggerButtonEmitter = this._register(new Emitter<QuickInputButton>());
|
||||
private _onDidHideEmitter = this._register(new Emitter<void>());
|
||||
private _onDidAcceptEmitter = new Emitter<void>();
|
||||
private _onDidChangeValueEmitter = new Emitter<string>();
|
||||
private _onDidTriggerButtonEmitter = new Emitter<QuickInputButton>();
|
||||
private _onDidHideEmitter = new Emitter<void>();
|
||||
private _updateTimeout: any;
|
||||
private _pendingUpdate: TransferQuickInput = { id: this._id };
|
||||
|
||||
private _disposed = false;
|
||||
protected _disposables: IDisposable[] = [
|
||||
this._onDidTriggerButtonEmitter,
|
||||
this._onDidHideEmitter,
|
||||
this._onDidAcceptEmitter,
|
||||
this._onDidChangeValueEmitter
|
||||
];
|
||||
|
||||
constructor(protected _proxy: MainThreadQuickOpenShape, protected _extensionId: ExtensionIdentifier, private _onDidDispose: () => void) {
|
||||
super();
|
||||
}
|
||||
|
||||
get title() {
|
||||
|
@ -397,9 +402,9 @@ class ExtHostQuickInput extends Disposable implements QuickInput {
|
|||
if (this._disposed) {
|
||||
return;
|
||||
}
|
||||
super.dispose();
|
||||
this._disposed = true;
|
||||
this._fireDidHide();
|
||||
this._disposables = dispose(this._disposables);
|
||||
if (this._updateTimeout) {
|
||||
clearTimeout(this._updateTimeout);
|
||||
this._updateTimeout = undefined;
|
||||
|
@ -481,12 +486,16 @@ class ExtHostQuickPick<T extends QuickPickItem> extends ExtHostQuickInput implem
|
|||
private _matchOnDescription = true;
|
||||
private _matchOnDetail = true;
|
||||
private _activeItems: T[] = [];
|
||||
private _onDidChangeActiveEmitter = this._register(new Emitter<T[]>());
|
||||
private _onDidChangeActiveEmitter = new Emitter<T[]>();
|
||||
private _selectedItems: T[] = [];
|
||||
private _onDidChangeSelectionEmitter = this._register(new Emitter<T[]>());
|
||||
private _onDidChangeSelectionEmitter = new Emitter<T[]>();
|
||||
|
||||
constructor(proxy: MainThreadQuickOpenShape, extensionId: ExtensionIdentifier, enableProposedApi: boolean, onDispose: () => void) {
|
||||
super(proxy, extensionId, onDispose);
|
||||
this._disposables.push(
|
||||
this._onDidChangeActiveEmitter,
|
||||
this._onDidChangeSelectionEmitter,
|
||||
);
|
||||
this.update({ type: 'quickPick' });
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue