mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-04 19:55:00 +00:00
refactor: use get_ai_comments() instead of duplicating pattern matching
This commit is contained in:
parent
e001b7fb46
commit
791cbab6f6
1 changed files with 2 additions and 5 deletions
|
@ -108,11 +108,8 @@ class FileWatcher:
|
||||||
|
|
||||||
# Check if file contains AI markers
|
# Check if file contains AI markers
|
||||||
try:
|
try:
|
||||||
# TODO: use get_ai_comments() for this
|
_, _, has_match = self.get_ai_comments(str(path_abs))
|
||||||
with open(str(path_abs), "r", encoding=self.io.encoding) as f:
|
return has_match
|
||||||
content = f.read()
|
|
||||||
match = self.ai_comment_pattern.search(content)
|
|
||||||
return bool(match)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue