Skip to content

Commit 2899a60

Browse files
edgardmessiasJohnstonCode
authored andcommitted
fix: Fixed watch files changes with external (#538)
1 parent 35bd3d8 commit 2899a60

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/watchers/repositoryFilesWatcher.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ export class RepositoryFilesWatcher implements IDisposable {
2323
const fsWatcher = workspace.createFileSystemWatcher("**");
2424
this.disposables.push(fsWatcher);
2525

26-
const ignoreTmp = (uri: Uri) => !/[\\\/]\.svn[\\\/]tmp/.test(uri.path);
26+
const isTmp = (uri: Uri) => /[\\\/]\.svn[\\\/]tmp/.test(uri.path);
2727

28-
const ignoreNonRelevants = (uri: Uri) =>
29-
ignoreTmp(uri) && !isDescendant(this.root, uri.fsPath);
28+
const isRelevant = (uri: Uri) =>
29+
!isTmp(uri) && isDescendant(this.root, uri.fsPath);
3030

31-
this.onDidChange = filterEvent(fsWatcher.onDidChange, ignoreNonRelevants);
32-
this.onDidCreate = filterEvent(fsWatcher.onDidCreate, ignoreNonRelevants);
33-
this.onDidDelete = filterEvent(fsWatcher.onDidDelete, ignoreNonRelevants);
31+
this.onDidChange = filterEvent(fsWatcher.onDidChange, isRelevant);
32+
this.onDidCreate = filterEvent(fsWatcher.onDidCreate, isRelevant);
33+
this.onDidDelete = filterEvent(fsWatcher.onDidDelete, isRelevant);
3434

3535
this.onDidAny = anyEvent(
3636
this.onDidChange,

0 commit comments

Comments
 (0)