From 4cd256d4dbb16df4cc227e225a6727b871617149 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Wed, 27 Jul 2016 17:03:50 +0200 Subject: [PATCH] fix #7204 --- .../parts/markers/browser/markersPanel.ts | 20 +++++++++---------- .../markers/browser/markersPanelActions.ts | 4 +--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/vs/workbench/parts/markers/browser/markersPanel.ts b/src/vs/workbench/parts/markers/browser/markersPanel.ts index 263b349adeb..5f000683095 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanel.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanel.ts @@ -24,7 +24,7 @@ import { Panel } from 'vs/workbench/browser/panel'; import { IAction } from 'vs/base/common/actions'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import Constants from 'vs/workbench/parts/markers/common/constants'; -import { IProblemsConfiguration, MarkersModel, Marker, Resource } from 'vs/workbench/parts/markers/common/markersModel'; +import { IProblemsConfiguration, MarkersModel, Marker, Resource, FilterOptions } from 'vs/workbench/parts/markers/common/markersModel'; import {Controller} from 'vs/workbench/parts/markers/browser/markersTreeController'; import Tree = require('vs/base/parts/tree/browser/tree'); import TreeImpl = require('vs/base/parts/tree/browser/treeImpl'); @@ -124,9 +124,8 @@ export class MarkersPanel extends Panel { return this.actions; } - public refreshPanel(updateTitleArea: boolean = false): TPromise { + private refreshPanel(updateTitleArea: boolean = false): TPromise { this.collapseAllAction.enabled = this.markersModel.hasFilteredResources(); - this.refreshAutoExpanded(); if (updateTitleArea) { this.updateTitleArea(); } @@ -140,6 +139,13 @@ export class MarkersPanel extends Panel { return TPromise.as(null); } + public updateFilter(filter: string) { + this.markersModel.update(new FilterOptions(filter)); + this.autoExpanded = new Set.ArraySet(); + this.refreshPanel(); + this.autoReveal(); + } + private createMessageBox(parent: HTMLElement): void { this.messageBoxContainer = dom.append(parent, dom.emmet('.message-box-container')); this.messageBox = dom.append(this.messageBoxContainer, dom.emmet('span')); @@ -231,14 +237,6 @@ export class MarkersPanel extends Panel { dom.toggleClass(this.messageBoxContainer, 'hidden', this.markersModel.hasFilteredResources()); } - private refreshAutoExpanded(): void { - this.markersModel.nonFilteredResources.forEach((resource) => { - if (this.tree.isExpanded(resource)) { - this.autoExpanded.unset(resource.uri.toString()); - } - }); - } - private autoExpand(): void { this.markersModel.filteredResources.forEach((resource) => { if (this.autoExpanded.contains(resource.uri.toString())) { diff --git a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts index 48c7a986f7c..d5172a21c37 100644 --- a/src/vs/workbench/parts/markers/browser/markersPanelActions.ts +++ b/src/vs/workbench/parts/markers/browser/markersPanelActions.ts @@ -16,7 +16,6 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; import { TogglePanelAction } from 'vs/workbench/browser/panel'; import Messages from 'vs/workbench/parts/markers/common/messages'; import Constants from 'vs/workbench/parts/markers/common/constants'; -import { FilterOptions } from 'vs/workbench/parts/markers/common/markersModel'; import { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel'; import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; @@ -121,8 +120,7 @@ export class FilterInputBoxActionItem extends BaseActionItem { } private updateFilter(filter: string) { - this.markersPanel.markersModel.update(new FilterOptions(filter)); - this.markersPanel.refreshPanel(); + this.markersPanel.updateFilter(filter); this.delayer.trigger(this.reportFilteringUsed.bind(this)); }