mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
wip: Refactor file mentions check in Coder class to strip away all kinds of quotes and drop sentence punctuation.
This commit is contained in:
parent
4d800b1e31
commit
9c2f8e22d8
1 changed files with 7 additions and 2 deletions
|
@ -298,8 +298,13 @@ class Coder:
|
|||
|
||||
def check_for_file_mentions(self, content):
|
||||
words = set(word for word in content.split())
|
||||
for quote in ['"', "'", "`"]:
|
||||
words = set(word.strip(quote) for word in words)
|
||||
|
||||
# drop sentence punctuation from the end
|
||||
words = set(word.rstrip(',.!;') for word in words)
|
||||
|
||||
# strip away all kinds of quotes
|
||||
quotes = ''.join(['"', "'", "`"])
|
||||
words = set(word.strip(quotes) for word in words)
|
||||
|
||||
addable_rel_fnames = set(self.get_all_relative_files()) - set(
|
||||
self.get_inchat_relative_files()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue