mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-28 16:25:00 +00:00
fix: handle empty paths and dotfiles in get_ident_filename_matches
This commit is contained in:
parent
6a1f4431d0
commit
e5ca922ce8
1 changed files with 13 additions and 3 deletions
|
@ -613,9 +613,19 @@ class Coder:
|
|||
def get_ident_filename_matches(self, idents):
|
||||
all_fnames = defaultdict(set)
|
||||
for fname in self.get_all_relative_files():
|
||||
base = Path(fname).with_suffix("").name.lower()
|
||||
if len(base) >= 5:
|
||||
all_fnames[base].add(fname)
|
||||
# Skip empty paths or just '.'
|
||||
if not fname or fname == '.':
|
||||
continue
|
||||
|
||||
try:
|
||||
# Handle dotfiles properly
|
||||
path = Path(fname)
|
||||
base = path.stem.lower() # Use stem instead of with_suffix("").name
|
||||
if len(base) >= 5:
|
||||
all_fnames[base].add(fname)
|
||||
except ValueError:
|
||||
# Skip paths that can't be processed
|
||||
continue
|
||||
|
||||
matches = set()
|
||||
for ident in idents:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue