Search in sources :

Example 1 with MotionMemberValue

use of org.jetbrains.plugins.ruby.motion.run.MotionMemberValue in project intellij-plugins by JetBrains.

the class MotionObjectRenderer method doComputeChildren.

@Override
protected void doComputeChildren(@NotNull EvaluationContext context, @NotNull XCompositeNode container) throws ExecutionException, DebuggerCommandException {
    final Collection<CidrValue> children = new ArrayList<>();
    final LLValue names = getInstanceVariablesNames(context);
    final int count = count(context, names);
    for (int i = 0; i < count; i++) {
        final String selName = EvaluationContext.cast("sel_registerName(\"objectAtIndex:\")", "id");
        final String nameExpr = EvaluationContext.cast("objc_msgSend(" + getSelf(names, context) + ", " + selName + ", " + i + ")", "id");
        final LLValueData name = context.evaluateData(nameExpr);
        final String namePointer = "(char *)[[" + name.getPointer() + " description] UTF8String]";
        final String ivarName = TextUtil.removeQuoting(context.evaluateData(namePointer).getPresentableValue());
        final String ivarExpr = getChildEvaluationExpression(context, ivarName);
        final LLValue ivar = context.evaluate(ivarExpr);
        children.add(new MotionMemberValue(ivar, ivarName, myValue));
    }
    CidrValue.addAllTo(children, container);
}
Also used : MotionMemberValue(org.jetbrains.plugins.ruby.motion.run.MotionMemberValue) LLValue(com.jetbrains.cidr.execution.debugger.backend.LLValue) LLValueData(com.jetbrains.cidr.execution.debugger.backend.LLValueData) ArrayList(java.util.ArrayList) CidrValue(com.jetbrains.cidr.execution.debugger.evaluation.CidrValue)

Aggregations

LLValue (com.jetbrains.cidr.execution.debugger.backend.LLValue)1 LLValueData (com.jetbrains.cidr.execution.debugger.backend.LLValueData)1 CidrValue (com.jetbrains.cidr.execution.debugger.evaluation.CidrValue)1 ArrayList (java.util.ArrayList)1 MotionMemberValue (org.jetbrains.plugins.ruby.motion.run.MotionMemberValue)1