From 3d8ec25a33da476d81ea246145d22102864cbfdb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 25 Oct 2024 16:05:50 -0700 Subject: [PATCH] fix: update AI comment extraction to include full match --- aider/watch.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/watch.py b/aider/watch.py index 09db8a77c..13c31b8ce 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -135,7 +135,6 @@ def watch_source_files( result[file] = comments yield result - def get_ai_comment(filepath, encoding="utf-8"): """Extract all AI comments from a file""" comments = [] @@ -143,6 +142,7 @@ def get_ai_comment(filepath, encoding="utf-8"): with open(filepath, encoding=encoding, errors="ignore") as f: for line in f: if match := re.search(r"(?:#|//) *ai\b(.*)", line, re.IGNORECASE): + #ai return the whole thing, including the group0 comment = match.group(1).strip() if comment: comments.append(comment)