feat(repo-map): configurable negate patterns (#844)
This commit is contained in:
parent
fb7567ac24
commit
3abdb69fa2
@ -212,6 +212,7 @@ M.defaults = {
|
||||
--- @class AvanteRepoMapConfig
|
||||
repo_map = {
|
||||
ignore_patterns = { "%.git", "%.worktree", "__pycache__", "node_modules" }, -- ignore files matching these
|
||||
negate_patterns = {}, -- negate ignore files matching these.
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -48,8 +48,9 @@ end
|
||||
function RepoMap._build_repo_map(project_root, file_ext)
|
||||
local output = {}
|
||||
local gitignore_path = project_root .. "/.gitignore"
|
||||
local gitignore_patterns, negate_patterns = Utils.parse_gitignore(gitignore_path)
|
||||
local gitignore_patterns, gitignore_negate_patterns = Utils.parse_gitignore(gitignore_path)
|
||||
local ignore_patterns = vim.list_extend(gitignore_patterns, Config.repo_map.ignore_patterns)
|
||||
local negate_patterns = vim.list_extend(gitignore_negate_patterns, Config.repo_map.negate_patterns)
|
||||
|
||||
local filepaths = Utils.scan_directory(project_root, ignore_patterns, negate_patterns)
|
||||
vim.iter(filepaths):each(function(filepath)
|
||||
|
Loading…
x
Reference in New Issue
Block a user