From 56aaa0822485c1a359ecb0c27280c1e6c5951bd6 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sun, 1 Dec 2024 07:25:51 -0800 Subject: [PATCH] refactor: use get_ai_comment method instead of direct regex matching --- aider/watch.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aider/watch.py b/aider/watch.py index 146c42267..1821e2c40 100644 --- a/aider/watch.py +++ b/aider/watch.py @@ -102,12 +102,10 @@ class FileWatcher: # Check if file contains AI markers try: - #ai use self.ai_comments() instead! - content = self.io.read_text(str(path_abs)) - res = bool(re.search(r"(?:#|//) *ai\b", content, re.IGNORECASE)) + comments = self.get_ai_comment(str(path_abs)) if self.verbose: - dump(res) - return res + dump(bool(comments)) + return bool(comments) except Exception as err: if self.verbose: print("error")