提交 a370420c 编写于 作者: D Daniel Imms

Use proper path equal or parent check in file watcher

Fixes #29605
上级 2d0cf23f
......@@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as glob from 'vs/base/common/glob';
import * as paths from 'vs/base/common/paths';
import * as path from 'path';
import * as watcher from 'vs/workbench/services/files/node/watcher/common';
import * as nsfw from 'nsfw';
......@@ -158,7 +159,7 @@ export class NsfwWatcherService implements IWatcherService {
*/
protected _normalizeRoots(roots: IWatcherRequest[]): IWatcherRequest[] {
return roots.filter(r => roots.every(other => {
return !(r.basePath.length > other.basePath.length && r.basePath.indexOf(other.basePath) === 0);
return !(r.basePath.length > other.basePath.length && paths.isEqualOrParent(r.basePath, other.basePath));
}));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册