提交 376c7496 编写于 作者: J Johannes Rieken

filter - less filtering in markers panel

上级 3c55d1c2
...@@ -4,14 +4,14 @@ ...@@ -4,14 +4,14 @@
*--------------------------------------------------------------------------------------------*/ *--------------------------------------------------------------------------------------------*/
import Messages from 'vs/workbench/parts/markers/electron-browser/messages'; import Messages from 'vs/workbench/parts/markers/electron-browser/messages';
import { IFilter, or, matchesPrefix, matchesContiguousSubString, matchesFuzzy } from 'vs/base/common/filters'; import { IFilter, matchesPrefix, matchesFuzzy, matchesFuzzy2 } from 'vs/base/common/filters';
import { ParsedExpression, IExpression, splitGlobAware, getEmptyExpression, parse } from 'vs/base/common/glob'; import { ParsedExpression, IExpression, splitGlobAware, getEmptyExpression, parse } from 'vs/base/common/glob';
import * as strings from 'vs/base/common/strings'; import * as strings from 'vs/base/common/strings';
export class FilterOptions { export class FilterOptions {
static readonly _filter: IFilter = or(matchesPrefix, matchesContiguousSubString); static readonly _filter: IFilter = matchesFuzzy2;
static readonly _fuzzyFilter: IFilter = or(matchesPrefix, matchesContiguousSubString, matchesFuzzy); static readonly _messageFilter: IFilter = matchesFuzzy;
readonly filterErrors: boolean = false; readonly filterErrors: boolean = false;
readonly filterWarnings: boolean = false; readonly filterWarnings: boolean = false;
......
...@@ -369,7 +369,7 @@ export class Filter implements ITreeFilter<TreeElement, FilterData> { ...@@ -369,7 +369,7 @@ export class Filter implements ITreeFilter<TreeElement, FilterData> {
return true; return true;
} }
const messageMatches = FilterOptions._fuzzyFilter(this.options.textFilter, marker.marker.message); const messageMatches = FilterOptions._messageFilter(this.options.textFilter, marker.marker.message);
const sourceMatches = marker.marker.source && FilterOptions._filter(this.options.textFilter, marker.marker.source); const sourceMatches = marker.marker.source && FilterOptions._filter(this.options.textFilter, marker.marker.source);
const codeMatches = marker.marker.code && FilterOptions._filter(this.options.textFilter, marker.marker.code); const codeMatches = marker.marker.code && FilterOptions._filter(this.options.textFilter, marker.marker.code);
...@@ -386,7 +386,7 @@ export class Filter implements ITreeFilter<TreeElement, FilterData> { ...@@ -386,7 +386,7 @@ export class Filter implements ITreeFilter<TreeElement, FilterData> {
} }
const uriMatches = FilterOptions._filter(this.options.textFilter, paths.basename(relatedInformation.raw.resource.fsPath)); const uriMatches = FilterOptions._filter(this.options.textFilter, paths.basename(relatedInformation.raw.resource.fsPath));
const messageMatches = FilterOptions._filter(this.options.textFilter, paths.basename(relatedInformation.raw.message)); const messageMatches = FilterOptions._messageFilter(this.options.textFilter, paths.basename(relatedInformation.raw.message));
if (uriMatches || messageMatches) { if (uriMatches || messageMatches) {
return { visibility: true, data: { type: FilterDataType.RelatedInformation, uriMatches: uriMatches || [], messageMatches: messageMatches || [] } }; return { visibility: true, data: { type: FilterDataType.RelatedInformation, uriMatches: uriMatches || [], messageMatches: messageMatches || [] } };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册