mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
cleanup --show-repo-map
This commit is contained in:
parent
041c19b7dd
commit
6ab4f09a3a
2 changed files with 16 additions and 11 deletions
|
@ -344,6 +344,14 @@ class Coder:
|
||||||
|
|
||||||
return prompt
|
return prompt
|
||||||
|
|
||||||
|
def get_repo_map(self):
|
||||||
|
if not self.repo_map:
|
||||||
|
return
|
||||||
|
|
||||||
|
other_files = set(self.get_all_abs_files()) - set(self.abs_fnames)
|
||||||
|
repo_content = self.repo_map.get_repo_map(self.abs_fnames, other_files)
|
||||||
|
return repo_content
|
||||||
|
|
||||||
def get_files_messages(self):
|
def get_files_messages(self):
|
||||||
all_content = ""
|
all_content = ""
|
||||||
if self.abs_fnames:
|
if self.abs_fnames:
|
||||||
|
@ -354,13 +362,11 @@ class Coder:
|
||||||
|
|
||||||
all_content += files_content
|
all_content += files_content
|
||||||
|
|
||||||
other_files = set(self.get_all_abs_files()) - set(self.abs_fnames)
|
repo_content = self.get_repo_map()
|
||||||
if self.repo_map:
|
if repo_content:
|
||||||
repo_content = self.repo_map.get_repo_map(self.abs_fnames, other_files)
|
if all_content:
|
||||||
if repo_content:
|
all_content += "\n"
|
||||||
if all_content:
|
all_content += repo_content
|
||||||
all_content += "\n"
|
|
||||||
all_content += repo_content
|
|
||||||
|
|
||||||
files_messages = [
|
files_messages = [
|
||||||
dict(role="user", content=all_content),
|
dict(role="user", content=all_content),
|
||||||
|
|
|
@ -389,10 +389,9 @@ def main(args=None, input=None, output=None):
|
||||||
)
|
)
|
||||||
|
|
||||||
if args.show_repo_map:
|
if args.show_repo_map:
|
||||||
other_files = set(coder.get_all_abs_files()) - set(coder.abs_fnames)
|
repo_map = coder.get_repo_map()
|
||||||
if coder.repo_map:
|
if repo_map:
|
||||||
repo_content = coder.repo_map.get_repo_map(coder.abs_fnames, other_files)
|
io.tool_output(repo_map)
|
||||||
print(repo_content)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
if args.dirty_commits:
|
if args.dirty_commits:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue