-
Notifications
You must be signed in to change notification settings - Fork 30.5k
/
Copy pathsearch.ts
706 lines (588 loc) · 21 KB
/
search.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { mapArrayOrNot } from 'vs/base/common/arrays';
import { CancellationToken } from 'vs/base/common/cancellation';
import * as glob from 'vs/base/common/glob';
import { IDisposable } from 'vs/base/common/lifecycle';
import * as objects from 'vs/base/common/objects';
import * as extpath from 'vs/base/common/extpath';
import { fuzzyContains, getNLines } from 'vs/base/common/strings';
import { URI, UriComponents } from 'vs/base/common/uri';
import { IFilesConfiguration } from 'vs/platform/files/common/files';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
import { Event } from 'vs/base/common/event';
import * as paths from 'vs/base/common/path';
import { isPromiseCanceledError } from 'vs/base/common/errors';
import { TextSearchCompleteMessageType } from 'vs/workbench/services/search/common/searchExtTypes';
import { isPromise } from 'vs/base/common/types';
export { TextSearchCompleteMessageType };
export const VIEWLET_ID = 'workbench.view.search';
export const PANEL_ID = 'workbench.panel.search';
export const VIEW_ID = 'workbench.view.search';
export const SEARCH_EXCLUDE_CONFIG = 'search.exclude';
// Warning: this pattern is used in the search editor to detect offsets. If you
// change this, also change the search-result built-in extension
const SEARCH_ELIDED_PREFIX = '⟪ ';
const SEARCH_ELIDED_SUFFIX = ' characters skipped ⟫';
const SEARCH_ELIDED_MIN_LEN = (SEARCH_ELIDED_PREFIX.length + SEARCH_ELIDED_SUFFIX.length + 5) * 2;
export const ISearchService = createDecorator<ISearchService>('searchService');
/**
* A service that enables to search for files or with in files.
*/
export interface ISearchService {
readonly _serviceBrand: undefined;
textSearch(query: ITextQuery, token?: CancellationToken, onProgress?: (result: ISearchProgressItem) => void): Promise<ISearchComplete>;
fileSearch(query: IFileQuery, token?: CancellationToken): Promise<ISearchComplete>;
clearCache(cacheKey: string): Promise<void>;
registerSearchResultProvider(scheme: string, type: SearchProviderType, provider: ISearchResultProvider): IDisposable;
}
/**
* TODO@roblou - split text from file search entirely, or share code in a more natural way.
*/
export const enum SearchProviderType {
file,
text
}
export interface ISearchResultProvider {
textSearch(query: ITextQuery, onProgress?: (p: ISearchProgressItem) => void, token?: CancellationToken): Promise<ISearchComplete>;
fileSearch(query: IFileQuery, token?: CancellationToken): Promise<ISearchComplete>;
clearCache(cacheKey: string): Promise<void>;
}
export interface IFolderQuery<U extends UriComponents = URI> {
folder: U;
folderName?: string;
excludePattern?: glob.IExpression;
includePattern?: glob.IExpression;
fileEncoding?: string;
disregardIgnoreFiles?: boolean;
disregardGlobalIgnoreFiles?: boolean;
ignoreSymlinks?: boolean;
}
export interface ICommonQueryProps<U extends UriComponents> {
/** For telemetry - indicates what is triggering the source */
_reason?: string;
folderQueries: IFolderQuery<U>[];
includePattern?: glob.IExpression;
excludePattern?: glob.IExpression;
extraFileResources?: U[];
onlyOpenEditors?: boolean;
maxResults?: number;
usingSearchPaths?: boolean;
}
export interface IFileQueryProps<U extends UriComponents> extends ICommonQueryProps<U> {
type: QueryType.File;
filePattern?: string;
/**
* If true no results will be returned. Instead `limitHit` will indicate if at least one result exists or not.
* Currently does not work with queries including a 'siblings clause'.
*/
exists?: boolean;
sortByScore?: boolean;
cacheKey?: string;
}
export interface ITextQueryProps<U extends UriComponents> extends ICommonQueryProps<U> {
type: QueryType.Text;
contentPattern: IPatternInfo;
previewOptions?: ITextSearchPreviewOptions;
maxFileSize?: number;
usePCRE2?: boolean;
afterContext?: number;
beforeContext?: number;
userDisabledExcludesAndIgnoreFiles?: boolean;
}
export type IFileQuery = IFileQueryProps<URI>;
export type IRawFileQuery = IFileQueryProps<UriComponents>;
export type ITextQuery = ITextQueryProps<URI>;
export type IRawTextQuery = ITextQueryProps<UriComponents>;
export type IRawQuery = IRawTextQuery | IRawFileQuery;
export type ISearchQuery = ITextQuery | IFileQuery;
export const enum QueryType {
File = 1,
Text = 2
}
/* __GDPR__FRAGMENT__
"IPatternInfo" : {
"pattern" : { "classification": "CustomerContent", "purpose": "FeatureInsight" },
"isRegExp": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"isWordMatch": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"wordSeparators": { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
"isMultiline": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"isCaseSensitive": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true },
"isSmartCase": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "isMeasurement": true }
}
*/
export interface IPatternInfo {
pattern: string;
isRegExp?: boolean;
isWordMatch?: boolean;
wordSeparators?: string;
isMultiline?: boolean;
isUnicode?: boolean;
isCaseSensitive?: boolean;
}
export interface IExtendedExtensionSearchOptions {
usePCRE2?: boolean;
}
export interface IFileMatch<U extends UriComponents = URI> {
resource: U;
results?: ITextSearchResult[];
}
export type IRawFileMatch2 = IFileMatch<UriComponents>;
export interface ITextSearchPreviewOptions {
matchLines: number;
charsPerLine: number;
}
export interface ISearchRange {
readonly startLineNumber: number;
readonly startColumn: number;
readonly endLineNumber: number;
readonly endColumn: number;
}
export interface ITextSearchResultPreview {
text: string;
matches: ISearchRange | ISearchRange[];
}
export interface ITextSearchMatch {
uri?: URI;
ranges: ISearchRange | ISearchRange[];
preview: ITextSearchResultPreview;
}
export interface ITextSearchContext {
uri?: URI;
text: string;
lineNumber: number;
}
export type ITextSearchResult = ITextSearchMatch | ITextSearchContext;
export function resultIsMatch(result: ITextSearchResult): result is ITextSearchMatch {
return !!(<ITextSearchMatch>result).preview;
}
export interface IProgressMessage {
message: string;
}
export type ISearchProgressItem = IFileMatch | IProgressMessage;
export function isFileMatch(p: ISearchProgressItem): p is IFileMatch {
return !!(<IFileMatch>p).resource;
}
export function isProgressMessage(p: ISearchProgressItem | ISerializedSearchProgressItem): p is IProgressMessage {
return !!(p as IProgressMessage).message;
}
export interface ITextSearchCompleteMessage {
text: string;
type: TextSearchCompleteMessageType;
trusted?: boolean;
}
export interface ISearchCompleteStats {
limitHit?: boolean;
messages: ITextSearchCompleteMessage[];
stats?: IFileSearchStats | ITextSearchStats;
}
export interface ISearchComplete extends ISearchCompleteStats {
results: IFileMatch[];
exit?: SearchCompletionExitCode
}
export const enum SearchCompletionExitCode {
Normal,
NewSearchStarted
}
export interface ITextSearchStats {
type: 'textSearchProvider' | 'searchProcess';
}
export interface IFileSearchStats {
fromCache: boolean;
detailStats: ISearchEngineStats | ICachedSearchStats | IFileSearchProviderStats;
resultCount: number;
type: 'fileSearchProvider' | 'searchProcess';
sortingTime?: number;
}
export interface ICachedSearchStats {
cacheWasResolved: boolean;
cacheLookupTime: number;
cacheFilterTime: number;
cacheEntryCount: number;
}
export interface ISearchEngineStats {
fileWalkTime: number;
directoriesWalked: number;
filesWalked: number;
cmdTime: number;
cmdResultCount?: number;
}
export interface IFileSearchProviderStats {
providerTime: number;
postProcessTime: number;
}
export class FileMatch implements IFileMatch {
results: ITextSearchResult[] = [];
constructor(public resource: URI) {
// empty
}
}
export class TextSearchMatch implements ITextSearchMatch {
ranges: ISearchRange | ISearchRange[];
preview: ITextSearchResultPreview;
constructor(text: string, range: ISearchRange | ISearchRange[], previewOptions?: ITextSearchPreviewOptions) {
this.ranges = range;
// Trim preview if this is one match and a single-line match with a preview requested.
// Otherwise send the full text, like for replace or for showing multiple previews.
// TODO this is fishy.
const ranges = Array.isArray(range) ? range : [range];
if (previewOptions && previewOptions.matchLines === 1 && isSingleLineRangeList(ranges)) {
// 1 line preview requested
text = getNLines(text, previewOptions.matchLines);
let result = '';
let shift = 0;
let lastEnd = 0;
const leadingChars = Math.floor(previewOptions.charsPerLine / 5);
const matches: ISearchRange[] = [];
for (const range of ranges) {
const previewStart = Math.max(range.startColumn - leadingChars, 0);
const previewEnd = range.startColumn + previewOptions.charsPerLine;
if (previewStart > lastEnd + leadingChars + SEARCH_ELIDED_MIN_LEN) {
const elision = SEARCH_ELIDED_PREFIX + (previewStart - lastEnd) + SEARCH_ELIDED_SUFFIX;
result += elision + text.slice(previewStart, previewEnd);
shift += previewStart - (lastEnd + elision.length);
} else {
result += text.slice(lastEnd, previewEnd);
}
matches.push(new OneLineRange(0, range.startColumn - shift, range.endColumn - shift));
lastEnd = previewEnd;
}
this.preview = { text: result, matches: Array.isArray(this.ranges) ? matches : matches[0] };
} else {
const firstMatchLine = Array.isArray(range) ? range[0].startLineNumber : range.startLineNumber;
this.preview = {
text,
matches: mapArrayOrNot(range, r => new SearchRange(r.startLineNumber - firstMatchLine, r.startColumn, r.endLineNumber - firstMatchLine, r.endColumn))
};
}
}
}
function isSingleLineRangeList(ranges: ISearchRange[]): boolean {
const line = ranges[0].startLineNumber;
for (const r of ranges) {
if (r.startLineNumber !== line || r.endLineNumber !== line) {
return false;
}
}
return true;
}
export class SearchRange implements ISearchRange {
startLineNumber: number;
startColumn: number;
endLineNumber: number;
endColumn: number;
constructor(startLineNumber: number, startColumn: number, endLineNumber: number, endColumn: number) {
this.startLineNumber = startLineNumber;
this.startColumn = startColumn;
this.endLineNumber = endLineNumber;
this.endColumn = endColumn;
}
}
export class OneLineRange extends SearchRange {
constructor(lineNumber: number, startColumn: number, endColumn: number) {
super(lineNumber, startColumn, lineNumber, endColumn);
}
}
export const enum SearchSortOrder {
Default = 'default',
FileNames = 'fileNames',
Type = 'type',
Modified = 'modified',
CountDescending = 'countDescending',
CountAscending = 'countAscending'
}
export interface ISearchConfigurationProperties {
exclude: glob.IExpression;
useRipgrep: boolean;
/**
* Use ignore file for file search.
*/
useIgnoreFiles: boolean;
useGlobalIgnoreFiles: boolean;
followSymlinks: boolean;
smartCase: boolean;
globalFindClipboard: boolean;
location: 'sidebar' | 'panel';
useReplacePreview: boolean;
showLineNumbers: boolean;
usePCRE2: boolean;
actionsPosition: 'auto' | 'right';
maintainFileSearchCache: boolean;
maxResults: number | null;
collapseResults: 'auto' | 'alwaysCollapse' | 'alwaysExpand';
searchOnType: boolean;
seedOnFocus: boolean;
seedWithNearestWord: boolean;
searchOnTypeDebouncePeriod: number;
mode: 'view' | 'reuseEditor' | 'newEditor';
searchEditor: {
doubleClickBehaviour: 'selectWord' | 'goToLocation' | 'openLocationToSide',
reusePriorSearchConfiguration: boolean,
defaultNumberOfContextLines: number | null,
experimental: {}
};
sortOrder: SearchSortOrder;
forceSearchProcess: boolean;
}
export interface ISearchConfiguration extends IFilesConfiguration {
search: ISearchConfigurationProperties;
editor: {
wordSeparators: string;
};
}
export function getExcludes(configuration: ISearchConfiguration, includeSearchExcludes = true): glob.IExpression | undefined {
const fileExcludes = configuration && configuration.files && configuration.files.exclude;
const searchExcludes = includeSearchExcludes && configuration && configuration.search && configuration.search.exclude;
if (!fileExcludes && !searchExcludes) {
return undefined;
}
if (!fileExcludes || !searchExcludes) {
return fileExcludes || searchExcludes;
}
let allExcludes: glob.IExpression = Object.create(null);
// clone the config as it could be frozen
allExcludes = objects.mixin(allExcludes, objects.deepClone(fileExcludes));
allExcludes = objects.mixin(allExcludes, objects.deepClone(searchExcludes), true);
return allExcludes;
}
export function pathIncludedInQuery(queryProps: ICommonQueryProps<URI>, fsPath: string): boolean {
if (queryProps.excludePattern && glob.match(queryProps.excludePattern, fsPath)) {
return false;
}
if (queryProps.includePattern || queryProps.usingSearchPaths) {
if (queryProps.includePattern && glob.match(queryProps.includePattern, fsPath)) {
return true;
}
// If searchPaths are being used, the extra file must be in a subfolder and match the pattern, if present
if (queryProps.usingSearchPaths) {
return !!queryProps.folderQueries && queryProps.folderQueries.some(fq => {
const searchPath = fq.folder.fsPath;
if (extpath.isEqualOrParent(fsPath, searchPath)) {
const relPath = paths.relative(searchPath, fsPath);
return !fq.includePattern || !!glob.match(fq.includePattern, relPath);
} else {
return false;
}
});
}
return false;
}
return true;
}
export enum SearchErrorCode {
unknownEncoding = 1,
regexParseError,
globParseError,
invalidLiteral,
rgProcessError,
other,
canceled
}
export class SearchError extends Error {
constructor(message: string, readonly code?: SearchErrorCode) {
super(message);
}
}
export function deserializeSearchError(error: Error): SearchError {
const errorMsg = error.message;
if (isPromiseCanceledError(error)) {
return new SearchError(errorMsg, SearchErrorCode.canceled);
}
try {
const details = JSON.parse(errorMsg);
return new SearchError(details.message, details.code);
} catch (e) {
return new SearchError(errorMsg, SearchErrorCode.other);
}
}
export function serializeSearchError(searchError: SearchError): Error {
const details = { message: searchError.message, code: searchError.code };
return new Error(JSON.stringify(details));
}
export interface ITelemetryEvent {
eventName: string;
data: ITelemetryData;
}
export interface IRawSearchService {
fileSearch(search: IRawFileQuery): Event<ISerializedSearchProgressItem | ISerializedSearchComplete>;
textSearch(search: IRawTextQuery): Event<ISerializedSearchProgressItem | ISerializedSearchComplete>;
clearCache(cacheKey: string): Promise<void>;
}
export interface IRawFileMatch {
base?: string;
/**
* The path of the file relative to the containing `base` folder.
* This path is exactly as it appears on the filesystem.
*/
relativePath: string;
/**
* This path is transformed for search purposes. For example, this could be
* the `relativePath` with the workspace folder name prepended. This way the
* search algorithm would also match against the name of the containing folder.
*
* If not given, the search algorithm should use `relativePath`.
*/
searchPath: string | undefined;
}
export interface ISearchEngine<T> {
search: (onResult: (matches: T) => void, onProgress: (progress: IProgressMessage) => void, done: (error: Error | null, complete: ISearchEngineSuccess) => void) => void;
cancel: () => void;
}
export interface ISerializedSearchSuccess {
type: 'success';
limitHit: boolean;
messages: ITextSearchCompleteMessage[];
stats?: IFileSearchStats | ITextSearchStats;
}
export interface ISearchEngineSuccess {
limitHit: boolean;
messages: ITextSearchCompleteMessage[];
stats: ISearchEngineStats;
}
export interface ISerializedSearchError {
type: 'error';
error: {
message: string,
stack: string
};
}
export type ISerializedSearchComplete = ISerializedSearchSuccess | ISerializedSearchError;
export function isSerializedSearchComplete(arg: ISerializedSearchProgressItem | ISerializedSearchComplete): arg is ISerializedSearchComplete {
if ((arg as any).type === 'error') {
return true;
} else if ((arg as any).type === 'success') {
return true;
} else {
return false;
}
}
export function isSerializedSearchSuccess(arg: ISerializedSearchComplete): arg is ISerializedSearchSuccess {
return arg.type === 'success';
}
export function isSerializedFileMatch(arg: ISerializedSearchProgressItem): arg is ISerializedFileMatch {
return !!(<ISerializedFileMatch>arg).path;
}
export function isFilePatternMatch(candidate: IRawFileMatch, normalizedFilePatternLowercase: string): boolean {
const pathToMatch = candidate.searchPath ? candidate.searchPath : candidate.relativePath;
return fuzzyContains(pathToMatch, normalizedFilePatternLowercase);
}
export interface ISerializedFileMatch {
path: string;
results?: ITextSearchResult[];
numMatches?: number;
}
// Type of the possible values for progress calls from the engine
export type ISerializedSearchProgressItem = ISerializedFileMatch | ISerializedFileMatch[] | IProgressMessage;
export type IFileSearchProgressItem = IRawFileMatch | IRawFileMatch[] | IProgressMessage;
export class SerializableFileMatch implements ISerializedFileMatch {
path: string;
results: ITextSearchMatch[];
constructor(path: string) {
this.path = path;
this.results = [];
}
addMatch(match: ITextSearchMatch): void {
this.results.push(match);
}
serialize(): ISerializedFileMatch {
return {
path: this.path,
results: this.results,
numMatches: this.results.length
};
}
}
/**
* Computes the patterns that the provider handles. Discards sibling clauses and 'false' patterns
*/
export function resolvePatternsForProvider(globalPattern: glob.IExpression | undefined, folderPattern: glob.IExpression | undefined): string[] {
const merged = {
...(globalPattern || {}),
...(folderPattern || {})
};
return Object.keys(merged)
.filter(key => {
const value = merged[key];
return typeof value === 'boolean' && value;
});
}
export class QueryGlobTester {
private _excludeExpression: glob.IExpression;
private _parsedExcludeExpression: glob.ParsedExpression;
private _parsedIncludeExpression: glob.ParsedExpression | null = null;
constructor(config: ISearchQuery, folderQuery: IFolderQuery) {
this._excludeExpression = {
...(config.excludePattern || {}),
...(folderQuery.excludePattern || {})
};
this._parsedExcludeExpression = glob.parse(this._excludeExpression);
// Empty includeExpression means include nothing, so no {} shortcuts
let includeExpression: glob.IExpression | undefined = config.includePattern;
if (folderQuery.includePattern) {
if (includeExpression) {
includeExpression = {
...includeExpression,
...folderQuery.includePattern
};
} else {
includeExpression = folderQuery.includePattern;
}
}
if (includeExpression) {
this._parsedIncludeExpression = glob.parse(includeExpression);
}
}
matchesExcludesSync(testPath: string, basename?: string, hasSibling?: (name: string) => boolean): boolean {
if (this._parsedExcludeExpression && this._parsedExcludeExpression(testPath, basename, hasSibling)) {
return true;
}
return false;
}
/**
* Guaranteed sync - siblingsFn should not return a promise.
*/
includedInQuerySync(testPath: string, basename?: string, hasSibling?: (name: string) => boolean): boolean {
if (this._parsedExcludeExpression && this._parsedExcludeExpression(testPath, basename, hasSibling)) {
return false;
}
if (this._parsedIncludeExpression && !this._parsedIncludeExpression(testPath, basename, hasSibling)) {
return false;
}
return true;
}
/**
* Evaluating the exclude expression is only async if it includes sibling clauses. As an optimization, avoid doing anything with Promises
* unless the expression is async.
*/
includedInQuery(testPath: string, basename?: string, hasSibling?: (name: string) => boolean | Promise<boolean>): Promise<boolean> | boolean {
const excluded = this._parsedExcludeExpression(testPath, basename, hasSibling);
const isIncluded = () => {
return this._parsedIncludeExpression ?
!!(this._parsedIncludeExpression(testPath, basename, hasSibling)) :
true;
};
if (isPromise(excluded)) {
return excluded.then(excluded => {
if (excluded) {
return false;
}
return isIncluded();
});
}
return isIncluded();
}
hasSiblingExcludeClauses(): boolean {
return hasSiblingClauses(this._excludeExpression);
}
}
function hasSiblingClauses(pattern: glob.IExpression): boolean {
for (const key in pattern) {
if (typeof pattern[key] !== 'boolean') {
return true;
}
}
return false;
}