fix #7204
This commit is contained in:
parent
8ba1d2eed9
commit
4cd256d4db
2 changed files with 10 additions and 14 deletions
|
@ -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<any> {
|
||||
private refreshPanel(updateTitleArea: boolean = false): TPromise<any> {
|
||||
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<string>();
|
||||
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())) {
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue