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

Method check_for_file_mentions

aider/coders/base_coder.py:1761–1781  ·  view source on GitHub ↗
(self, content)

Source from the content-addressed store, hash-verified

1759 return mentioned_rel_fnames
1760
1761 def check_for_file_mentions(self, content):
1762 mentioned_rel_fnames = self.get_file_mentions(content)
1763
1764 new_mentions = mentioned_rel_fnames - self.ignore_mentions
1765
1766 if not new_mentions:
1767 return
1768
1769 added_fnames = []
1770 group = ConfirmGroup(new_mentions)
1771 for rel_fname in sorted(new_mentions):
1772 if self.io.confirm_ask(
1773 "Add file to the chat?", subject=rel_fname, group=group, allow_never=True
1774 ):
1775 self.add_rel_fname(rel_fname)
1776 added_fnames.append(rel_fname)
1777 else:
1778 self.ignore_mentions.add(rel_fname)
1779
1780 if added_fnames:
1781 return prompts.added_files.format(fnames=", ".join(added_fnames))
1782
1783 def send(self, messages, model=None, functions=None):
1784 self.got_reasoning_content = False

Calls 4

get_file_mentionsMethod · 0.95
add_rel_fnameMethod · 0.95
ConfirmGroupClass · 0.90
confirm_askMethod · 0.45