Data Type Renderers

hi,

i was wondering if i could use the Customize Data Views feature of the debugger.

basically i have a type FingerTree.IndexedSummed and i want it to be rendered by calling the toList method and then toString.

currently i'm seeing the default toString which is for example

de.sciss.fingertree.FingerTree$IndexedSummed$$anon$2@768

ok, so open Customize Data Views and select the Data Type Renderers tab, i add an entry:

Renderer name: Path
Apply renderer to objects of type: de.sciss.fingertree.FingerTree$IndexedSummed$$anon$2
When rendering the node: Use the following expression: ???

so what do i need to put in the ???. i tried intuitively _.toList.toString but this doesn't work. which is the placeholder for the object rendered?

thanks, -sciss-

4 comments
Comment actions Permalink

p.s.: when i apply the renderer as described, i get the following error printed in the variables list of the debugger: "unable to evaluate the expression Cannot find source class for current stack frame"

0
Comment actions Permalink

All the debugger features require Java snippets currenty (watches, expression eval, conditional breakpooints, and data type renderers.)

0
Comment actions Permalink

Ok, but I still can't get any expression to work, no matter whether I used Scala or Java syntax.

In my example following for instance http://blogs.jetbrains.com/idea/2008/04/type-renderers/ , i should be able to have expression "toList()" or "toList().toString()" working.

i use type "de.sciss.fingertree.FingerTree$IndexedSummed" now (omitting the anonmous inner class), use the default renderer, and try out the expanding node feature.

Use list of expressions: Name = asList ; Expression = toList()

the toList even comes up in the autocompletion, so i think i'm doing something right there. but then in the debugger, when i expand the node, i just get "'this' is not available" ...

best, -sciss-

0
Comment actions Permalink

You're probably trying to call a method defined in a traits. You'll might need to use $this rather than this.

Basically, you need to understand how scala is translated to bytecode to advanced things in the debugger.

Use the expression evaluators (ALT-F8) is a good way to explore.

0

Please sign in to leave a comment.