Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 1.03 KB

.ai-prompts.md

File metadata and controls

13 lines (9 loc) · 1.03 KB

Manage file exclusion more efficiently.

aiconfig.listScannedFilesFromConfig() handle the inclusion and exclusion of files based on a configuration file.

I find its way to handle it to be the worst on earth because when exclude_patterns happens to have something such as node_modules or dist in it, execution is very slow.

I want to change that, and first, I have put the ./lua/ai/globpattern.lua to be an utility to handle the glob pattern. Analyze the code of ./lua/ai/globpattern.lua and laverage it to improve the performance of aiconfig.listScannedFilesFromConfig(). I propose that we check the matching of the filepath against the exclude_patterns before pushing it to the included_files list. We should be able to get rid of the excluded_files list, because we already avoided pushing the excluded files to the included_files list.

Propose a new implementation of aiconfig.listScannedFilesFromConfig() that uses the utility functions from globpattern.lua to handle the inclusion and exclusion of files more efficiently.