diff --git a/src/vs/workbench/browser/parts/views/customView.ts b/src/vs/workbench/browser/parts/views/customView.ts index 0839048d11ba7cc042f6de80ead51ffe451cc568..52eb7f7031a0449f8a54655723d727b430d97d50 100644 --- a/src/vs/workbench/browser/parts/views/customView.ts +++ b/src/vs/workbench/browser/parts/views/customView.ts @@ -62,7 +62,7 @@ export class CustomTreeViewPanel extends ViewletPanel { this.treeView = treeView; this.treeView.onDidChangeActions(() => this.updateActions(), this, this.disposables); this.disposables.push(toDisposable(() => this.treeView.setVisibility(false))); - this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()); + this.disposables.push(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility())); this.updateTreeVisibility(); } diff --git a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts b/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts index 747e5997291688449faf840c1b5e8bf772919b4d..59f43720db481fd91b85ee6bf766942cc4f9ad30 100644 --- a/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts +++ b/src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts @@ -50,7 +50,7 @@ import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewl import { CollapseAction } from 'vs/workbench/browser/viewlet'; import { IViewsService } from 'vs/workbench/common/views'; import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService'; -import { OutlineController, OutlineDataSource, OutlineItemComparator, OutlineItemCompareType, OutlineItemFilter, OutlineRenderer, OutlineTreeState } from '../../../../editor/contrib/documentSymbols/outlineTree'; +import { OutlineController, OutlineDataSource, OutlineItemComparator, OutlineItemCompareType, OutlineItemFilter, OutlineRenderer, OutlineTreeState } from 'vs/editor/contrib/documentSymbols/outlineTree'; import { OutlineConfigKeys, OutlineViewFiltered, OutlineViewFocused, OutlineViewId } from './outline'; class RequestState { @@ -372,6 +372,16 @@ export class OutlinePanel extends ViewletPanel { dom.toggleClass(this._domNode, 'no-icons', !this._configurationService.getValue(OutlineConfigKeys.icons)); } })); + + this.disposables.push(this.onDidChangeBodyVisibility(visible => { + if (visible && !this._requestOracle) { + this._requestOracle = this._instantiationService.createInstance(RequestOracle, (editor, event) => this._doUpdate(editor, event), DocumentSymbolProviderRegistry); + } else if (!visible) { + dispose(this._requestOracle); + this._requestOracle = undefined; + this._doUpdate(undefined, undefined); + } + })); } protected layoutBody(height: number): void { @@ -382,25 +392,6 @@ export class OutlinePanel extends ViewletPanel { } } - setVisible(visible: boolean): void { - if (visible && this.isExpanded() && !this._requestOracle) { - // workaround for https://github.com/Microsoft/vscode/issues/60011 - this.setExpanded(true); - } - super.setVisible(visible); - } - - setExpanded(expanded: boolean): boolean { - if (expanded) { - this._requestOracle = this._requestOracle || this._instantiationService.createInstance(RequestOracle, (editor, event) => this._doUpdate(editor, event).then(undefined, onUnexpectedError), DocumentSymbolProviderRegistry); - } else { - dispose(this._requestOracle); - this._requestOracle = undefined; - this._doUpdate(undefined, undefined); - } - return super.setExpanded(expanded); - } - getActions(): IAction[] { return [ new Action('collapse', localize('collapse', "Collapse All"), 'explorer-action collapse-explorer', true, () => {