diff --git a/aider/args.py b/aider/args.py index b880605a90a..e565bc4438e 100644 --- a/aider/args.py +++ b/aider/args.py @@ -303,6 +303,15 @@ def get_parser(default_config_files, git_root): type=float, default=2, help="Multiplier for map tokens when no files are specified (default: 2)", + ) + group.add_argument( + "--map-cache-dir", + metavar="MAP_CACHE_DIR", + default=".", + help=( + "Root directory for the repository map cache .aider.tags.cache.v3" + " (default: current directory)" + ), ) ########## diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 8e781437227..89de89e35a0 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -295,7 +295,11 @@ def __init__( ignore_mentions=None, file_watcher=None, auto_copy_context=False, + map_root='.', ): + # initialize from args.map_root + self.map_root = map_root + # Fill in a dummy Analytics if needed, but it is never .enable()'d self.analytics = analytics if analytics is not None else Analytics() @@ -442,7 +446,7 @@ def __init__( if use_repo_map and self.repo and has_map_prompt: self.repo_map = RepoMap( map_tokens, - self.root, + self.map_root, self.main_model, io, self.gpt_prompts.repo_content_prefix, diff --git a/aider/main.py b/aider/main.py index 943c74d21dc..243a492d5e0 100644 --- a/aider/main.py +++ b/aider/main.py @@ -886,6 +886,7 @@ def get_io(pretty): chat_language=args.chat_language, detect_urls=args.detect_urls, auto_copy_context=args.copy_paste, + map_root=args.map_root, # initialize from args.map_root ) except UnknownEditFormat as err: io.tool_error(str(err)) diff --git a/aider/repomap.py b/aider/repomap.py index 23f40ba71f9..bd30a92132c 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -78,6 +78,9 @@ def __init__( self.io.tool_output( f"RepoMap initialized with map_mul_no_files: {self.map_mul_no_files}" ) + self.io.tool_output( + f"RepoMap initialized with map_root: {self.root}" + ) def token_count(self, text): len_text = len(text)