Clean up some usages of IDisposable[]

Part of #74250

- Extend `Disposable` in classes where it makes sense
- Use `DisposableStore` for lists of disposables
- Make `combinedDisposable` take arguments instead of an array (so that you can't pass in an array and then modify the array after the fact)
This commit is contained in:
Matt Bierner
2019-05-23 22:58:16 -07:00
parent 5e1f9440d2
commit 0f32f0ef5f
62 changed files with 396 additions and 468 deletions

View File

@@ -176,11 +176,11 @@ class MainThreadDocumentAndEditorStateComputer {
}
private _onDidAddEditor(e: ICodeEditor): void {
this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable([
this._toDisposeOnEditorRemove.set(e.getId(), combinedDisposable(
e.onDidChangeModel(() => this._updateState()),
e.onDidFocusEditorText(() => this._updateState()),
e.onDidFocusEditorWidget(() => this._updateState(e))
]));
));
this._updateState();
}