Skip to content

Commit

Permalink
fix: update provider config on changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Nov 11, 2020
1 parent d2c105e commit c46542b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/autocomplete-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}))
})
Expand All @@ -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()
}))
})
Expand Down
4 changes: 4 additions & 0 deletions lib/paths-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down

0 comments on commit c46542b

Please sign in to comment.