mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-24 22:34:59 +00:00
Handle missing filenames by scanning for mentions
in the text
This commit is contained in:
parent
f2a03e917d
commit
ac560c2877
3 changed files with 61 additions and 7 deletions
|
@ -167,9 +167,10 @@ class Coder:
|
|||
self.io.tool_output(f"Added {fname} to the chat.")
|
||||
|
||||
def find_common_root(self):
|
||||
if self.abs_fnames:
|
||||
common_prefix = os.path.commonpath(list(self.abs_fnames))
|
||||
self.root = os.path.dirname(common_prefix)
|
||||
if len(self.abs_fnames) == 1:
|
||||
self.root = os.path.dirname(list(self.abs_fnames)[0])
|
||||
elif self.abs_fnames:
|
||||
self.root = os.path.commonpath(list(self.abs_fnames))
|
||||
else:
|
||||
self.root = os.getcwd()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue