提交 4cd256d4 编写于 作者: S Sandeep Somavarapu

fix #7204

上级 8ba1d2ee
...@@ -24,7 +24,7 @@ import { Panel } from 'vs/workbench/browser/panel'; ...@@ -24,7 +24,7 @@ import { Panel } from 'vs/workbench/browser/panel';
import { IAction } from 'vs/base/common/actions'; import { IAction } from 'vs/base/common/actions';
import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IWorkbenchEditorService } from 'vs/workbench/services/editor/common/editorService';
import Constants from 'vs/workbench/parts/markers/common/constants'; 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 {Controller} from 'vs/workbench/parts/markers/browser/markersTreeController';
import Tree = require('vs/base/parts/tree/browser/tree'); import Tree = require('vs/base/parts/tree/browser/tree');
import TreeImpl = require('vs/base/parts/tree/browser/treeImpl'); import TreeImpl = require('vs/base/parts/tree/browser/treeImpl');
...@@ -124,9 +124,8 @@ export class MarkersPanel extends Panel { ...@@ -124,9 +124,8 @@ export class MarkersPanel extends Panel {
return this.actions; return this.actions;
} }
public refreshPanel(updateTitleArea: boolean = false): TPromise<any> { private refreshPanel(updateTitleArea: boolean = false): TPromise<any> {
this.collapseAllAction.enabled = this.markersModel.hasFilteredResources(); this.collapseAllAction.enabled = this.markersModel.hasFilteredResources();
this.refreshAutoExpanded();
if (updateTitleArea) { if (updateTitleArea) {
this.updateTitleArea(); this.updateTitleArea();
} }
...@@ -140,6 +139,13 @@ export class MarkersPanel extends Panel { ...@@ -140,6 +139,13 @@ export class MarkersPanel extends Panel {
return TPromise.as(null); return TPromise.as(null);
} }
public updateFilter(filter: string) {
this.markersModel.update(new FilterOptions(filter));
this.autoExpanded = new Set.ArraySet<string>();
this.refreshPanel();
this.autoReveal();
}
private createMessageBox(parent: HTMLElement): void { private createMessageBox(parent: HTMLElement): void {
this.messageBoxContainer = dom.append(parent, dom.emmet('.message-box-container')); this.messageBoxContainer = dom.append(parent, dom.emmet('.message-box-container'));
this.messageBox = dom.append(this.messageBoxContainer, dom.emmet('span')); this.messageBox = dom.append(this.messageBoxContainer, dom.emmet('span'));
...@@ -231,14 +237,6 @@ export class MarkersPanel extends Panel { ...@@ -231,14 +237,6 @@ export class MarkersPanel extends Panel {
dom.toggleClass(this.messageBoxContainer, 'hidden', this.markersModel.hasFilteredResources()); 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 { private autoExpand(): void {
this.markersModel.filteredResources.forEach((resource) => { this.markersModel.filteredResources.forEach((resource) => {
if (this.autoExpanded.contains(resource.uri.toString())) { if (this.autoExpanded.contains(resource.uri.toString())) {
......
...@@ -16,7 +16,6 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView'; ...@@ -16,7 +16,6 @@ import {IContextViewService} from 'vs/platform/contextview/browser/contextView';
import { TogglePanelAction } from 'vs/workbench/browser/panel'; import { TogglePanelAction } from 'vs/workbench/browser/panel';
import Messages from 'vs/workbench/parts/markers/common/messages'; import Messages from 'vs/workbench/parts/markers/common/messages';
import Constants from 'vs/workbench/parts/markers/common/constants'; 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 { MarkersPanel } from 'vs/workbench/parts/markers/browser/markersPanel';
import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPartService } from 'vs/workbench/services/part/common/partService';
import { IPanelService } from 'vs/workbench/services/panel/common/panelService'; import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
...@@ -121,8 +120,7 @@ export class FilterInputBoxActionItem extends BaseActionItem { ...@@ -121,8 +120,7 @@ export class FilterInputBoxActionItem extends BaseActionItem {
} }
private updateFilter(filter: string) { private updateFilter(filter: string) {
this.markersPanel.markersModel.update(new FilterOptions(filter)); this.markersPanel.updateFilter(filter);
this.markersPanel.refreshPanel();
this.delayer.trigger(this.reportFilteringUsed.bind(this)); this.delayer.trigger(this.reportFilteringUsed.bind(this));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册