mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-30 09:14:59 +00:00
feat: implement fuzzy filename matching
This commit is contained in:
parent
dfce19f186
commit
e17a1fff3a
1 changed files with 5 additions and 3 deletions
|
@ -551,11 +551,13 @@ def find_filename(lines, fence, valid_fnames):
|
|||
if fname == vfn.name:
|
||||
return vfn
|
||||
|
||||
# Perform fuzzy matching with valid_fnames
|
||||
for fname in filenames:
|
||||
# todo: do a fuzzt match with the valid_fnames
|
||||
pass
|
||||
close_matches = difflib.get_close_matches(fname, valid_fnames, n=1, cutoff=0.6)
|
||||
if close_matches:
|
||||
return close_matches[0]
|
||||
|
||||
# look for a file w/extension
|
||||
# If no fuzzy match, look for a file w/extension
|
||||
for fname in filenames:
|
||||
if "." in fname:
|
||||
return fname
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue