EA-207504 - IPE: VfsEventGenerationHelper.lambda$isUnderSomeProjectRoot$

GitOrigin-RevId: 3356db9d43dd1cabbf44b999201f4464fe95c54a
This commit is contained in:
Alexey Kudravtsev
2019-08-16 16:06:48 +03:00
committed by intellij-monorepo-bot
parent 43c572cbaa
commit d3db7e6476
@@ -64,14 +64,19 @@ class VfsEventGenerationHelper {
if (LOG.isTraceEnabled()) LOG.trace("create parent=" + parent + " name=" + childName + " attr=" + attributes);
ChildInfo[] children = null;
if (attributes.isDirectory() && parent.getFileSystem() instanceof LocalFileSystem && !attributes.isSymLink()) {
Path child = Paths.get(parent.getPath(), childName);
if (shouldScanDirectory(parent, child, childName)) {
Path[] relevantExcluded = ContainerUtil.mapNotNull(ProjectManagerEx.getInstanceEx().getAllExcludedUrls(),
url -> {
Path path = Paths.get(VirtualFileManager.extractPath(url));
return path.startsWith(child) ? path : null;
}, new Path[0]);
children = scanChildren(child, relevantExcluded, checkCanceled);
try {
Path child = Paths.get(parent.getPath(), childName);
if (shouldScanDirectory(parent, child, childName)) {
Path[] relevantExcluded = ContainerUtil.mapNotNull(ProjectManagerEx.getInstanceEx().getAllExcludedUrls(),
url -> {
Path path = Paths.get(VirtualFileManager.extractPath(url));
return path.startsWith(child) ? path : null;
}, new Path[0]);
children = scanChildren(child, relevantExcluded, checkCanceled);
}
}
catch (InvalidPathException ignored) {
// Paths.get() throws sometimes
}
}
VFileCreateEvent event = new VFileCreateEvent(null, parent, childName, attributes.isDirectory(), attributes, symlinkTarget, true,