IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
Tips & Tricks
Debugger: working with sub-ranges for arrays and lists
During debugging IntelliJ IDEA shows only the first 100 elements of arrays and collections. It’s enough in most cases. However, it’s sometimes convenient to use a custom range. Exactly for this the ‘Adjust Range’ action has been available for arrays for quite a long time. But recently we’ve made a couple of improvements to it. Namely:
- ‘Adjust Range’ works with lists now
- adjusted range is preserved for local variables delivered to another stack frame
Quick demonstration example:
- Start debugger and wait until target break point is hit;
- Right click on target array/list and select the ‘Adjust Range…’ action:
- Define a range:
- Check the result: