mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-05 12:14:59 +00:00
feat: add analytics event hooks to file watcher
This commit is contained in:
parent
a997dd6c49
commit
89bc3b6b16
2 changed files with 3 additions and 0 deletions
|
@ -858,6 +858,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
|
||||||
ignores.append(args.aiderignore)
|
ignores.append(args.aiderignore)
|
||||||
|
|
||||||
if args.watch_files:
|
if args.watch_files:
|
||||||
|
# AI pass analytics in
|
||||||
file_watcher = FileWatcher(coder, gitignores=ignores, verbose=args.verbose)
|
file_watcher = FileWatcher(coder, gitignores=ignores, verbose=args.verbose)
|
||||||
coder.file_watcher = file_watcher
|
coder.file_watcher = file_watcher
|
||||||
|
|
||||||
|
|
|
@ -171,6 +171,7 @@ class FileWatcher:
|
||||||
|
|
||||||
if fname in self.coder.abs_fnames:
|
if fname in self.coder.abs_fnames:
|
||||||
continue
|
continue
|
||||||
|
# AI: fire an event()
|
||||||
self.coder.abs_fnames.add(fname)
|
self.coder.abs_fnames.add(fname)
|
||||||
rel_fname = self.coder.get_rel_fname(fname)
|
rel_fname = self.coder.get_rel_fname(fname)
|
||||||
self.io.tool_output(f"Added {rel_fname} to the chat")
|
self.io.tool_output(f"Added {rel_fname} to the chat")
|
||||||
|
@ -179,6 +180,7 @@ class FileWatcher:
|
||||||
if not has_bangs:
|
if not has_bangs:
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
# fire a different event. AI!
|
||||||
self.io.tool_output("Processing your request...")
|
self.io.tool_output("Processing your request...")
|
||||||
|
|
||||||
res = """
|
res = """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue