Changing one line summary of a variable in Debug View Variables tab

I'm using WebStorm 2017.3.

When debugging a NodeJS program and stopped in the debugger, the Variables tab displays variables shows the contents of a variable (ok this is just to set the context).

I'm debugging code that uses immutable.js and by default lists, sets, etc show internal fields that are of no use to me.  For example, if I have an immutable.List object it displays like this (it has 5 objects in it)

immutableList = List {size:5,_origin:0,_capacity:5,_level:5,_root:...}

to make matters worse, to actually see what is in the list, I have to drill down and click three times.

+ immutableList    
+ _tail     
+ _array
> 0 = MyClass1 { field1: "hello", field2: ...}
> 1 = MyClass1 { field1: "goodbye", field2: ...}
> 2 = MyClass1 { field1: "sample", field2: ...}
... etc

After the array is expanded I can see the contents of what is in the list.

I'd like to define a custom function to use to display the summary view so I could see something like this:

immutableList = List {size:5, ["hello", "goodbye", "sample", ... ] }

Is there any way in webstorm to do this?

Please sign in to leave a comment.