Skip to content

Commit 75dfd45

Browse files
committed
feat: Add /context command for contextually-aware edits
1 parent 5661d14 commit 75dfd45

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

aider/commands.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ def cmd_chat_mode(self, args):
147147
" them."
148148
),
149149
),
150+
(
151+
"context",
152+
"Work with surrounding code context for more contextually-aware edits."
153+
),
150154
]
151155
)
152156

@@ -1125,6 +1129,9 @@ def completions_code(self):
11251129

11261130
def completions_architect(self):
11271131
raise CommandCompletionException()
1132+
1133+
def completions_context(self):
1134+
raise CommandCompletionException()
11281135

11291136
def cmd_ask(self, args):
11301137
"""Ask questions about the code base without editing any files. If no prompt provided, switches to ask mode.""" # noqa
@@ -1137,6 +1144,10 @@ def cmd_code(self, args):
11371144
def cmd_architect(self, args):
11381145
"""Enter architect/editor mode using 2 different models. If no prompt provided, switches to architect/editor mode.""" # noqa
11391146
return self._generic_chat_command(args, "architect")
1147+
1148+
def cmd_context(self, args):
1149+
"""Enter context mode to see surrounding code context. If no prompt provided, switches to context mode.""" # noqa
1150+
return self._generic_chat_command(args, "context")
11401151

11411152
def _generic_chat_command(self, args, edit_format):
11421153
if not args.strip():

0 commit comments

Comments
 (0)