private IReadOnlyList<IREvaluationResultInfo> CreateChildren() =>
TaskExtensions.RunSynchronouslyOnUIThread(async ct => {
var valueResult = EvaluationResult as IRValueInfo;
if (valueResult == null) {
return new IREvaluationResultInfo[0];
}
REvaluationResultProperties properties = RToolsSettings.Current.EvaluateActiveBindings ? REvaluationResultProperties.ComputedValueProperty : 0;
properties |= PrefetchedProperties;
var children = await valueResult.DescribeChildrenAsync(properties, Repr, ChildrenMaxCount, ct);
// Children of environments do not have any meaningful order, so sort them by name.
if (valueResult.TypeName == "environment") {
children = children.OrderBy(er => er.Name).ToArray();
}
return children;
});