Accept code completions without parent and full_name,
@@ -880,6 +880,7 @@ class MicroPythonBackend:
completions = script.completions()
result["completions"] = self._filter_completions(completions)
except Exception:
+ traceback.print_exc()
result["error"] = "Autocomplete error"
return result
@@ -891,6 +892,7 @@ class MicroPythonBackend:
if completion.name.startswith("__"):
continue
+ if completion.parent() and completion.full_name:
parent_name = completion.parent().name
name = completion.name
root = completion.full_name.split(".")[0]
@@ -902,7 +904,7 @@ class MicroPythonBackend:
if parent_name == "builtins" and name not in self._builtins_info:
continue
- result.append({"name": name, "complete": completion.complete})
+ result.append({"name": completion.name, "complete": completion.complete})
return result
