Skip to content

Commit

Permalink
tips for ticket
Browse files Browse the repository at this point in the history
  • Loading branch information
lukealvoeiro committed Aug 27, 2024
1 parent 6ab1df0 commit 4d65ce1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/goose/cli/prompt/goose_prompt_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def get_user_input(self) -> "UserInput":
try:
text = FormattedText([("#00AEAE", "G❯ ")]) # Define the prompt style and text.
message = self.prompt_session.prompt(text, validator=PromptValidator(), validate_while_typing=False)
# TODO: process any commands that are present in the message, modify the message accordingly
if message.strip() in ("exit", ":q"):
return UserInput(PromptAction.EXIT)
return UserInput(PromptAction.CONTINUE, message)
Expand Down
5 changes: 5 additions & 0 deletions src/goose/cli/prompt/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
from prompt_toolkit.lexers import Lexer


# These are lexers for the commands in the prompt. This is how we
# are extracting the different parts of a command (here, used for styling),
# but likely will be used to parse the command as well in the future.


def completion_for_command(target_string: str) -> re.Pattern[str]:
escaped_string = re.escape(target_string)
vals = [f"(?:{escaped_string[:i]}(?=$))" for i in range(len(escaped_string), 0, -1)]
Expand Down
2 changes: 1 addition & 1 deletion src/goose/command/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,5 @@ def get_completions(self, query: str) -> List[Completion]:
return completions

def execute(self, query: str) -> str | None:
# GOOSE-TODO: return the query
# TODO: return the query
pass

0 comments on commit 4d65ce1

Please sign in to comment.