We seem to associate some metadata with a parsed glob pattern:
|
interface ParsedStringPattern { |
|
(path: string, basename?: string): string | null | Promise<string | null> /* the matching pattern */; |
|
basenames?: string[]; |
|
patterns?: string[]; |
|
allBasenames?: string[]; |
|
allPaths?: string[]; |
|
} |
|
|
|
interface ParsedExpressionPattern { |
|
(path: string, basename?: string, name?: string, hasSibling?: (name: string) => boolean | Promise<boolean>): string | null | Promise<string | null> /* the matching pattern */; |
|
requiresSiblings?: boolean; |
|
allBasenames?: string[]; |
|
allPaths?: string[]; |
|
} |
But we then seem to miss re-applying these properties when wrapping for a relative pattern:
|
function wrapRelativePattern(parsedPattern: ParsedStringPattern, arg2: string | IRelativePattern): ParsedStringPattern { |
|
if (typeof arg2 === 'string') { |
|
return parsedPattern; |
|
} |
|
|
|
return function (path, basename) { |
|
if (!isEqualOrParent(path, arg2.base, !isLinux)) { |
|
// skip glob matching if `base` is not a parent of `path` |
|
return null; |
|
} |
|
|
|
// Given we have checked `base` being a parent of `path`, |
|
// we can now remove the `base` portion of the `path` |
|
// and only match on the remaining path components |
|
return parsedPattern(path.substr(arg2.base.length + 1), basename); |
|
}; |
|
} |
It is unclear to me what the consequences are, maybe you can check @chrmarti and I can look into the fix.
We seem to associate some metadata with a parsed glob pattern:
vscode/src/vs/base/common/glob.ts
Lines 282 to 295 in ce3f267
But we then seem to miss re-applying these properties when wrapping for a relative pattern:
vscode/src/vs/base/common/glob.ts
Lines 355 to 371 in ce3f267
It is unclear to me what the consequences are, maybe you can check @chrmarti and I can look into the fix.