use of com.jetbrains.cidr.execution.debugger.evaluation.renderers.ValueRenderer in project intellij-plugins by JetBrains.
the class MotionValueRendererFactory method createRenderer.
@Nullable
@Override
public ValueRenderer createRenderer(@NotNull FactoryContext context) throws ExecutionException, DebuggerCommandException {
try {
LLValueData data = context.getLLValueData();
if (data.isValidPointer()) {
context.getEvaluationContext().evaluate(EvaluationContext.cast("rb_inspect(" + EvaluationContext.cast(data.getPointer(), "id") + ")", "id"));
// we want ObjC renderers for our collections
// Ruby collections are inheriting from native ones and don't have any useful instance variables
final ValueRenderer collectionRenderer = new NSCollectionValueRenderer.Factory().createRenderer(context);
return collectionRenderer != null ? collectionRenderer : new MotionObjectRenderer(context.getPhysicalValue());
}
} catch (DebuggerCommandException ignored) {
}
return null;
}
Aggregations