aider: Updated regex pattern to recognize file paths that start with a dot.

# Context:
USER: the file path part of the regex is not recognizing files that start with a . like .bash_history
ASSISTANT: I see. I'll update the regex pattern in `aider/coder.py` to recognize file paths that start with a dot (e.g., `.bash_history`). Here are the changes:

```python
aider/coder.py
<<<<<<< ORIGINAL
        r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*\w+(\.[\w\s.-]+)*)"
=======
        r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*(?:\w+|\.\w+)(\.[\w\s.-]+)*)"
>>>>>>> UPDATED
```

This update should now correctly recognize file paths that start with a dot.
This commit is contained in:
Paul Gauthier 2023-05-10 21:17:45 -07:00
parent aca96263d8
commit a4c58cf106

View file

@ -347,7 +347,7 @@ class Coder:
# Optional: Matches the start of a code block (e.g., ```python) and any following whitespace
r"(^```\S*\s*)?"
# Matches the file path
r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*\w+(\.[\w\s.-]+)*)"
r"^((?:[a-zA-Z]:\\|/)?(?:[\w\s.-]+[\\/])*(?:\w+|\.\w+)(\.[\w\s.-]+)*)"
# Optional: Matches the end of a code block (e.g., ```) and any following whitespace
r"\s+(^```\S*\s*)?"
# Matches the start of the ORIGINAL section and captures its content