Skip to content

Commit

Permalink
expand nodes when filtering (but not when finding), #69352
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Feb 27, 2019
1 parent bd537a6 commit c3fdde2
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/vs/workbench/contrib/outline/browser/outlinePanel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,25 @@ export class OutlinePanel extends ViewletPanel {
filterOnType: this._outlineViewState.filterOnType
});

//feature: filter on type - keep tree and menu in sync
this._tree.onDidUpdateOptions(e => {
// feature: filter on type - keep tree and menu in sync
this.disposables.push(this._tree.onDidUpdateOptions(e => {
this._outlineViewState.filterOnType = e.filterOnType;
});
}));

// feature: expand all nodes when filtering (not when finding)
let viewState: IDataTreeViewState | undefined;
this.disposables.push(this._tree.onDidChangeTypeFilterPattern(pattern => {
if (!this._tree.options.filterOnType) {
return;
}
if (!viewState && pattern) {
viewState = this._tree.getViewState();
this._tree.expandAll();
} else if (!pattern && viewState) {
this._tree.setInput(this._tree.getInput(), viewState);
viewState = undefined;
}
}));

// feature: toggle icons
this.disposables.push(this._configurationService.onDidChangeConfiguration(e => {
Expand Down

0 comments on commit c3fdde2

Please sign in to comment.