From 022bfe86c1514aa0e55bbc2f23cbe9a732f661e5 Mon Sep 17 00:00:00 2001 From: Amin Yahyaabadi Date: Tue, 27 Apr 2021 17:44:30 -0500 Subject: [PATCH] fix: don't call rebuild-cache on file add or remove --- lib/paths-cache.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/lib/paths-cache.js b/lib/paths-cache.js index 5954dad..2ebaef6 100644 --- a/lib/paths-cache.js +++ b/lib/paths-cache.js @@ -201,11 +201,9 @@ export default class PathsCache extends EventEmitter { * @param addedFile {string} */ onAddFile(projectDirectory, addedFile) { - this.emit("rebuild-cache") const filePaths = this._filePathsByProjectDirectory.get(projectDirectory.path) filePaths.push(addedFile) this._filePathsByProjectDirectory.set(projectDirectory.path, filePaths) - this.emit("rebuild-cache-done") } /** @@ -213,7 +211,6 @@ export default class PathsCache extends EventEmitter { * @param removedFile {string} */ onRemoveFile(projectDirectory, removedFile) { - this.emit("rebuild-cache") /** @type {string[]} */ const filePaths = this._filePathsByProjectDirectory.get(projectDirectory.path) @@ -225,7 +222,6 @@ export default class PathsCache extends EventEmitter { } } this._filePathsByProjectDirectory.set(projectDirectory.path, filePaths) - this.emit("rebuild-cache-done") } /** @@ -233,10 +229,8 @@ export default class PathsCache extends EventEmitter { * @param addedDir {string} */ async onAddDir(projectDirectory, addedDir) { - this.emit("rebuild-cache") const directory = new Directory(addedDir) await this._cachePathsForDirectory(projectDirectory, directory) - this.emit("rebuild-cache-done") } /** @@ -244,10 +238,8 @@ export default class PathsCache extends EventEmitter { * @param removedDir {string} */ onRemoveDir(projectDirectory, removedDir) { - this.emit("rebuild-cache") const directory = new Directory(removedDir) this._removeFilePathsForDirectory(projectDirectory, directory) - this.emit("rebuild-cache-done") } /**