MCPcopy
hub / github.com/Aider-AI/aider / get_repo_map

Method get_repo_map

aider/coders/base_coder.py:709–748  ·  view source on GitHub ↗
(self, force_refresh=False)

Source from the content-addressed store, hash-verified

707 return matches
708
709 def get_repo_map(self, force_refresh=False):
710 if not self.repo_map:
711 return
712
713 cur_msg_text = self.get_cur_message_text()
714 mentioned_fnames = self.get_file_mentions(cur_msg_text)
715 mentioned_idents = self.get_ident_mentions(cur_msg_text)
716
717 mentioned_fnames.update(self.get_ident_filename_matches(mentioned_idents))
718
719 all_abs_files = set(self.get_all_abs_files())
720 repo_abs_read_only_fnames = set(self.abs_read_only_fnames) & all_abs_files
721 chat_files = set(self.abs_fnames) | repo_abs_read_only_fnames
722 other_files = all_abs_files - chat_files
723
724 repo_content = self.repo_map.get_repo_map(
725 chat_files,
726 other_files,
727 mentioned_fnames=mentioned_fnames,
728 mentioned_idents=mentioned_idents,
729 force_refresh=force_refresh,
730 )
731
732 # fall back to global repo map if files in chat are disjoint from rest of repo
733 if not repo_content:
734 repo_content = self.repo_map.get_repo_map(
735 set(),
736 all_abs_files,
737 mentioned_fnames=mentioned_fnames,
738 mentioned_idents=mentioned_idents,
739 )
740
741 # fall back to completely unhinted repo
742 if not repo_content:
743 repo_content = self.repo_map.get_repo_map(
744 set(),
745 all_abs_files,
746 )
747
748 return repo_content
749
750 def get_repo_messages(self):
751 repo_messages = []

Callers 2

get_repo_messagesMethod · 0.95

Calls 6

get_cur_message_textMethod · 0.95
get_file_mentionsMethod · 0.95
get_ident_mentionsMethod · 0.95
get_all_abs_filesMethod · 0.95
updateMethod · 0.80

Tested by

no test coverage detected