From c46542b182af24ff56148043d70974ab458c95c4 Mon Sep 17 00:00:00 2001 From: aminya Date: Wed, 11 Nov 2020 10:35:11 -0600 Subject: [PATCH] fix: update provider config on changes --- lib/autocomplete-paths.js | 2 ++ lib/paths-cache.js | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/autocomplete-paths.js b/lib/autocomplete-paths.js index 74922c0..f101707 100644 --- a/lib/autocomplete-paths.js +++ b/lib/autocomplete-paths.js @@ -28,6 +28,7 @@ export default { cacheOptions.forEach(cacheOption => { this.subscriptions.add(atom.config.observe(cacheOption, value => { if (!this._provider) return + this._provider.updateConfig() this._provider.rebuildCache() })) }) @@ -39,6 +40,7 @@ export default { scopeOptions.forEach(scopeOption => { this.subscriptions.add(atom.config.observe(scopeOption, value => { if (!this._provider) return + this._provider.updateConfig() this._provider.reloadScopes() })) }) diff --git a/lib/paths-cache.js b/lib/paths-cache.js index 9cb3323..18803bb 100644 --- a/lib/paths-cache.js +++ b/lib/paths-cache.js @@ -21,6 +21,10 @@ export default class PathsCache extends EventEmitter { this._filePathsByDirectory = new Map() this._fileWatchersByDirectory = new Map() + updateConfig() + } + + updateConfig() { this.config = { excludeVcsIgnoredPaths: atom.config.get('core.excludeVcsIgnoredPaths'), ignoreSubmodules: atom.config.get('autocomplete-paths.ignoreSubmodules'),