Skip to content

Commit

Permalink
fix: Fixed watch files changes with external (#538)
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias authored and JohnstonCode committed Mar 27, 2019
1 parent 35bd3d8 commit 2899a60
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/watchers/repositoryFilesWatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ export class RepositoryFilesWatcher implements IDisposable {
const fsWatcher = workspace.createFileSystemWatcher("**");
this.disposables.push(fsWatcher);

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

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

this.onDidChange = filterEvent(fsWatcher.onDidChange, ignoreNonRelevants);
this.onDidCreate = filterEvent(fsWatcher.onDidCreate, ignoreNonRelevants);
this.onDidDelete = filterEvent(fsWatcher.onDidDelete, ignoreNonRelevants);
this.onDidChange = filterEvent(fsWatcher.onDidChange, isRelevant);
this.onDidCreate = filterEvent(fsWatcher.onDidCreate, isRelevant);
this.onDidDelete = filterEvent(fsWatcher.onDidDelete, isRelevant);

this.onDidAny = anyEvent(
this.onDidChange,
Expand Down

0 comments on commit 2899a60

Please sign in to comment.