Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion aider/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from packaging import version

__version__ = "0.89.0.dev"
__version__ = "0.89.1.dev"
safe_version = __version__

try:
Expand Down
28 changes: 14 additions & 14 deletions aider/coders/chat_chunks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ def all_messages(self):
return messages
else:
return (
self.format_list(self.system)
+ self.format_list(self.static)
+ self.format_list(self.examples)
+ self.format_list(self.readonly_files)
+ self.format_list(self.chat_files)
+ self.format_list(self.repo)
+ self.format_list(self.pre_message)
+ self.format_list(self.done)
+ self.format_list(self.edit_files)
+ self.format_list(self.cur)
+ self.format_list(self.post_message)
+ self.format_list(self.reminder)
self.format_list("system")
+ self.format_list("static")
+ self.format_list("examples")
+ self.format_list("readonly_files")
+ self.format_list("chat_files")
+ self.format_list("repo")
+ self.format_list("pre_message")
+ self.format_list("done")
+ self.format_list("edit_files")
+ self.format_list("cur")
+ self.format_list("post_message")
+ self.format_list("reminder")
)

def add_cache_control_headers(self):
Expand Down Expand Up @@ -86,7 +86,7 @@ def cacheable_messages(self):
return messages

def format_list(self, chunk):
if type(chunk) is not list:
if type(getattr(self, chunk, [])) is not list:
return []

return chunk
return getattr(self, chunk, [])
23 changes: 19 additions & 4 deletions aider/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,12 +1083,27 @@ def completions_context_blocks(self):
]

def _handle_read_only_files(self, expanded_word, file_set, description=""):
"""Handle read-only files with substring matching and samefile check"""
"""Handle read-only files with substring matching, samefile check, and glob pattern matching"""
matched = []
for f in file_set:
if expanded_word in f:
matched.append(f)
continue
# Check if the expanded_word contains glob characters
if any(c in expanded_word for c in "*?[]"):
# Use pathlib.Path.match() for glob pattern matching
try:
# Convert file path to Path object
file_path = Path(f)
# Check if the file path matches the glob pattern
if file_path.match(os.path.abspath(expanded_word)):
matched.append(f)
continue
except Exception:
# If path matching fails, fall back to other methods
pass
else:
# Original substring matching for non-glob patterns
if expanded_word in f:
matched.append(f)
continue

# Try samefile comparison for relative paths
try:
Expand Down
Loading