Skip to content

Commit 01659db

Browse files
author
Benjamin Pasero
committed
1 parent e02e444 commit 01659db

2 files changed

Lines changed: 12 additions & 21 deletions

File tree

src/vs/workbench/browser/parts/views/customView.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export class CustomTreeViewPanel extends ViewletPanel {
6262
this.treeView = treeView;
6363
this.treeView.onDidChangeActions(() => this.updateActions(), this, this.disposables);
6464
this.disposables.push(toDisposable(() => this.treeView.setVisibility(false)));
65-
this.onDidChangeBodyVisibility(() => this.updateTreeVisibility());
65+
this.disposables.push(this.onDidChangeBodyVisibility(() => this.updateTreeVisibility()));
6666
this.updateTreeVisibility();
6767
}
6868

src/vs/workbench/parts/outline/electron-browser/outlinePanel.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import { IViewletViewOptions } from 'vs/workbench/browser/parts/views/viewsViewl
5050
import { CollapseAction } from 'vs/workbench/browser/viewlet';
5151
import { IViewsService } from 'vs/workbench/common/views';
5252
import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
53-
import { OutlineController, OutlineDataSource, OutlineItemComparator, OutlineItemCompareType, OutlineItemFilter, OutlineRenderer, OutlineTreeState } from '../../../../editor/contrib/documentSymbols/outlineTree';
53+
import { OutlineController, OutlineDataSource, OutlineItemComparator, OutlineItemCompareType, OutlineItemFilter, OutlineRenderer, OutlineTreeState } from 'vs/editor/contrib/documentSymbols/outlineTree';
5454
import { OutlineConfigKeys, OutlineViewFiltered, OutlineViewFocused, OutlineViewId } from './outline';
5555

5656
class RequestState {
@@ -372,6 +372,16 @@ export class OutlinePanel extends ViewletPanel {
372372
dom.toggleClass(this._domNode, 'no-icons', !this._configurationService.getValue(OutlineConfigKeys.icons));
373373
}
374374
}));
375+
376+
this.disposables.push(this.onDidChangeBodyVisibility(visible => {
377+
if (visible && !this._requestOracle) {
378+
this._requestOracle = this._instantiationService.createInstance(RequestOracle, (editor, event) => this._doUpdate(editor, event), DocumentSymbolProviderRegistry);
379+
} else if (!visible) {
380+
dispose(this._requestOracle);
381+
this._requestOracle = undefined;
382+
this._doUpdate(undefined, undefined);
383+
}
384+
}));
375385
}
376386

377387
protected layoutBody(height: number): void {
@@ -382,25 +392,6 @@ export class OutlinePanel extends ViewletPanel {
382392
}
383393
}
384394

385-
setVisible(visible: boolean): void {
386-
if (visible && this.isExpanded() && !this._requestOracle) {
387-
// workaround for https://github.com/Microsoft/vscode/issues/60011
388-
this.setExpanded(true);
389-
}
390-
super.setVisible(visible);
391-
}
392-
393-
setExpanded(expanded: boolean): boolean {
394-
if (expanded) {
395-
this._requestOracle = this._requestOracle || this._instantiationService.createInstance(RequestOracle, (editor, event) => this._doUpdate(editor, event).then(undefined, onUnexpectedError), DocumentSymbolProviderRegistry);
396-
} else {
397-
dispose(this._requestOracle);
398-
this._requestOracle = undefined;
399-
this._doUpdate(undefined, undefined);
400-
}
401-
return super.setExpanded(expanded);
402-
}
403-
404395
getActions(): IAction[] {
405396
return [
406397
new Action('collapse', localize('collapse', "Collapse All"), 'explorer-action collapse-explorer', true, () => {

0 commit comments

Comments
 (0)