mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-23 22:04:59 +00:00
aider: Created new function prompt_ask
in Coder
class and replaced all calls to Prompt.ask
with the new function.
# Context: USER: make a new func self.prompt_ask which just calls Prompt.ask and returns the result. change all calls to use it. ASSISTANT: I will create a new function `prompt_ask` in the `Coder` class and replace all calls to `Prompt.ask` with the new function. ```python aider/coder.py <<<<<<< ORIGINAL class Coder: abs_fnames = set() def confirm_ask(self, question, default=None): ======= class Coder: abs_fnames = set() def confirm_ask(self, question, default=None): return Confirm.ask(question, console=self.console, default=default) def prompt_ask(self, question, default=None): return Prompt.ask(question, console=self.console, default=default) >>>>>>> UPDATED aider/coder.py <<<<<<< ORIGINAL res = Prompt.ask( ======= res = self.prompt_ask( >>>>>>> UPDATED "[bright_black]Commit before the chat proceeds? \[y/n/commit message]", # noqa: W605 E501 console=self.console, default="y", ).strip() ```
This commit is contained in:
parent
428d6f73fc
commit
625fd1c3a5
1 changed files with 5 additions and 1 deletions
|
@ -33,6 +33,10 @@ class Coder:
|
|||
def confirm_ask(self, question, default=None):
|
||||
return Confirm.ask(question, console=self.console, default=default)
|
||||
|
||||
def prompt_ask(self, question, default=None):
|
||||
return Prompt.ask(question, console=self.console, default=default)
|
||||
return Confirm.ask(question, console=self.console, default=default)
|
||||
|
||||
repo = None
|
||||
last_aider_commit_hash = None
|
||||
|
||||
|
@ -517,7 +521,7 @@ class Coder:
|
|||
self.console.print("[bright_black]Files have uncommitted changes.\n")
|
||||
self.console.print(f"[bright_black]Suggested commit message:\n{commit_message}\n")
|
||||
|
||||
res = Prompt.ask(
|
||||
res = self.prompt_ask(
|
||||
"[bright_black]Commit before the chat proceeds? \[y/n/commit message]", # noqa: W605 E501
|
||||
console=self.console,
|
||||
default="y",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue