提交 01659db1 编写于 作者: B Benjamin Pasero

fix #65475

上级 e02e4446
......@@ -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();
}
......
......@@ -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, () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册