@@ -3,7 +3,7 @@ import { EventEmitter } from "events"
33import minimatch from "minimatch"
44import { Directory , File } from "atom"
55import { dirname , basename } from "path"
6- import { union } from "./utils"
6+ import { union , dedent } from "./utils"
77import { globifyPath , globifyDirectory , globifyGitIgnoreFile } from "globify-gitignore"
88import glob from "fast-glob"
99import * as chokidar from "chokidar"
@@ -175,6 +175,15 @@ export default class PathsCache extends EventEmitter {
175175 }
176176 // add a watcher to run `this._onDirectoryChanged`
177177 const projectPath = projectDirectory . getPath ( )
178+ if ( this . _filePathsByProjectDirectory . get ( projectPath ) . length >= this . config . maxFileCount ) {
179+ console . warn ( dedent `autocomplete-paths: Maximum file count of ${ this . config . maxFileCount } has been exceeded,
180+ so the subequent changes in the project are not tracked.
181+ See these link to learn more:
182+ https://github.com/atom-community/autocomplete-paths/wiki/Troubleshooting#maximum-file-limit-exceeded
183+ https://github.com/atom-community/autocomplete-paths/issues/270
184+ ` )
185+ return
186+ }
178187 const ignored = this . _allIgnoredGlobByDirectory . get ( projectDirectory . path )
179188 // TODO smarter handling of directory changes
180189 // TODO get paths from the watcher itself
0 commit comments