feat: add support for inline AI comments in code files

This commit is contained in:
Paul Gauthier 2024-10-25 16:21:20 -07:00 committed by Paul Gauthier (aider)
parent 25dd9f1f35
commit f6daab0728

View file

@ -144,7 +144,7 @@ def get_ai_comment(filepath, encoding="utf-8"):
comments = []
try:
with open(filepath, encoding=encoding, errors="ignore") as f:
for line in f:
for line in f:#ai
if match := re.search(r"(?:#|//) *ai\b?(.*)", line, re.IGNORECASE):
comment = match.group(1).strip()
if comment: