Skip to content

Commit 7e0b55c

Browse files
committed
fix: #125 Robot Code crashes with a variables file containing a Dict[str, Callable]
1 parent b6ad7dd commit 7e0b55c

File tree

1 file changed

+4
-5
lines changed
  • packages/language_server/robotcode/language_server/robotframework/diagnostics

1 file changed

+4
-5
lines changed

packages/language_server/robotcode/language_server/robotframework/diagnostics/library_doc.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,6 +1560,7 @@ def import_variables(self, path: str, args: Optional[Tuple[Any, ...]] = None) ->
15601560

15611561
importer = MyPythonImporter(libcode)
15621562

1563+
# TODO: add type information of the value including dict key names and member names
15631564
vars: List[ImportedVariableDefinition] = [
15641565
ImportedVariableDefinition(
15651566
1,
@@ -1569,11 +1570,9 @@ def import_variables(self, path: str, args: Optional[Tuple[Any, ...]] = None) ->
15691570
source or (module_spec.origin if module_spec is not None else None) or "",
15701571
name,
15711572
None,
1572-
value=NativeValue(value)
1573-
if value is None or isinstance(value, (int, float, bool, str, dict, list))
1574-
else None,
1575-
has_value=value is None or isinstance(value, (int, float, bool, str, dict, list)),
1576-
value_is_native=value is None or isinstance(value, (int, float, bool, str, dict, list)),
1573+
value=NativeValue(value) if value is None or isinstance(value, (int, float, bool, str)) else None,
1574+
has_value=value is None or isinstance(value, (int, float, bool, str)),
1575+
value_is_native=value is None or isinstance(value, (int, float, bool, str)),
15771576
)
15781577
for name, value in importer.import_variables(import_name, args)
15791578
]

0 commit comments

Comments
 (0)