Skip to content

Commit b0bf5c7

Browse files
committed
fix(debugger): corrected order of sequences and values in variables view
closes #371 and closes #372
1 parent 01e8430 commit b0bf5c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
from robot.errors import VariableError
3434
from robot.output import LOGGER
3535
from robot.running import EXECUTION_CONTEXTS, Keyword, TestCase, TestSuite
36-
from robot.utils import NormalizedDict
3736
from robot.variables import evaluate_expression
3837

3938
from robotcode.core.event import event
@@ -1386,6 +1385,7 @@ def _create_variable(self, name: str, value: Any) -> Variable:
13861385
variables_reference=v_id,
13871386
named_variables=len(value) + 1,
13881387
indexed_variables=0,
1388+
presentation_hint=VariablePresentationHint(kind="data"),
13891389
)
13901390

13911391
if isinstance(value, Sequence) and not isinstance(value, str):
@@ -1398,6 +1398,7 @@ def _create_variable(self, name: str, value: Any) -> Variable:
13981398
variables_reference=v_id,
13991399
named_variables=1,
14001400
indexed_variables=len(value),
1401+
presentation_hint=VariablePresentationHint(kind="data"),
14011402
)
14021403

14031404
return Variable(name=name, value=repr(value), type=repr(type(value)))
@@ -1420,7 +1421,7 @@ def get_variables(
14201421
count: Optional[int] = None,
14211422
format: Optional[ValueFormat] = None,
14221423
) -> List[Variable]:
1423-
result: MutableMapping[str, Any] = NormalizedDict(ignore="_")
1424+
result: MutableMapping[str, Any] = {}
14241425

14251426
if filter is None:
14261427
entry = next(
@@ -1520,7 +1521,7 @@ def get_variables(
15201521

15211522
padding = len(str(len(value)))
15221523

1523-
for i, v in enumerate(value, start or 0):
1524+
for i, v in enumerate(value[start:], start or 0):
15241525
result[str(i)] = self._create_variable(str(i).zfill(padding), v)
15251526
c += 1
15261527
if count is not None and c >= count:

0 commit comments

Comments
 (0)