TypeError: expressionForRoot is not a function (fixes #30034)

This commit is contained in:
Benjamin Pasero
2017-07-03 10:25:04 +02:00
parent 33e251c67b
commit a76af8a6f0

View File

@@ -148,7 +148,13 @@ export class ResourceGlobMatcher {
public matches(resource: URI): boolean {
const root = this.contextService.getRoot(resource);
const expressionForRoot = this.mapRootToParsedExpression.get(root ? root.toString() : ResourceGlobMatcher.NO_ROOT);
let expressionForRoot: ParsedExpression;
if (root && this.mapRootToParsedExpression.has(root.toString())) {
expressionForRoot = this.mapRootToParsedExpression.get(root.toString());
} else {
expressionForRoot = this.mapRootToParsedExpression.get(ResourceGlobMatcher.NO_ROOT);
}
// If the resource if from a workspace, convert its absolute path to a relative
// path so that glob patterns have a higher probability to match. For example