refactor: move FileWatcher initialization to main.py

This commit is contained in:
Paul Gauthier 2024-11-27 17:32:12 -08:00 committed by Paul Gauthier (aider)
parent 920917a47e
commit 2f78b6f7f3
2 changed files with 4 additions and 3 deletions

View file

@ -198,6 +198,7 @@ class InputOutput:
llm_history_file=None,
editingmode=EditingMode.EMACS,
fancy_input=True,
file_watcher=None,
):
self.placeholder = None
self.never_prompts = set()
@ -262,6 +263,8 @@ class InputOutput:
else:
self.console = Console(force_terminal=False, no_color=True) # non-pretty
self.file_watcher = file_watcher
def _get_style(self):
style_dict = {}
if not self.pretty:
@ -391,8 +394,6 @@ class InputOutput:
):
self.rule()
gitignore = [str(Path(root) / ".gitignore")]
self.file_watcher = FileWatcher(root, encoding=self.encoding, gitignores=gitignore)
self.file_watcher.start()
rel_fnames = list(rel_fnames)

View file

@ -800,7 +800,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
ignores.append(str(Path(git_root) / ".gitignore"))
if args.aiderignore:
ignores.append(args.aiderignore)
io.file_watcher = FileWatcher(coder.root, encoding=io.encoding, gitignores=ignores)
FileWatcher(coder, encoding=io.encoding, gitignores=ignores)
coder.show_announcements()