Skip to content

Commit 1cc6680

Browse files
committed
feat(debugger): switching between "keyword" and "expression" mode by typing # exprmode into debug console (default: keyword mode)
In the expression mode you can enter python expression and ask for variables and so on. In keyword mode you can enter robot framework statements, i.e. simple keyword call, IF/FOR/TRY statements, this also allows multi line input
1 parent 043842c commit 1cc6680

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/debugger/src/robotcode/debugger/debugger.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,6 +1306,14 @@ def evaluate(
13061306
if not expression:
13071307
return EvaluateResult(result="")
13081308

1309+
if (
1310+
(context == EvaluateArgumentContext.REPL or context == EvaluateArgumentContext.REPL.value)
1311+
and expression.startswith("#")
1312+
and expression[1:].strip() == "exprmode"
1313+
):
1314+
self.expression_mode = not self.expression_mode
1315+
return EvaluateResult(result="# Expression mode is now " + ("on" if self.expression_mode else "off"))
1316+
13091317
stack_frame = next((v for v in self.full_stack_frames if v.id == frame_id), None)
13101318

13111319
evaluate_context = stack_frame.context() if stack_frame else None

0 commit comments

Comments
 (0)